The calculateRaacRewards() function in the StabilityPool contract currently uses deToken.totalSupply() to determine the total deposits for calculating user rewards. This approach does not accurately reflect the actual rToken deposits made by users, leading to potential inaccuracies in reward distribution.
When users invoke deposit() function, they specify the amount of rToken they wish to supply. This amount is then incremented to their userDeposits mapping and deTokens minted to them.
However, when calculating rewards, the calculateRaacRewards() function does the following:
The function retrieves total deposits using uint256 totalDeposits = deToken.totalSupply().
This method does not account for the actual rToken deposited by users, as deToken is a derivative token.
As a result, users may receive rewards that do not correspond to their actual contributions, leading to incorrect distribution.
The reward calculation is based on the total supply of deToken, rather than their actual rToken deposits. This misalignment undermines the intended reward distribution mechanism.
Manual Review
Update the reward calculation to use the actual balance of rToken held by the contract:
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.