Documenting potential risks and exploits.
Example:
- Malicious Lido operator wants to drain all the stSOL in the pool
- Sets Lido stake wtihdrawal fee to 99%
- Swap from any LST to stSOL to give ~100x the appropriate amount of stSOL
- Set Lido stake withdrawal fee back to 0%
- unstake the 100x stSOL from Lido
- SPL has a minimal one epoch delay and maximum 2x increase to withdrawal fees change, giving some leeway to observe and prepare for such behaviour.
- Admin must constantly monitor and vet stake pools and LSTs that are allowed into the pool.
Example:
- Epoch just passed, all other LSTs have ran their crank but Marinade hasn't
- I somehow know Marinade will run their crank on the next block
- Right before that I swap 100 jitoSOL -> 100 mSOL
- Marinade crank runs, increasing the SOL value of mSOL by 4bps, assuming 0 fees, I swap 100 mSOL -> 100.004 jitoSOL
- Pool has just lost 0.004 jitoSOL to me
- Swap fees must be enough to offset such potential losses
Example:
- Similar scenario as in Swap Time Arb
- Right before Marinade crank runs I add liquidity
- Marinade cranks runs, my LP tokens have increased in SOL value
- Remove liquidity. I've just made marinade's staking gains without waiting for stake warm-up
- LP withdrawal fees must be enough to offset such potential losses