The calculateLiquidityRate function in the contract incorrectly computes the liquidity rate due to the lack of division by RAY after the multiplication of utilizationRate and usageRate. This results in an overestimation of the liquidity rate, causing incorrect financial calculations in the protocol. The issue arises because both utilizationRate and usageRate are stored in RAY precision (1e27), and their multiplication results in a value scaled by RAY^2. However, without normalization by RAY, the final computed liquidity rate would be over-calculated.
Overestimated Liquidity Rate: The liquidity rate is significantly higher than expected, leading to excessive interest rate calculations.
utilizationRate is 50% (0.5 * RAY = 5e26).
usageRate is 10% (0.1 * RAY = 1e26).
computed liquidity rate is 5e28 instead of the expected 5e25 (i.e., 5%).
The incorrect calculation occurs due to the missing division by RAY when computing grossLiquidityRate:
Since both utilizationRate and usageRate are in RAY precision, their product is in RAY^2 precision. The missing division by RAY inflates the result incorrectly.
Modify the calculation of grossLiquidityRate to normalize the result by dividing by RAY:
This ensures that the liquidity rate remains within expected bounds.
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.