What is MEV (maximal extractable value)?

The profit available from choosing which transactions go into a block and in what order.

Not yet verifiedHow we verify

3 min read

In this entry

The profit available from choosing which transactions go into a block and in what order.

MEV covers front running and sandwiching trades on a dex, and it is one reason a swap can fill at a worse price than the one quoted. The term was originally coined as miner extractable value and renamed when proof-of-stake replaced mining on Ethereum, since the party doing the extracting changed.

The misconception is that MEV is a bug someone will fix. Ordering has value on any blockchain where transactions are public before they are final, which is nearly all of them. What changes between chains and over time is who captures the value and whether ordinary users are the ones paying it.

How it works

Pending transactions sit in a public mempool where anyone can read them. A searcher runs software that scans for opportunities and submits its own transactions positioned around them, paying a high priority fee to secure placement.

Three kinds account for most of it.

Arbitrage. The same asset trades at different prices on two decentralized exchanges. A searcher buys on one and sells on the other in a single atomic transaction. This is competition doing its job and costs ordinary users nothing.

Liquidation. A lending position falls below its collateral threshold and the protocol pays a bonus to whoever closes it. Searchers race to be first. This keeps lending markets solvent.

Sandwiching. A searcher sees a large pending swap, buys ahead of it to push the price up, lets the victim's swap execute at the worse price, and sells immediately after. This is a direct transfer from the user to the searcher, and it is the kind worth defending against.

On Ethereum the revenue flows through builders and relays to validators. Chains with private mempools, encrypted ordering, or batch auctions reduce some of it structurally, at the cost of other trade-offs.

Example

Illustrative sandwich. You submit a swap of $20,000 into a pool, with slippage tolerance set to 3%. A searcher sees it pending, buys ahead of you and moves the pool price up by 2.5%, still inside your tolerance.

Your swap executes at that worse price, costing you about $500 against the quote you saw. The searcher then sells into the price your own trade created, capturing most of that $500 minus fees. Had your slippage tolerance been 0.5%, the profitable sandwich would have been much smaller, and your transaction would have reverted instead of filling badly if the searcher pushed too far.

Why it matters when you buy

MEV is a decentralized exchange problem, so buying on a centralized venue avoids it entirely. If you do swap on chain, the two defenses that matter are a tight slippage tolerance and a private transaction route that keeps your order out of the public mempool. Comparing the all-in cost of both routes against the measured spreads on the liquidity pages is often the deciding factor, and our comparison at CEX vs DEX covers the wider trade-offs.

Questions

Does MEV affect me if I only buy on a centralized exchange?

No. Your order never enters a public mempool, so there is nothing for a searcher to see. Exchange order books have their own fairness questions, but this is not one of them.

Is all MEV harmful?

No. Arbitrage keeps prices aligned across venues and liquidations keep lending protocols solvent. Sandwiching is the extractive kind, and it is a minority of the total by value.

How do I protect a swap?

Set a tight slippage tolerance, split very large swaps, and use a wallet or router that submits transactions privately rather than broadcasting them to the public mempool.

Guides that use this term

  • Centralized vs Decentralized Exchanges: Which Should You Use

    A centralized exchange holds your coins and your identity documents but lets you buy with a bank transfer or card, while a decentralized exchange requires no account and never takes custody but can only swap crypto you already own, so most people start on the first and use the second for assets it does not list.