The LendingPool::calculateHealthFactor function is intended to calculate the health factor of a user, which is a measure of the user's collateralization level relative to their debt. The function is documented to return the health factor in RAY (1e27), but the implementation returns the value scaled by 1e18 instead. This discrepancy between the documentation and the implementation can lead to incorrect calculations and misinterpretation of the health factor.
The Natspec explicitly states that the return value is in RAY (1e27).
The calculation multiplies collateralThreshold by 1e18 and divides it by userDebt. This results in a value scaled by 1e18, not 1e27 as documented.
Users or external systems relying on the health factor may misinterpret the risk level of a position, since all values are stores in ray.
manual review
return the health factor in RAY (1e27) as documented.
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.