Core Contracts

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

Incorrect Utilization Rate Calculation in getUtilizationRate() in RAACMinter

Summary

The getUtilizationRate function in RAACMinter.sol incorrectly calculates the utilization rate by dividing totalBorrowed (which represents accumulated debt interest) by totalDeposits (which represents the RToken balance of the Stability Pool). These two values are incompatible due to their differing meanings and decimal precisions. This results in meaningless utilization rate values.

Vulnerability Details

function getUtilizationRate() internal view returns (uint256) {
uint256 totalBorrowed = lendingPool.getNormalizedDebt();
uint256 totalDeposits = stabilityPool.getTotalDeposits();
if (totalDeposits == 0) return 0;
return (totalBorrowed * 100) / totalDeposits;
}

totalBorrowed is the usageIndex, representing the accumulated interest on 1 crvUSD since the pool’s inception, not the total borrowed amount.

function getNormalizedDebt() external view returns (uint256) {
return reserve.usageIndex;
}

totalDeposits represents the RToken balance in the Stability Pool, which has a different unit and scale.

function getTotalDeposits() external view returns (uint256) {
return rToken.balanceOf(address(this));
}

Dividing these values directly produces an arbitrary and incorrect result because they are not in the same unit or scale.

Utilization rate should not be calculated by unrelated metrics.

Impact

The calculated utilization rate will not reflect actual borrowing behavior, leading to incorrect emission rate calculations and reward distributions.

Tools Used

manual review

Recommendation

Replace the flawed calculation with a proper utilization rate formula, similar to the one used in ReserveLibrary.sol

Updates

Lead Judging Commences

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

RAACMinter::getUtilizationRate incorrectly mixes stability pool deposits with lending pool debt index instead of using proper lending pool metrics

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

RAACMinter::getUtilizationRate incorrectly mixes stability pool deposits with lending pool debt index instead of using proper lending pool metrics

Support

FAQs

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