Minting of rewards of RAACToken
on StabilityPool
is unfair and can be gamed.
The protocol will be deployed on blockchains with public mempools. Like mainnet. Thus MEV is a concern.
StabilityPool::withdraw()
can be sandwiched to steal rewards from users. Specially if the attacker is a user with high RToken
token holdings.
The attack goes like this:
Same block:
Attacker: StabilityPool::deposit()
. Front-runs. Total supply is inflated due to the minting here.
Victinm: StabilityPool::withdraw()
. Proportionally now it has less part of the deposits, this happens here. The denominator comes from total supply and now it is bigger. This return value is what is eventually transferred here.
Attacker: StabilityPool::withdraw()
. Back-runs. Now the attacker which didn't care at all about holding DEToken
withdraws and gets part of the rewards that the victim should have gotten.
This artificially inflates the value of deToken.totalSupply()
which is used to calculate the rewards to send to the victim on withdrawals.
As this value is dividing on calculateRaacRewards()
, if the attacker has enough funds, it could even make the division round down to 0.
Furthermore, this system is not only vulnerable to MEV but it is also unfair as people who held DEToken for 1 second will get the same rewards as people who held it for 1 year. This generates no incentive to dpeosit your RToken
to get DEToken
and just do it in 1 block, the one where RAACToken
rewards are minted and distributed.
Stability pool withdrawals can be sandwiched. Note that the attacker does earn profit, as part of the RAAC token amount that the victim does not receive can be claimed by him on his following withdrawal.
The system RAAC rewards distribution in the stability pool is really unfair, deeming the DEToken
quite useless.
All these issues share the same root cause: the rewards minted do not care about how long you have been holding the token.
Introduce reward minting per epochs or enforce a minimum deposit time before you can withdraw. Making the system more fair or at least not MEV exploitable.
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.