Curriculum·J302 Swap Execution: AMMs, MEV, and DEX Architectures·about 33 min
The four architectures
By the end of this lesson you can
- →Classify any venue by where price is formed and where matching happens
- →State what each architecture does well and the specific way each one fails
- →Identify which component of a venue is on-chain and which is somebody's server
- →Select an architecture from the property you need rather than from familiarity
Junior · enrolled learners
This lesson opens with Four architectures, four failure shapes.
- What happened
- This is a pattern drawn from the verified incidents in this course and this level rather than a single event, and it is labeled as such. An automated market maker failed when its accounting assumed a transfer moved the stated amount and a token class existed for which that was false, draining two pools of about $450,000. An on-chain order book was rendered unusable not by a defect but because one company held its upgrade authority and collapsed. An aggregator lost about $11.6M from 153 wallets that had granted it unlimited approvals, when a newly added component allowed arbitrary calls. An intent settlement system lost about $166,000 when a permissioned solver introduced a contract with an arbitrary call path, while user funds were untouched because they never sat in the contract that was drained.
- The decision point
- Each architecture failed at the component that is distinctive to it. The market maker failed at its pricing assumption, the order book at its upgrade key, the aggregator at the approval it requires to function, and the intent system at the party it delegates execution to. None of them failed in a way the others were exposed to, which means choosing a venue is choosing which failure surface you accept rather than choosing a level of safety.
What you will be able to answer
- →What are the four architectures?
- →What is the classifying question?
- →Where does each one fail?
- →What does choosing a venue actually choose?
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
- https://www.theblock.co/post/190566/ftx-backed-dex-serum-calls-itself-defunct-promotes-community-fork
- https://medium.com/balancer-protocol/incident-with-non-standard-erc20-deflationary-tokens-95a0f6d46dea
- https://www.theblock.co/news/defi/2020-06-29-balancer-pools-drained-of-more-than-450000-due-to-an-exploit-connected-to-deflationary-tokens-69785
- https://medium.com/1inch-network/balancer-hack-2020-a8f7131c980e
- https://li.fi/knowledge-hub/incident-report-16th-july
- https://blog.cow.fi/cow-swap-solver-exploit-post-mortem-07-02-2023-2faa9f918e29
Confidence high·Volatility medium·Reviewed 2026-08-06·Owner unassigned
Contested
Lessons 1 to 5 of this course own the mechanics of a single swap, being constant product pricing, price impact and slippage, the transaction lifecycle, MEV and execution discipline. Lessons 6 to 12 own venue selection. The split resolves a conflict between two versions of the curriculum map and is stated in both halves so it cannot be reopened silently.
The four incidents are the Balancer STA and STONK pools (28 June 2020 UTC: two pools drained of about $450,000, per The Block's count of 601.3 ETH, 11.36 WBTC, 22,593 LINK and 60,915 SNX, about $452,000, and Balancer's own post-mortem, which gives no dollar figure but confirms the mechanism, gulp() syncing the pool's recorded STA balance down to near zero so STA priced as extremely scarce; 1inch's analysis put it at more than $500,000), Serum (November 2022, declared defunct because FTX held its upgrade authority, per The Block), LI.FI (16 July 2024, about $11.6M from 153 wallets with infinite approvals, per LI.FI's own incident report) and CoW Swap's Barter solver (7 February 2023, about $166,000 from the settlement contract's buffers with user funds never at risk, per CoW's post-mortem). The claim that each failed at the component distinctive to its architecture is this lesson's reading of those four records.
The four-way taxonomy is a simplification and real venues combine elements, with hybrid designs holding an order book off-chain and settling on-chain, or routing through pools while accepting intents. The classifying question in this lesson resolves hybrids correctly because it asks about components rather than labels.
