StabilityPool's deposit function fails to maintain proper balance synchronization between DEToken minting and actual deposits. When users deposit rTokens, the minted DEToken amount can deviate from the expected 1:1 ratio, potentially leading to incorrect reward distributions and system imbalances.
The issue emerges in the StabilityPool's deposit function. While it correctly handles the rToken transfer and DEToken minting, the calculateDeCRVUSDAmount function uses a complex exchange rate calculation that can lead to precision loss: StabilityPool.sol/#calculateDeCRVUSDAmount
The exchange rate calculation introduces potential rounding errors, especially when dealing with different decimal places between rToken and DEToken.
Impact - This precision loss could accumulate over multiple deposits, creating a growing discrepancy between the total supply of DEToken and the actual rToken deposits in the StabilityPool. This affects:
Reward calculations that depend on user deposit shares
Withdrawal amounts when users redeem their DETokens
Overall system accounting accuracy
The issue emerges in the interaction between StabilityPool and DEToken minting. Notice how the protocol aims to maintain a delicate balance between real estate assets and DeFi liquidity through its stability mechanism.
The Stability Pool serves as the cornerstone of RAAC's risk management, where users deposit rTokens and receive DETokens. These DETokens represent their share in the stability mechanism and their right to earn RAAC rewards through the RAACMinter.
The StabilityPool's deposit function reveals a critical flaw in the balance synchronization: StabilityPool.sol/#deposit
The mistake is in the calculateDETokenAmount function. This calculation determines how many DETokens users receive for their rToken deposits, but it fails to maintain the crucial 1:1 backing ratio that the protocol depends on.
This means that over time, the total DEToken supply could deviate from the actual rToken reserves in the StabilityPool. For a protocol designed to bring real estate stability on-chain, this misalignment poses a significant risk to the entire system's integrity.
The impact ripples through the dual-gauge system, where both RWA and RAAC gauges rely on accurate stability pool accounting for proper reward distribution. A skewed DEToken:rToken ratio would directly affect:
The protocol's ability to maintain stable real estate asset backing
The accuracy of gauge-weighted rewards
The effectiveness of the ve-token governance mechanism
RAAC brings real estate on-chain through an innovative system of interconnected contracts. The StabilityPool which acts like a secure vault where users deposit rTokens (representing real estate value) and receive DETokens in return. Think of it as converting your property deed into a more liquid, DeFi-compatible form.
Notice how the stability mechanism connects three key components, the StabilityPool managing deposits, DEToken tracking user shares, and RAACMinter distributing rewards. The core mistake emerges in how these components interact during the deposit process.
When users deposit rTokens, the protocol calculates their DEToken allocation using an exchange rate mechanism. This calculation determines how much of the protocol's real estate backing each user controls.
This means that over time, the total DEToken supply could deviate from the actual rToken reserves. For a protocol designed to tokenize real estate, this misalignment threatens the fundamental premise of stable, asset-backed tokens.
The impact ripples through RAAC's dual-gauge system. The RWA gauge, responsible for real estate yield direction, and the RAAC gauge, managing protocol emissions, both rely on accurate stability pool accounting. A skewed DEToken:rToken ratio directly affects governance voting power and reward distributions.
By implementing precise mathematical operations and adding exchange rate invariant checks, we can ensure RAAC maintains its promise of bringing real estate stability on-chain while preserving the integrity of its governance mechanism.
StabilityPool Contract Flow
Current Vulnerable Calculation
Proposed Fix Using WadRayMath
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.