Curriculum·J302 Swap Execution: AMMs, MEV, and DEX Architectures·about 33 min

MEV

By the end of this lesson you can

  • Name the parties in the ordering supply chain and what each one is trusted with
  • Distinguish the extractive forms of MEV from the ones the system depends on
  • Compute the swap size at which you become worth sandwiching, given a tolerance
  • Evaluate private routing as a substitution of counterparty risk rather than a removal

Junior · enrolled learners

This lesson opens with The mev-boost relay exploit, 3 April 2023.

What happened
Under proposer builder separation, a relay holds a block's contents and releases them to the proposer only once the proposer has irrevocably signed a commitment to that block. On 3 April 2023 a proposer exploited a vulnerability in the open source mev-boost-relay implementation maintained by Flashbots. They submitted a signed but deliberately invalid block, with the parent root and state root set to zero, to the ultra sound relay. The relay replied with the transactions that should have been included. Because the block was invalid it was never propagated, but the proposer now knew the intended contents and could reorder them, reversing sandwich bundles against the searchers who had built them. Flashbots reported roughly $20M taken. The exploiter later disclosed to Justin Drake and samczsun, asking to be called low-carb-crusader. The United States Department of Justice subsequently charged two brothers, alleging $25M taken within twelve seconds, and a federal judge declined to dismiss the case.
The decision point
The parties robbed were the sandwich bots, which is the detail that makes this instructive rather than merely ironic. Every participant in that supply chain, including the searchers who extract from ordinary users, was relying on one assumption: that the relay would not reveal a block's contents to a proposer who had not committed to publishing it. That assumption was load-bearing, undocumented as a risk, and false. Anybody routing transactions privately to avoid the public mempool is relying on the same class of assumption.
Recorded loss
$20,000,000

What you will be able to answer

  • What is MEV?
  • Where does extracted value actually go?
  • At what size do you become worth sandwiching?
  • Which forms of MEV does the system depend on?

Orientation and Year One are open: anyone can read them without an account. From Year Two onward the lessons are for enrolled learners, because progress through the later years only means anything if it is tracked against a record.

It is free. We do not sell the list and there is nothing to buy at the end of it.

Sources and review

Confidence high·Volatility high·Reviewed 2026-08-06·Owner unassigned

Contested

Loss figures differ by source, with Flashbots reporting roughly $20M and the DOJ indictment alleging $25M. The mechanism is not in dispute and the charges have not been resolved at the time of writing, so this lesson describes what was alleged and what was disclosed rather than asserting guilt.

Lessons 9 and 10 of this course own aggregators, routing and intents as venue architecture. This lesson covers only what private routing does to your mempool exposure and what it substitutes. Keep the split.

Whether sandwiching should be characterised as theft or as a permissionless market activity is genuinely contested and this lesson does not settle it. What is not contested is the arithmetic of when it happens to you, which is what a reader can act on.