collateralAdjustedForThreshold
calculation can lose precision when collateralValueInUsd * LIQUIDATION_THRESHOLD
is not exactly divisible by LIQUIDATION_PRECISION
. The resulting value would roundoff to the lowest value and would lead to precision loss since decimals are not handled in Solidity.
For example, for collateralValueInUsd = 267
, collateralAdjustedForThreshold = 133
when the actual value should be 133.5
.
Calculated health factor will be lower than the real value.
Manual review
We multiply 1e18
with collateralAdjustedForThreshold
. Instead, first multiply and calculate the entire numerator before dividing:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.