MEV: the cost hidden inside your transaction
Maximal extractable value is the profit available from choosing the order of transactions in a block. For an ordinary user it shows up as a swap that filled worse than the quote — and most of it is avoidable.
Where the value comes from
Pending transactions are public before they are confirmed. Whoever builds the block decides their order, and ordering has economic value: a large swap about to move a pool's price is a profit opportunity for anyone who can trade immediately before and after it.
That pattern — buy ahead of the victim, sell straight after — is a sandwich, and the profit comes directly out of the price the user received.
The main forms
Arbitrage between venues is the benign majority and makes prices more consistent. Liquidation of undercollateralised loans is a necessary function that happens to be profitable. Sandwiching is the form that costs retail users money directly.
| Form | Who pays | Harmful to users? |
|---|---|---|
| Cross-venue arbitrage | Nobody directly | No |
| Liquidation | The borrower | By design |
| Sandwich attack | The swapper | Yes |
| Backrunning an oracle update | Protocol users | Sometimes |
What actually reduces it
Set slippage tolerance deliberately. A tolerance of several percent on a liquid pair is an open invitation: it defines exactly how much a sandwich can take. Tight tolerance causes failed transactions instead, which is usually the cheaper outcome.
Splitting a large swap into smaller pieces, using an aggregator that routes through private order flow, and avoiding thin pools all cut the extractable amount. None of it eliminates MEV — ordering value is structural — but the difference between a careless and a careful swap is measurable.
FAQ
Is MEV an attack?
Some of it is. Arbitrage and liquidation are ordinary market functions; sandwiching takes value directly from a user's fill and is the part worth defending against.
Does a private mempool fix it?
It hides the transaction from public searchers, which prevents most sandwiching, but it moves trust to the party operating that order flow.