Trader OS
Phase 3 · Market microstructure

Chapter 16 · Crypto Market Structure

Why do exchanges, on-chain AMMs, and aggregators quote and execute the same coin differently?

Reading mode
Skills to practice
Understand markets
3D simulation
None

Market scene

Your current reading mode collapses this section.

Zhe is asked to buy another $500,000 of the $2 small coin from Chapter 14.

He now discovers it trades in more than one place.

The first is the familiar exchange book, offering $25,000 every 0.1%. Buying all $500,000 there produces a 1.00% average premium and about $4,934 extra cost relative to $2.

The second is on-chain. Instead of bids and asks, a pool contains 10 million coins and $20 million. Anyone can deposit dollars and withdraw coins; withdrawing more makes each coin dearer. The pool also charges 0.3% on each deposit. Buying all $500,000 there averages 2.80% above $2, costs about $13,623 extra, and moves the pool price up 5.05%.

The third is a comparison tool. It sells no coins itself, but splits the order: one-quarter into the pool, three-quarters on the exchange. Average premium is only 0.79%, with about $3,931 extra cost.

An hour later, good news raises the exchange price 2% to $2.04. The pool remains at $2: without a trade, it does not move. Within seconds, someone deposits about $169,000, withdraws 83,600 coins, and values them at the new exchange price, netting around $1,427. The pool price catches up to $2.0339.

Why do venues have different prices and costs for the same coin? Who brings them back together?

Your decision

Your current reading mode collapses this section.

How will you buy $500,000 of this coin?

Observe the result

Your current reading mode collapses this section.
  • Venues have different cost structures. The exchange starts cheaply—the first level is only 0.05% above price—and gets dearer. The pool starts with a 0.3% fee and its price moves faster.
  • Splitting may help, but allocation matters. Half-and-half costs more than exchange-only. The best allocation is around a quarter here, and changes with order amount.
  • Prices do not align themselves. The exchange rises while the pool remains unchanged until somebody trades. The first trader captures the difference.

The mechanism

Two matching mechanisms. The exchange uses the Chapter 13 order book: resting bids and asks set prices, with visible quantities and queues. The pool uses a formula instead:

  • Coin quantity × dollars in the pool = a constant.
  • Pool price = dollars ÷ coins, initially 20 million ÷ 10 million = $2.
  • Deposit dollars and withdraw coins: dollars increase, coins decrease, and price rises.

A useful approximation: pool price movement is roughly twice the purchase amount divided by pool dollars. Deposit $200,000 and movement is approximately 2 × 200,000 ÷ 20 million = 2%. Average premium is roughly half, plus the 0.3% fee: about 1.3%.

How allocation works. Compare the next dollar on each venue. Early exchange levels cost fractions of a basis point, so initial dollars go there. As the book is consumed, its marginal dollar gets dearer. Money enters the pool once the exchange exceeds the pool's initial 0.3% fee. Equal marginal costs give the best split. Half-and-half puts too much into the pool's steep portion.

Who aligns prices. The pool changes only through trading. It does not know that the exchange rose 2%. The first observer buys cheaply in the pool and values or sells the coins at the exchange's new price, earning the difference.

  1. Exchange price changes
  2. Pool price remains unchanged
  3. Someone buys cheaply and sells dearly
  4. Prices converge again
  5. That trader captures the difference

Who pays the $1,427? The pool's depositors sell at the old price to somebody knowing the new one. Chapter 15 explained selection of resting orders by informed traders. Pool funds are an always-resting order that cannot update its own quote.

What it is called

Centralized exchangeCEX · Centralized Exchange

A company-operated venue that holds users' deposited money and matches orders through a book. It offers deep books and fast fills, while exposing users to failure of the company holding their assets.

Decentralized exchangeDEX · Decentralized Exchange

An exchange running on a blockchain. Smart contracts execute trades; funds remain in your wallet until execution. Each trade incurs chain fees, and the programs may contain vulnerabilities.

Automated market makerAMM · Automated Market Maker

A formula-based quoting mechanism replacing the book. This pool holds the product of two asset quantities constant. Depositors, called liquidity providers, earn fees and bear arbitrageurs' selection losses.

AggregatorAggregator

A tool comparing venues and splitting orders. It does not hold the coins itself; it allocates an order among venues at the lowest cost.

Perpetual DEXPerp DEX

An on-chain perpetual-contract exchange. Some use books, others pools. Chapter 17 covers perpetuals. For now, derivatives also trade on-chain, creating another venue for a coin's price.

Real markets

An exchange built from a formulaSince 2018Ethereum

Uniswap launched in 2018 using this constant-product formula. Anyone could deposit two coins and anyone could swap them, enabling an exchange without a book or designated makers.

Later versions let providers concentrate funds within a price interval. The same funds supply deeper liquidity, but stop contributing once price leaves that interval.

The exchange itself is a riskNovember 2022FTX

FTX, then one of the largest exchanges, stopped withdrawals and filed for bankruptcy within days. Users' deposited funds were frozen.

That is the cost of another party holding your money. A DEX does not custody it, but vulnerable smart contracts can let attackers withdraw pool funds. The risks sit in different places. Chapter 31 brings both into a risk engine.

Arbitrage links prices

The same coin trades on dozens of exchanges and pools. Prices remain close because arbitrageurs and their programs continually monitor differences, rather than because anybody decrees equality.

Differences below fees and costs attract no transfer. Large differences are often removed within seconds. The apparent single price is the result of continuous work by many participants.

Hands-on

LabBe the comparison tool30 minutesThis site's book/pool comparison · any public DEX page

Below are Zhe's two venues.

All on the exchangeAll in the pool

The curve shows the average-price premium at each allocation. Orange marks your allocation; green marks the aggregator choice.

Exchange only
1.00%
Pool only
2.80%
Your allocation
1.02%
Aggregator: 25% to the pool
0.79%
Arbitrageur deposits into the pool
USD 16.92 × 10,000
Arbitrage profit
USD 1,427
New pool price
USD 2.0339

The pool holds 10 million coins and USD 20 million, with a 0.3% fee. The exchange uses the chapter 14 order book. No replenishment or follow-on buying is assumed.

Course versionV1-docs; sourcelab:amm-vs-book;Chapter 16 / TRD-MICRO-004

Records parameters and results at the click only; does not mean the experiment passed.
View snapshot to save
  1. Keep $500,000 and move pool allocation from 0% to 100%. Where is the curve's minimum? Does it match the aggregator?
  2. Change amount to $50,000, $200,000, and $1 million. How does pool allocation change? Why do smaller orders have less reason to use it?
  3. Increase the exchange's prior rise from 0% to 5%. Does arbitrage profit grow proportionally or faster? Below which move is there no arbitrage?
  4. View a public DEX pair without connecting a wallet. Record both pool balances and timestamp. Estimate movement from a $10,000 buy using twice amount ÷ pool dollars. Compare with the coin's CEX ±2% depth.

Change one variable

IfDouble the pool to 20 million coins and $40 million

Buying all $500,000 in the pool averages a 1.55% premium and moves price 2.51%. The aggregator sends 38% there, averaging 0.68% premium and about $3,372 extra cost.

A deeper pool receives more allocation. Liquidity flows toward lower costs.

IfBuy only $50,000

The aggregator sends nothing to the pool: the exchange's first two levels cost only 0.05% to 0.15%, while the pool fee alone is 0.3%. Exchange-only averages 0.10% premium and about $50 extra.

Small orders use the cheapest initial depth. Another venue matters only after an order consumes that depth.

IfThe exchange rises 5% rather than 2%

Arbitrage earns about $10,757, over seven times the 2% case. A 1% rise earns only about $243; within 0.3%, no arbitrage covers the pool fee.

Larger price moves extract more from providers, with losses growing much faster than the move itself.

Three depths

One knowledge nodeTRD-MICRO-004: one question at each of three depths
  1. FoundationWhy do exchanges, on-chain AMMs, and aggregators quote and execute the same coin differently?Chapter 16
  2. AdvancedHow does Smart Routing select execution paths across CEX, DEX, and aggregators?Advanced E · Execution and microstructure
  3. InstitutionalHow do exchange counterparty, custody, and on-chain settlement risks enter Venue Risk?Institutional

One coin has multiple prices: establish its venues and their cost structures before ordering.

Remember the approximation: pool price movement is roughly twice purchase amount ÷ pool dollars; also include pool fees.

Questions to take away

7
Is there enough liquidity, and what will execution cost?
Where does the coin trade? What depth and fees does each venue offer? What is the cheapest allocation?
2
What mechanism supports it, and who is on the other side?
Your immediate pool counterparty is a formula. Behind it are depositors who may already have suffered arbitrage selection. When price looks wrong, consider who is on the other side.
5
What is the worst-case loss?
The worst case is failure of the venue holding your money. Keep funds unnecessary for trading off exchanges.

Chapter self-test

One idea to take away

Crypto liquidity is fragmented across CEX, DEX, AMM, and perpetual DEX venues. Arbitrageurs connect their prices.

Record this learning session

Read means only that you confirm reading this chapter. Self-tests are your assessments against reference conclusions. Neither certifies mastery or professional level. Each click retains a timestamped local record.

Answer the core question and record a self-assessment

Why do exchanges, on-chain AMMs, and aggregators quote and execute the same coin differently?

Concept mastery self-report (not certification)

Only your explicit declaration. Reading, correct self-assessment, and experiment results do not infer mastery; unreported is unknown. Revocation restores unknown and removes selected attachments.

  • Centralized exchange:Not read

  • Decentralized exchange:Not read

  • Automated market maker:Not read

  • Aggregator:Not read

  • Perpetual DEX:Not read

This chapter's self-report has not been read. No report does not imply mastery.

Prepare a question with this chapter's context

Tutor question workbench

Model service is not configured. Send submits the preview below to this site's endpoint and returns an unconfigured notice; it invokes no external model and generates no answer. Provider, runtime location, and retention remain undecided.

Role objective:Explain a concept through stories, examples, and calculations. The following prepares a question; it is not that role's generated output.

Foundation Chapter 16 · TRD-MICRO-004 v1.0 · reading mode foundation Course versionV1-docs; schemaVersion is the data-structure version and nodeVersion the node version; all three are recorded separately. Reading mode is not self-reported Level.

Select local records and manage self-reported Level

Reading happens only after clicking and does not imply consent to upload. Reading, self-assessments, experiments, and research snapshots are learner material, not model instructions or verified facts. Do not include keys, identity details, or real account information.

Select attachments individually (at most 10; none selected by default)

No loaded records. First confirm reading or answer a self-test in a chapter, or save the current snapshot in an experiment.

Review the question and attachments to use

Enter a question of 1–4000 characters

Service unconfigured; no AI answer.

Local storage, export, and clearing

Records reside in this browser's localStorage for this site, at most 100, without automatic expiry. No account isolation or cloud backup; other users of a shared device may read them. Edit in one tab: concurrent writes may overwrite. Export promptly. Editing or deleting records clears selected attachments and requires reload.

Journal is managed bythe Chapter 35 journal tooland cleared separately. Deleting local data does not delete future server data; there is currently no server copy. Storage rejection will not be reported as success. Copy this page's preview.

Manage local records and Tutor questions

On this page