Due to division before multiplication precision loss may cause _calculateHealthFactor to return slightly inaccurate results.
_calculateHealthFactor breaks up the health factor calculation into 2 lines both of which involve a division. Each one can result in a small amount of token losses. This can be reduced by refactoring both lines into 1 and completing the division last.
Due to collateralValueInUsd having 18 decimals the actual value of tokens lost will be minimal. However as the calculation does not need division to be done twice I believe the code should be refactored to reduce these losses.
Manual Review
Combine the last 2 lines into 1 and complete the division last to minimise precision loss.
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.