Core Contracts

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

Instant Reward Capture Through Same-Transaction Deposit and Withdrawal in StabilityPool

Summary :

The StabilityPool allows users to deposit and withdraw in the same transaction, capturing a full share of accumulated RAAC rewards without meaningful participation in the protocol. This enables malicious users to extract value from the reward system without contributing to protocol stability.

Vulnerability Details :

The StabilityPool's reward distribution relies on accumulated RAAC tokens in the pool rather than time-weighted positions. So When a large deposit enters the pool, it immediately becomes eligible for all accumulated rewards proportional to its share of total deposits. With no minimum deposit duration, a malicious whale user can capture these rewards through deposit-withdraw transaction.

function deposit(uint256 amount) external {
_update(); // First tick
rToken.safeTransferFrom(msg.sender, address(this), amount);
deToken.mint(msg.sender, deCRVUSDAmount);
userDeposits[msg.sender] += amount;
_mintRAACRewards(); // Second tick
}
function withdraw(uint256 deCRVUSDAmount) external {
_update(); // Third tick
uint256 raacRewards = calculateRaacRewards(msg.sender);
// Withdrawal logic
}

A whale can deposit 1e6 tokens and immediately withdraw, capturing three reward ticks worth of RAAC tokens in a single transaction.

Tick 1: _update() in deposit
Tick 2: _mintRAACRewards() in deposit
Tick 3: _update() in withdraw

The reward calculation is based solely on current deposit share, allowing instant reward capture.

Impact :

A whale can deposit 1e6 tokens and immediately withdraw, capturing reward ticks worth of RAAC tokens in a single transaction. This creates a profitable exploit that drains reward tokens from the protocol without contributing.

Tools Used :

Manuel review.

Recommendations :

  1. Implement time-weighted reward distribution.

  2. Add minimum deposit duration requirement.

Updates

Lead Judging Commences

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

StabilityPool::calculateRaacRewards is vulnerable to just in time deposits

Support

FAQs

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