MEV & The Dark Forest
Understand how block builders extract value from retail traders via front-running and sandwich attacks.
Sandwich Attacks
When you submit a swap on a DEX with high slippage, your transaction sits in the public mempool.
Searchers can scan a public mempool and attempt a sandwich: buy before a vulnerable swap, let it execute at a worse price within its tolerance, then sell afterward. The attempt is not risk-free; competition, reordering, failed inclusion, fees, price movement, and private order flow can make it fail or lose money.
Protection is a routing and transaction-design problem. Tight tolerances can cause failed swaps in volatile or thin pools; private submission changes who can observe the order but introduces builder or relay assumptions; intents and batch auctions have their own trust and execution models. Compare expected price, minimum received, gas, route, and failure behavior before signing.
How do you protect yourself from a sandwich attack?
Sources, data & review
Reviewed 2026-07-17 · periodic material
- Maximal extractable value (MEV) — ethereum.org (accessed 2026-07-17)