The StabilityPool contract's reward distribution mechanism has a critical flaw in its exchange rate calculations. When managers receive RAAC rewards, the distribution doesn't properly account for their proportional allocations, leading to incorrect reward distributions.
The TODO comment is the exact location where the exchange rate integrity issue needs to be addressed. This is where the proportional distribution logic should be implemented to maintain correct reward allocation among managers.
When the StabilityPool receives RAAC tokens from the lending pool, it's like a bank receiving deposits that need to be fairly distributed to account holders. However, there's a critical flaw in how these rewards are calculated and distributed.
Imagine a manager with a 30% allocation in the pool. When 1000 RAAC tokens arrive, they should receive 300 tokens. However, the current implementation in depositRAACFromPool()
fails to maintain this proportion. The exchange rate which should reflect the true value of each manager's share becomes desynchronized from reality.
The core issue lies in the StabilityPool's reward distribution logic, this is like a bank accepting deposits without updating account balances. The exchangeRate
variable, which tracks the relationship between deposits and shares, remains stale while new rewards flow in.
When 1000 RAAC tokens enter the pool:
Manager A (30% allocation) receives 400 tokens instead of 300
Manager B (70% allocation) receives 600 tokens instead of 700
The exchange rate shows incorrect share values
This creates a domino effect where each subsequent distribution compounds the error, eventually leading to significant misallocation of protocol rewards.
Maintain exchange rate integrity while ensuring proportional reward distribution. Add proper reward distribution logic for example.
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.