You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Oracle updates can be frontrun by stakers to gain a profit #4
A staker can scan the mempool for upcoming oracle updates and frontrun them by withdrawing.
If the price moves in favor of his position he does nothing, if it moves against him he withdraws his earned fees.
This is possible because the stake and withdraw methods aren't queued and executed on the next oracle update, instead they're executed whenever the staker sends the appropriate transaction.
If the price moves in favor of his position he does nothing, if it moves against him he withdraws his earned fees.
That is not how staking works. You constantly earn FLT reward while you are staked (per second). On every full system price update the rate at which you earn fees changes, absolute worst case is the market moves 'against you' and you earn zero FLT rewards after that point, then withdrawing gains you nothing. (actually it costs you because there is an unstake fee).
Based on my understanding of the system the warden is partially correct in that a staker could look in the mempool and see that the next update was going to be favorable for FLT accruance on specific side of the market and enter prior the to update occurring. I don't see the same incentive on withdrawal because at worst after the next price update they may receive no FLT.
So the question is how much does an "attacker" really gain by this small window in which they entered with unfair knowledge of the future state of the system. Given that they would have to already have an open position on that side of the market (because otherwise it would have to be minted on the next update) and that also means that side of the market is going to be on the losing side of the next update (since the FLT accrual rate is getting better), there seems like very little advantage to be gained here.
Could a user theoretically mint both long and short and hold each until the right moment to stake them without unhedged price risk, yes. But they would be better off simply staking them now since it's a zero sum game.
Activity
tensors issue #4
JasoonS commentedon Aug 10, 2021
0 - non-critical
That is not how staking works. You constantly earn FLT reward while you are staked (per second). On every full system price update the rate at which you earn fees changes, absolute worst case is the market moves 'against you' and you earn zero FLT rewards after that point, then withdrawing gains you nothing. (actually it costs you because there is an unstake fee).
moose-code commentedon Aug 11, 2021
Agree with Jason. There is a misunderstanding of how the system functions.
Stentonian commentedon Aug 11, 2021
Also agree with @JasoonS.
The term "earned fees" here is confusing:
There are no fees earned by stakers. The fees are paid by the stakers to withdraw. I'm guessing @JasoonS you interpreted this as FLT.
0xean commentedon Aug 26, 2021
Based on my understanding of the system the warden is partially correct in that a staker could look in the mempool and see that the next update was going to be favorable for FLT accruance on specific side of the market and enter prior the to update occurring. I don't see the same incentive on withdrawal because at worst after the next price update they may receive no FLT.
So the question is how much does an "attacker" really gain by this small window in which they entered with unfair knowledge of the future state of the system. Given that they would have to already have an open position on that side of the market (because otherwise it would have to be minted on the next update) and that also means that side of the market is going to be on the losing side of the next update (since the FLT accrual rate is getting better), there seems like very little advantage to be gained here.
Could a user theoretically mint both long and short and hold each until the right moment to stake them without unhedged price risk, yes. But they would be better off simply staking them now since it's a zero sum game.
Based on this, downgrading to 0 - non critical.