The RAACMinter::calculateNewEmissionRate calculates the new emission rate based on the system utilization and benchmark rate to determine RAACToken emission rates. However, the current implementation in the RAACMinter::getUtilizationRate function incorrectly uses the normalized debt index (usageIndex) instead of actual borrowed amounts for calculating the total borrowed in the LendingPool, leading to severely inflated utilization calculations.
RAACMinter.sol:
LendingPool.sol:
The LendingPool::getNormalizedDebt returns reserve.usageIndex which is a cumulative interest rate index that starts at 1.0 (RAY = 1e27) and grows over time instead of using the reserve.totalUsage, which represents the actual total borrowed amount. This leads the system to always think utilization is above target and consistently increase emission rate (emissionRate + adjustment) reaching the maxEmissionRate quickly and stay there. Resulting in maximum RAACToken emissions regardless of actual utilization. The system fails to properly incentivize borrowing/lending based on actual usage.
Considering this scenario:
usageIndex = 1.0 RAY (1e27)
totalDeposits = 1000e18
utilizationTarget = 80%
Current calculation:
utilizationRate = 1e27 * 100 / 1000e18
= 1e11% (astronomical number)
The utilizationRate is always greater then utilizationTarget (80%). This always triggers maximum emissions ignoring actual borrowed amounts.
Manual review
Implement a function in the LendingPool.sol that calculates the total borrowed.
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.