ChorusOne / solido

Lido for Solana is a Lido-DAO governed liquid staking protocol for the Solana blockchain.
https://chorusone.github.io/solido/
GNU General Public License v3.0
101 stars 43 forks source link

Allow `SellRewards` just before `FetchPoolPrice` #551

Closed ruuda closed 2 years ago

ruuda commented 2 years ago

As pointed out by Neodyme, a malicious cranker could spam FetchPoolPrice transactions, and although eventually the SellRewards should win if there is some probability for either transaction to win the race, this could delay selling for the rewards for some time. To mitigate that, give SellRewards a head start of one slot, so if there are two crankers that are spamming FetchPoolPrice and SellRewards, the SellRewards would win.

ruuda commented 2 years ago

(fmt CI failure is due to an unrelated issue for which we have a pending fix)