DEX essentials

Order books vs AMMs: where executable prices come from

Compare discrete resting offers with reserve-based pricing and see how both can supply an aggregated token trade.

An order book organizes offers to buy or sell at stated terms. An AMM derives executable amounts from a pricing rule and available reserves. Both can provide liquidity, but a trader consumes that liquidity in different ways.

Discrete offers versus a curve

In a hypothetical order book, the first seller offers 10 A at 2 B each and the next offers 20 A at 2.1 B each. Buying 15 A consumes one complete offer and part of the next. The average price reflects both levels.

In a pool, output changes according to the reserve curve as the trade moves through it. There need not be a separate signed seller order at each intermediate price. Uniswap's swap explanation contrasts pool execution with discrete order-book trades.

PropertyOrder-book liquidityAMM liquidity
Visible termsOrders at price and size levelsPool state plus pricing rules
Large trade effectConsumes multiple offer levelsMoves through the pricing curve
Liquidity updateNew, cancelled or filled ordersTrades and liquidity changes

Where aggregation fits

An aggregator can compare the final amount available from either model. A dealer's signed offer is another source with explicit terms; it does not need to be presented in a public order book to compete with an AMM route. 0x's order specification describes signed maker/taker terms.

The relevant comparison fixes the same assets, amount and execution conditions. Comparing an order book's best tiny offer with an AMM's quote for a large order mixes different quantities.

Neither model removes the need for real available inventory. A large order can encounter worse incremental terms in both. The route-selection problem is to combine eligible capacity effectively, while respecting each source's own settlement rules.

Sources & verification (2)

Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.

  1. Understanding Swaps on Uniswap

    AMM execution, minimum output, maximum input, deadlines and impact.

    https://developers.uniswap.org/docs/get-started/concepts/traders/swaps
  2. Orders — 0x Protocol 4.1 documentation

    Version-specific order fields: token identity, amounts, maker/taker, expiry and RFQ.

    https://docs.0xprotocol.org/en/latest/basics/orders.html

Continue reading

What request-for-quote liquidity adds to a DEX route Firm vs indicative quotes in token trading Maker and taker roles beyond centralized exchanges