StabilityPool's reward distribution mechanism has a potential vulnerability where rewards can decrease after minting new tokens. This violates the core invariant that user rewards should never decrease after new token minting. The issue stems from the interaction between RAACMinter's excess token tracking and StabilityPool's reward calculation.
The vulnerability arises in the interaction between:
StabilityPool's calculateRaacRewards() function which uses total deposits for distribution
RAACMinter's tick() function which mints new tokens and tracks excess
DEToken's total supply changes affecting reward calculations
This creates a scenario where users could lose rewards they were entitled to, violating the economic assumption that minting new tokens should only increase or maintain reward levels.
StabilityPool acts as a linchpin managing deposits and rewards distribution. However, I've identified insufficiency in how rewards are calculated during minting events.
RAACMinter.sol
StabilityPool.sol
When RAACMinter.tick() is called to mint new tokens, the StabilityPool recalculates rewards based on the current DEToken total supply. Notice how this creates a window where a user's rewards can actually decrease, despite new tokens being minted. This violates a core protocol invariant that rewards should never decrease from minting events.
The exact scenario:
RAACMinter.tick() mints new tokens
This increases totalRewards in StabilityPool
However, if totalDeposits changes (via DEToken supply), the reward calculation ratio can decrease
This creates a scenario where rewards can decrease despite new tokens being minted
This interaction between RAACMinter's emission mechanism and StabilityPool's reward calculation creates the core vulnerability in the protocol's reward distribution system.
This means users could lose entitled rewards during high deposit volatility periods. The root cause lies in how reward calculation interacts with supply changes during minting events.
When RAACMinter.tick() executes a minting event, it updates the total token supply. The StabilityPool then recalculates rewards using this new total supply value. This means that a user who had 100 RAAC in rewards before minting might end up with only 90 RAAC after, effectively losing value during what should be a positive event for the protocol.
This vulnerability directly impacts the protocol's core value proposition of providing stable, predictable yields for real estate-backed assets.
Implement proper reward checkpointing or moving to a cumulative rate model, ensuring rewards maintain their expected growth properties during minting events.
In StabilityPool.sol
In RAACMinter.sol
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.