Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Valid

Optimal Rate Is Not Used

Summary

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.

Vulnerability Details

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.

Example Scenario

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.

Impact

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.

Tools Used

Manual Review

Recommendations

To mitigate this vulnerability, update the calculateBorrowRate function to incorporate the optimalRate parameter in its calculations.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

ReserveLibrary::calculateBorrowRate uses primeRate instead of optimalRate in first slope calculation, causing borrowers to pay double the intended interest at optimal utilization

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

ReserveLibrary::calculateBorrowRate uses primeRate instead of optimalRate in first slope calculation, causing borrowers to pay double the intended interest at optimal utilization

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!