on-chain order book
An on-chain order book recreates the classic exchange model — buyers and sellers posting limit orders at chosen prices, matched against each other — entirely inside smart contracts, in contrast to the AMM model that prices trades off a formula. Traders submit bids and asks; the contract maintains the book and matches a new order against the best available opposite orders. This gives traders the precision they are used to on centralized exchanges: exact limit prices, partial fills, makers and takers, and a visible depth chart, none of which a pure constant-product AMM offers natively.
The difficulty is that order books are extremely chatty. On a fast centralized exchange, market makers post and cancel thousands of orders per second to track the market, but on a blockchain every single placement, modification, and cancellation is a transaction that costs gas and competes for limited block space. Running a full central limit order book on Ethereum L1 is therefore prohibitively expensive and slow, which is exactly why AMMs won early DeFi: they need only one transaction per actual trade, not per quote update.
Designs cope by relaxing where the book lives. Hybrid systems (dYdX v3) keep the order book and matching off-chain for speed while settling trades and custody on-chain, trading some decentralization for performance. Fully on-chain books (Serum and successors on Solana, or dedicated app-chains) only become practical on high-throughput, low-fee chains where thousands of cheap transactions per second are feasible. The general lesson is that order books need cheap, fast block space to thrive, so they have migrated toward L2s, app-specific rollups, and alternative L1s rather than living on a congested base layer.
Order books and AMMs are not rivals so much as tools for different regimes. Order books shine for professional market-makers and precise execution on liquid assets; AMMs shine for long-tail assets and passive liquidity where no professional would bother to quote. Many modern venues blend both.