The RAACMinter contract implements a dynamic emission rate mechanism that adjusts based on the system's utilization rate. The utilization rate is meant to represent the ratio of borrowed assets to total deposits, expressed as a percentage between 0 and 100.
The getUtilizationRate() function in RAACMinter incorrectly uses the usage index from LendingPool.getNormalizedDebt() instead of the actual total borrowed amount when calculating the utilization rate. The usage index is a RAY-scaled (27 decimals) accumulator used for interest calculations, not the actual amount of debt in the system.
The current implementation:
This leads to an incorrect utilization rate calculation because it's comparing incompatible units: a RAY-scaled index against WAD-scaled deposits.
High. The incorrect utilization rate directly affects the emission rate calculations in calculateNewEmissionRate(), which determines the amount of RAAC tokens minted. This could result in either excessive or insufficient token emissions, potentially destabilizing the protocol's tokenomics.
High. This issue will affect every emission rate calculation, as it's a fundamental error in the utilization rate computation that occurs under normal operation.
Assume the usage index is 1.5e27 (RAY)
Total deposits are 1000e18 (WAD)
Current calculation: (1.5e27 * 100) / 1000e18 = 150,000%
This produces an impossibly high utilization rate, causing the emission rate to consistently hit the maximum
Modify the getUtilizationRate() function to use the debt token's total supply instead of the usage index:
This solution uses the debt token's total supply, which accurately tracks the total outstanding debt in the system in WAD (18 decimals), making it compatible with the deposits amount for calculating the utilization percentage.
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.