MEV stands for maximal extractable value. It is the profit that block builders and bots can earn by choosing which transactions to include and in what order. Some forms are harmless, such as arbitrage that keeps prices consistent. Others take directly from you.
How a sandwich works
- You submit a swap. It waits publicly in the pending pool before being included.
- A bot sees it and buys the same token first, pushing the price up.
- Your swap executes at the worse price, pushing it up further.
- The bot sells immediately after, keeping the difference. You received fewer tokens than you should have.
The attack works best when your slippage allowance is generous, because it gives the bot room to move the price before your trade reverts.
What helps
- Use a tighter slippage setting on liquid tokens.
- Trade in smaller pieces on thin pools, where the price moves more.
- Send the transaction through a protected route. Some wallets and aggregators can submit privately so bots never see it in the open.
- Prefer deeper pools, where there is less price to extract.