Core Contracts

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

Incorrect Utilization Rate Calculation in Minter

Summary

The getUtilizationRate function in the Minter contract incorrectly assumes that getNormalizedDebt() from the LendingPool returns the total borrowed amount. However, getNormalizedDebt() actually returns the usage index, not the actual borrowed amount. This leads to an incorrect calculation of the utilization rate, which in turn affects the emission rate calculation in calculateNewEmissionRate(), causing inaccurate emissions.


Vulnerability Details

The getUtilizationRate function uses lendingPool.getNormalizedDebt() to fetch the total borrowed amount, but this is incorrect because getNormalizedDebt() returns the usage index rather than the actual total borrowed funds.

Code Reference:

/**
* @dev Calculates the current system utilization rate
* @return The utilization rate as a percentage (0-100)
*/
function getUtilizationRate() internal view returns (uint256) {
// @audit it should use total borrowed not borrow index
uint256 totalBorrowed = lendingPool.getNormalizedDebt();
uint256 totalDeposits = stabilityPool.getTotalDeposits();
if (totalDeposits == 0) return 0;
return (totalBorrowed * 100) / totalDeposits;
}

The incorrect calculation of totalBorrowed results in a miscalculated utilization rate, which is used in calculateNewEmissionRate():

/**
* @dev Calculates the new emission rate based on the system utilization and benchmark rate
* @return The new emission rate in RAAC per block
*/
function calculateNewEmissionRate() internal view returns (uint256) {
uint256 utilizationRate = getUtilizationRate();
uint256 adjustment = (emissionRate * adjustmentFactor) / 100;
if (utilizationRate > utilizationTarget) {
uint256 increasedRate = emissionRate + adjustment;
uint256 maxRate = increasedRate > benchmarkRate ? increasedRate : benchmarkRate;
return maxRate < maxEmissionRate ? maxRate : maxEmissionRate;
} else if (utilizationRate < utilizationTarget) {
uint256 decreasedRate = emissionRate > adjustment ? emissionRate - adjustment : 0;
uint256 minRate = decreasedRate < benchmarkRate ? decreasedRate : benchmarkRate;
return minRate > minEmissionRate ? minRate : minEmissionRate;
}
return emissionRate;
}

Exploitation Scenario:

  1. The system assumes the total borrowed amount is derived from getNormalizedDebt(), but this value does not reflect the actual outstanding borrowed funds.

  2. The calculated utilization rate is incorrect, leading to an inaccurate emission rate adjustment.


Impact

  • Inaccurate Emission Rate: The incorrect utilization rate results in emissions being adjusted improperly, which can lead to excessive or insufficient rewards.

  • Economic Instability: If emissions are too high, token inflation could occur, reducing token value. If too low, incentives may not be sufficient for protocol participation.


Updates

Lead Judging Commences

inallhonesty Lead Judge 3 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 3 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.