On this page
  1. Compare the offers with the pricing rule
  2. Identify the state behind the quote
  3. Start at 2 A per B, then follow the quantity
  4. Separate the total, average and price afterward
  5. A design label does not describe the whole service
  6. Common questions about order books and AMMs
  7. Sources and limits of the illustration

Compare the offers with the pricing rule

An order book shows offers at stated prices and quantities. In a constant-product AMM, a rule linking two token reserves determines the amount required for a purchase. To compare the two, follow the whole quantity you want to receive and the state left afterward.

AMM means automated market maker. AMMs can use different designs; this guide calculates one specified model, not a formula for every AMM. The order book is also a simple example with a fixed set of offers, rather than a description of a named service.

Both examples use fictional tokens A and B. Prices are in A per B, not dollars or event probabilities. We leave out fees, gas, token precision and rounding, and assume no cancellations, new offers or outside price changes during the calculation.

Identify the state behind the quote

For the order book, an ask is an offer to sell B for A. We specify two offers: 5 B at 2 A per B, followed by 5 B at 2.2 A per B. The calculation uses those offers in that order and assumes their stated quantities remain available.

For the pool, let x be its B reserve and y its A reserve. It starts with 100 B and 200 A. Our fee-excluded rule is x × y = 20,000: removing B requires adding A so that the reserve product stays the same.

Two specified models: what changes during the fictional purchase?
Specified designStarting stateChange during the purchaseLimit of the example
Discrete resting offers5 B at 2 A/B; then 5 B at 2.2 A/BFilled quantities are removed from the stated offersNo offers beyond these 10 B are specified
Fee-excluded constant-product pool100 B and 200 A; x × y = 20,000B decreases and A increases under the stated ruleOne model; excludes actual protocol fees and other AMM designs

The BIS-hosted explanation of automated market making discusses the distinction between order-book trading and reserve-based pricing. Chainlink’s AMM guide describes more than one AMM design. Neither makes these invented states a current market quote.

Uniswap’s v2 pricing documentation is version-specific and accounts for fees. The fee-excluded arithmetic below is a teaching model, not a calculation of an actual Uniswap swap.

Start at 2 A per B, then follow the quantity

The first book offer is 2 A per B. The pool’s initial marginal price—the price for an infinitesimally small change—is also 200 ÷ 100 = 2 A per B. These matching starting numbers do not tell you the total for 10 B.

In the book example, receiving 10 B consumes both offers: (5 × 2) + (5 × 2.2) = 21 A. Divide by 10 B to get an average of 2.1 A per B.

In the pool, removing 10 B leaves 90 B. Its new A reserve must be 20,000 ÷ 90 = 2,000/9 A. Subtract the original 200 A to find the required input: 2,000/9 − 200 = 200/9 A, or approximately 22.2222 A. The average is 20/9 A per B, approximately 2.2222.

The same initial 2 A per B, followed over three stated quantities
B receivedBook total input (A)Pool total input (A)Pool average (A/B)Pool post-trade marginal price (A/B)
1 B2200/99 ≈ 2.0202200/99 ≈ 2.020220,000/9,801 ≈ 2.0406
5 B10200/19 ≈ 10.526340/19 ≈ 2.1053800/361 ≈ 2.2161
10 B21200/9 ≈ 22.222220/9 ≈ 2.2222200/81 ≈ 2.4691

Each row starts afresh from the same initial offers and reserves; the rows are not consecutive purchases. Fractions are exact within the model, and decimals are rounded to four places. The final column describes the pool state after that row’s purchase, not the average paid.

For a quantity q of B, the pool’s total A input is C(q) = 20,000/(100 − q) − 200, equivalently 200q/(100 − q), for 0 ≤ q < 100. For q > 0, its average is C(q)/q = 200/(100 − q). Its post-trade marginal price is the derivative dC/dq = 20,000/(100 − q)². The book calculation is defined only for the stated 0–10 B; it assumes no further offers.

Separate the total, average and price afterward

After the pool supplies 10 B, its marginal price is 200/81 A per B, approximately 2.4691. That differs from the average of 20/9 A per B. The marginal price describes an infinitesimal change at the new state; it is not a quote to receive another finite quantity.

Read each price in the 10 B example for the question it answers
MeasureValueWhat it tells you
Pool total input200/9 AThe amount of A required to receive all 10 B
Pool average price20/9 A/BTotal A input divided by the 10 B received
Pool post-trade marginal price200/81 A/BThe infinitesimal price at the resulting reserve state
Book last filled ask2.2 A/BThe price of the final stated offer used; the next ask is unspecified

Once the two book offers have supplied their 10 B, the last fill at 2.2 A per B tells you nothing about the next ask. We have not supplied one. Likewise, the pool’s post-trade marginal price does not retroactively become the price paid for all 10 B.

These totals follow from the states we invented. Matching the starting price and requested quantity does not match the capital, liquidity shape or risk of the two designs. It also leaves out real costs. Change the stated book offers and the comparison changes; this example identifies no cheaper, better or safer mechanism.

A design label does not describe the whole service

“Order book” and “AMM” describe aspects of trading design. Either label alone leaves other questions unanswered: who holds assets, where matching happens, how settlement works, and who can use the service. For an event market, its resolution rules also require a separate explanation. A mechanism label does not establish a true event probability.

Use the calculation to distinguish offers from a reserve rule, then read a service’s own current specifications for its implementation. For prediction-market context, see market architecture, execution costs, and the comparison of trading costs.

Common questions about order books and AMMs

Is every AMM a constant-product pool?

No. AMMs can use different designs. This guide calculates one two-token model with x × y fixed and fees excluded. It does not apply that formula to every AMM or every version of a protocol.

Why can the same starting price produce different totals?

The stated offers and the pool rule produce different price paths across the quantity received. A starting price describes only the start. Calculate the total for the whole quantity, then divide to find the average.

Does an order book guarantee that an order will fill?

No. Our calculation assumes the two stated offers remain available. A book label alone does not guarantee the price, available quantity or a complete fill.

Is the pool’s price after the purchase what was paid for all 10 B?

No. The average for those 10 B is 20/9 A per B. The post-trade marginal price is 200/81 A per B. They answer different questions, and the latter is not a finite executable quote.

Does this show which engine HypaForecast uses?

No. These are neutral design illustrations. They do not identify HypaForecast’s current matching or pricing engine, custody arrangements or anyone’s eligibility to use a service.

Explore HypaForecast markets

Browse current market questions and the 5-minute and 15-minute BTC round details. These links do not establish a pricing-engine design or your eligibility to use a service.

Sources and limits of the illustration

The source texts were checked on 19 October 2026. This is the evidence-check date, not their publication date. All A/B quantities, offers and calculations in this guide are fictional. They do not represent a current venue, asset price, event probability or actual trade.

HypaForecast publishes educational guides and operates a prediction-market service. This neutral illustration does not identify its current pricing or matching engine, establish its custody arrangements, or determine your eligibility to use a service.