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

Arbitrage our own `try_sell_anker_rewards` call #539

Closed enriquefynn closed 2 years ago

enriquefynn commented 2 years ago

The maintainer tries to sell Anker rewards with try_sell_anker_rewards. It might happen that the pool does not have enough liquidity to sell all rewards or that (more likely) the price in UST will be so off that our program does not allow the sell to go through.

In these cases, we could try to provide liquidity enough so we can profit from arbitraging our own maintainer.

ruuda commented 2 years ago

the price in UST will be so off that our program does not allow the sell to go through

In this case, we can simply trigger a new FetchPoolPrice. But we also shouldn’t be too pessimistic about it, because the transaction can execute against a different state than we observe, and even preflight in the RPC doesn’t execute against the right state. I guess if it often fails, it just means that the admin should relax the min_out_bps a bit.

enriquefynn commented 2 years ago

hum... That's right, but we can't change this right now, should we add this command for the admin?

ruuda commented 2 years ago

Ah yes, we need to add an instruction for the admin to be able to change it, just like ChangeTerraRewardsDestination. Because I don’t think we can predict ahead of time what value we are going to need.

enriquefynn commented 2 years ago

Added it here #542

enriquefynn commented 2 years ago

I'll close this for now, we can investigate it if it turns out to be a problem