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

On-chain order books and app-chains

By the end of this lesson you can

  • →Explain why an order book is expensive to run on a shared chain
  • →Compute the transaction cost of maintaining two-sided quotes on-chain
  • →Identify account contention as a throughput limit independent of chain capacity
  • →State what an app-chain buys and what it substitutes

Junior · enrolled learners

This lesson opens with The account that stopped a market, 14 September 2021.

What happened
During Grape Protocol's token launch on Raydium's AcceleRaytor platform, bots flooded Solana with transactions, and some validators were receiving over 300,000 a second. One of those bots structured its transactions to write-lock eighteen key accounts, among them the global SPL token program and the Serum decentralized exchange program. Because a transaction touching a write-locked account cannot execute in parallel with another touching the same account, this severely reduced the parallel execution the chain relies on, and the network was left processing transactions sequentially. Queues grew without limit, leaders failed to include the vote transactions consensus depends on, block producers proposed competing forks, and the chain was down for roughly seventeen hours until validators coordinated a restart from the last confirmed slot.
The decision point
The property that makes an on-chain order book auditable is that its state lives in accounts anybody can read. That same property makes it contendable, because an order book is a small number of accounts and anybody willing to spend transactions can hold them. So the venue's practical throughput is bounded by contention on its own state rather than by the chain's advertised capacity, and on a shared chain that contention is created by activity which has nothing to do with the venue.

What you will be able to answer

  • →Why is an on-chain order book expensive?
  • →What is account contention?
  • →What does an app-chain buy?
  • →What does an app-chain substitute?
  • →What is the hybrid design?

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 medium·Reviewed 2026-08-06·Owner unassigned

Contested

J301-02 uses the same halt to teach how to evaluate an alternative base layer, covering throughput tradeoffs, uptime as a misleading metric and the restart question. This lesson uses only the account contention mechanism and its consequence for order book venues, which J301-02 does not cover. Keep the split.

Transaction cost figures for maintaining quotes are illustrative and depend on the chain, the fee market and the strategy's refresh rate. The order of magnitude is the point, and it is what determines where this architecture is viable at all.

Load figures for the halt differ. Helius's history says some validators were receiving over 300,000 transactions a second. A figure of 400,000 a second circulates in other reports and appears in neither the Helius history nor the Solana Foundation's overview, so this lesson uses the Helius figure. The Solana Foundation's initial overview gives the outage as 17 hours and, in the same post, full functionality as restored under 18 hours after the stall; CoinDesk's same-day report, written while the chain was still down, gives over seven hours.