MEV: Trading Without Getting Sandwiched
Every trade you send to a public blockchain is visible before it confirms — and there is an industry built around exploiting exactly that. MEV (maximal extractable value) is profit taken by reordering transactions or inserting new ones around yours, and you pay for it invisibly through worse execution prices. This guide explains how sandwich attacks work and how to make your swaps a hard target.
What MEV Actually Is
When you submit a swap, it does not go straight into a block. It first sits in the mempool — a public waiting room where every pending transaction is visible to anyone. Specialised bots called searchers scan this stream in real time, and block builders assemble transactions into blocks in whatever order pays them most. MEV — maximal extractable value — is the profit available from choosing that order strategically.
The attack that hits swappers directly is the sandwich. A searcher spots your pending buy of a token, places its own buy just before yours (pushing the price up), lets your swap execute at the worse price, then sells right after you (pushing the price back down). You bought high; the bot pocketed the difference. Crucially, your slippage tolerance is the attacker's profit ceiling: the bot moves the price exactly as far as your settings allow, and your swap still counts as "successful".
Front-running (jumping ahead of your transaction) and back-running (trading immediately after it) are the building blocks; a sandwich is both at once. None of this requires hacking anything — it is ordinary use of a transparent system, which is exactly why it cannot simply be patched away.
How Much It Costs You
MEV is an invisible tax. Your transaction confirms, you receive tokens, nothing looks broken — you simply got a worse price than you should have. Cumulative sandwich extraction on Ethereum runs into hundreds of millions of dollars, taken a few dollars at a time from ordinary swaps.
Three factors decide your exposure: trade size (big trades in shallow pools move the price most and are the juiciest targets), your slippage setting (10 % slippage hands a bot a 10 % budget), and where your transaction goes (a default public RPC broadcasts your intent to every bot on the network). A small swap of a major pair with tight slippage is rarely worth attacking; a large swap of a thin token at 5 % slippage through a public RPC is close to a guaranteed sandwich.
Four Defences That Actually Work
You do not need to understand builder markets to protect yourself. Four habits remove almost all of your exposure.
Tight slippage
Set 0.1–0.5 % for majors and stablecoins — per trade, by hand. And never crank slippage to 10 % after a failed transaction just to force it through: a high-slippage retry on a public mempool is a written invitation for a sandwich bot.
Private RPCs
Flashbots Protect sends your transactions directly to block builders, skipping the public mempool entirely — bots never see them. MEV Blocker works on the same principle. Adding one takes a minute: in your wallet's network settings, change Ethereum's RPC URL to protect.flashbots.net — everything else stays the same.
Batch auctions & intents
CoW Swap settles trades in batch auctions where everyone in a batch gets the same clearing price — there is no ordering to sandwich. UniswapX and other intent systems have solvers compete to fill your signed order off the public mempool. By 2026 this is the default answer, and ERC-7683 has standardised intents across chains.
Split large trades
A big trade in a shallow pool is maximum extraction: huge price impact plus a wide slippage setting. Break it into smaller pieces, use an aggregator that splits routes for you, or trade the pair on its deepest venue.
Check Your Own Setup: Four Steps
Ten minutes of housekeeping covers most of this permanently.
Check what RPC you use today
Open your wallet's network settings and look at the RPC URL for Ethereum. If it is the wallet's default public endpoint, every swap you have ever sent was broadcast to the open mempool.
Switch swaps to an aggregator or intent frontend
Make CoW Swap, UniswapX or a protected aggregator your default trading venue instead of a bare DEX. Protection is built into how they settle — you do not have to think about it per trade.
Verify a past trade on-chain
Pick an old swap on Etherscan and compare the execution price with a chart for that same minute. Then look at the transactions directly before and after yours in the same block: the same address buying just before you and selling just after is the signature of a sandwich.
Set per-trade slippage manually
Turn off "auto" and set slippage yourself every time: 0.1–0.5 % for liquid pairs. If a trade will not go through at tight slippage, that is information — the pool is too shallow or too volatile — not a prompt to raise the number.
The Bigger Picture
MEV will not disappear — as long as transaction ordering is worth money, someone will pay for it. What is changing is who captures it. Protocols increasingly internalise MEV instead of leaking it to bots: private orderflow deals route transactions straight to builders, batch auctions neutralise ordering within a batch, and intent systems make solvers compete the extraction away and hand it back to you as better prices.
For a user, the practical takeaway is simple: the public mempool is a hostile place to announce a trade, and by 2026 you rarely need to. If you build on-chain yourself, our developer article covers the builder side of MEV protection — order flow auctions, private bundles, and contract design that resists extraction.