MEV & Transaction Ordering
On a blockchain, the person who decides the order of transactions can quietly rob the people in them. That power has a price, an auction, and a multi-billion-dollar supply chain. Take it apart.
Why the order of transactions inside a block is worth money — and who fights to control it. Maximal Extractable Value (MEV) from the mempool up: how ordering is auctioned, front-running and back-running, sandwich attacks on AMMs, arbitrage and liquidation MEV, and how Proposer-Builder Separation (PBS), MEV-Boost and private orderflow try to tame it.
Every transaction you send sits for a few seconds in plain sight, in a mempool anyone can read, and whoever builds the next block decides not just which pending transactions go in but in what order. On a chain where a swap’s outcome depends on what came right before it, that ordering power isn’t a clerical detail — it’s money, with a name: Maximal Extractable Value (MEV), the dark matter of DeFi that’s invisible in the UI but enormous in aggregate.
This course builds the whole machine from the mempool up:
- What MEV is — why the right to order transactions has value at all, and why “just send the transaction” hides a billion-dollar war over sequencing.
- Mempool & ordering mechanism — how transactions are picked, and how priority fees turned ordering into a live auction.
- Front-running & back-running — getting in just ahead of or just behind a victim.
- The sandwich attack — the signature DeFi predator, worked out with exact constant-product math so you can compute the victim’s loss and the attacker’s profit yourself.
- Arbitrage & liquidations — the benign, load-bearing side of MEV that keeps prices aligned and lending markets solvent.
- Countermeasures — Proposer-Builder Separation, MEV-Boost, relays, private orderflow, fair ordering and encrypted mempools.
This sits at the top of the crypto ladder, assuming you already know how Ethereum orders and prices transactions and how an AMM walks a curve. By the end, “I made a swap” stops being a single click and becomes a transparent, adversarial pipeline you can reason about, price, and defend against.
In this topic
- 1 What MEV Is Maximal Extractable Value is the profit a block producer can capture purely by choosing which transactions to include, exclude, and reorder — the hidden tax of public blockchains. 9 min
- 2 The Mempool & How Ordering Is Auctioned Pending transactions wait in a public mempool, and block builders order them to maximize revenue. How priority fees turned transaction ordering into a live, competitive auction — the priority gas auction. 9 min
- 3 Front-Running & Back-Running The two primitive ordering attacks: slipping a transaction in just before a victim to act on their pending move, or just after to capture the price change it causes. Displacement, insertion, and suppression attacks. 9 min
- 4 Sandwich Attacks The signature DeFi MEV attack: front-run a victim's swap to push the price against them, let them fill at the worse price, then back-run to bank the difference. The exact constant-product math of the victim's loss and the attacker's profit. 10 min
- 5 Arbitrage & Liquidation MEV The load-bearing side of MEV: DEX arbitrage that keeps prices aligned across pools and exchanges, and liquidation MEV that keeps lending protocols solvent. Why some extraction is a feature, not a bug — and where it shades back into harm. 9 min
- 6 PBS, MEV-Boost & Mitigations How Ethereum tries to tame MEV: Proposer-Builder Separation, MEV-Boost and relays, private orderflow, MEV-aware routers and protection RPCs, fair-ordering and encrypted mempools, and MEV redistribution (MEV-Share/SUAVE). 10 min
- 7 MEV & Transaction Ordering — Final Exam The graded final exam for MEV & Transaction Ordering: what MEV is, the mempool and ordering auctions, front-running and back-running, sandwich-attack math, arbitrage and liquidation MEV, and PBS / MEV-Boost / mitigations. 15 min
Mark course as finished
Done with every lesson? Lock it in — your progress is saved on this device.