Understanding Slippage
Last updated
Last updated
Setting a low slippage tolerance is the simplest defense against toxic-MEV. Since searchers exploit slippage for price manipulation, transactions with lower slippage tolerance could provide less opportunity for toxic-MEV exploitation from trades.
Additionally, slippage modeling generally incorporates statistics into a smart order routing algorithm to deliver the optimal trade route.
Nevertheless, these solutions are incomplete. Even with optimal slippage, MEV bots may still derive value from your trades.
In Solana's Token Swap Program, a generic swap involves the input amount_in
, which represents the amount of token the user wants to trade, and minimum_amount_out
, which denotes the minimum amount of output tokens necessary to avoid excessive slippage:
The minimum amount of output tokens is connected to the actual number of output tokens by the slippage, ensuring that:
The slippage can be derived as follows: