In the ReserveLibrary.sol contract the calculateBorrowRate function does not use the optimalRate parameter in its calculations, which can lead to suboptimal interest rate calculations.
The vulnerability arises from the calculateBorrowRate function, which is responsible for calculating the borrow rate based on various parameters, including the prime rate, base rate, optimal rate, max rate, optimal utilization rate, and current utilization rate. However, the function does not use the optimalRate parameter in its calculations, which can lead to suboptimal interest rate calculations that do not accurately reflect the desired interest rate curve.
Consider the following scenario:
primeRate = 5%
baseRate = 2%
optimalRate = 4%
maxRate = 10%
optimalUtilizationRate = 80%
utilizationRate = 70%
In this scenario, the optimalRate should influence the borrow rate calculation, especially when the utilization rate is close to the optimal utilization rate. However, the current implementation does not use the optimalRate, leading to a borrow rate that may not align with the intended interest rate curve.
The real impact of this vulnerability is that the borrow rate calculations may not be optimal, leading to interest rates that do not accurately reflect the desired interest rate curve. This can result in either higher or lower borrow rates than intended, affecting the protocol's competitiveness and attractiveness to borrowers and lenders. Over time, this can impact the protocol's overall financial health and user satisfaction.
Manual Review
To mitigate this vulnerability, update the calculateBorrowRate function to incorporate the optimalRate parameter in its calculations.
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.