Chapter 16 · Crypto Market Structure
Why do exchanges, on-chain AMMs, and aggregators quote and execute the same coin differently?
- Skills to practice
- Understand markets
- Read first
- Chapter 14 · Liquidity
- 3D simulation
- None
Market scene
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
How will you buy $500,000 of this coin?
Observe the result
- 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.
- Exchange price changes
- Pool price remains unchanged
- Someone buys cheaply and sells dearly
- Prices converge again
- 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
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.
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.
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.
A tool comparing venues and splitting orders. It does not hold the coins itself; it allocates an order among venues at the lowest cost.
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
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.
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.
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
Below are Zhe's two venues.
The curve shows the average-price premium at each allocation. Orange marks your allocation; green marks the aggregator choice.
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
- Keep $500,000 and move pool allocation from 0% to 100%. Where is the curve's minimum? Does it match the aggregator?
- 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?
- Increase the exchange's prior rise from 0% to 5%. Does arbitrage profit grow proportionally or faster? Below which move is there no arbitrage?
- 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
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.
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.
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
- FoundationWhy do exchanges, on-chain AMMs, and aggregators quote and execute the same coin differently?Chapter 16
- AdvancedHow does Smart Routing select execution paths across CEX, DEX, and aggregators?Advanced E · Execution and microstructure
- 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.
Smart Routing: actual routing compares dozens of venues and hundreds of pools, including chain fees, execution failure probability, and latency. Optimal allocation equalizes marginal cost across venues.
Liquidity-provider losses: arbitrage selection losses can be approximated using squared price movement, and determine whether providing liquidity is profitable. See Advanced E · Execution and microstructure.
Continue the artifact: Compare venues, fees, balances, and routing.
Venue Risk: institutions limit exposure per exchange, deposit only trading requirements, and retain other assets under their own control. On-chain positions need contract-audit, upgrade-permission, and bridge-risk assessments.
Diversification versus concentration: more execution venues may lower costs, while requiring custody in more places and introducing more risks.
Continue the artifact: Handle venue failure and unconfirmed orders.
Questions to take away
Chapter self-test
The pool charges 0.3%, and its formula moves price 5.05% for the deposit, versus 2.05% in the book.
Much of the pool's $250,000 reaches its expensive segment. Equal marginal costs give the optimal split, roughly a quarter into the pool here.
Only trades change its price. Arbitrageurs buy at the old pool price and value coins at the new exchange price until the pool catches up, leaving approximately the fee-sized difference. They capture the spread.
Liquidity providers, who sell at an old price to somebody knowing the new price. This is the same informed selection suffered by Chapter 15's maker.
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.
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.