Basic Prerequisites: Probability & Stochastic Control and Stochastic Calculus & Itô’s Lemma - and the in-pillar baseline Avellaneda–Stoikov & Optimal Quoting. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)


1. Intuition & Practical Objective

In crypto, the role of “market maker” is split between two very different machines. On centralized exchanges (CEXs) a human/algorithmic dealer quotes a two-sided book and manages inventory exactly as the Avellaneda–Stoikov family of optimal-quoting models describes. On decentralized exchanges (DEXs) the market maker is a smart contract - an automated market maker (AMM) - that prices liquidity with a trading function such as and, unlike a CEX maker, cannot cancel or skew its quotes. The AMM is liquidity provision by algorithm: any trader can trade against it at any time, and the LPs who deposited capital absorb the inventory and adverse-selection risk that a human maker would have managed with a reservation price.

This folder is the topic-folder for crypto/DeFi market making within Pillar 6. It is a hub: it (a) gives the fast formula lookup below (job #1 - the constant-product curve, divergence loss, the LVR rate, and the Uniswap v3 token formulas), and (b) routes you to six sub-pages that walk from raw intuition through the constant-product AMM, concentrated liquidity, MEV / adverse selection, the failure modes, and the extensions.

The one-sentence essence. “An AMM LP is a passive market maker who writes a short-gamma payoff for free: he earns swap fees but is systematically picked off by arbitrageurs, losing divergence loss at the rate of pool value - so the honest question in DeFi market making is whether fee income covers the LVR, and the honest answer is ‘only at high fee tiers and high volume’.“


2. Mathematical Ground Truth & Derivations

Quick-Reference Lookup (job #1). The formulas below are transcribed from the Uniswap v3 whitepaper (Adams et al. 2021), the constant-product replication of Clark (2020), and Milionis, Moallemi, Roughgarden & Zhang (2022) on loss-versus-rebalancing, and cross-checked against Capponi & Jia (2022) and Lehar & Parlour (2023). The numbers in the check column were re-executed and reproduced exactly (see §3). All divergence-loss and LVR results are derived from scratch on the sub-pages, not quoted.

Notation: pool reserves of tokens (risky) and (numeraire), the constant-product invariant, the marginal price of in units of , the price multiplier since deposit, the “liquidity” of a position, the concentrated range bounds, the price volatility, the pool value in numeraire.

QuantityFormulaVerified check
Constant-product invariant
Marginal price
Token out for in X in Y out
LP value (numeraire)
Divergence loss;
v3 in-range token amounts,
LVR instantaneous ratemeasured vs
LP net P&L vs holdbreakeven fee at

Critical scaling caveat. Divergence loss is a one-interval (path-independent) measure: it depends only on , not on how the price got there. LVR is the path-dependent, trade-by-trade analogue (Milionis et al. 2022) that actually accumulates with every arbitrageur trade - a price path that round-trips (up then back to ) has zero divergence loss but positive LVR. Confusing the two is the single most common error in this folder: divergence loss tells you the worst case if you hold to ; LVR tells you what arbitrageurs are actually costing you along the way.


3. Computational Implementation - the DeFi quoting sandbox

This runs on stdlib only (deterministic, math/random) and reproduces the checked numbers above: the divergence-loss table, the v3 token formulas, and the analytic LVR coefficient. The same engine drives the sub-pages.

Every checked value in the lookup table is reproduced exactly; the LVR rate is verified by Monte Carlo in 05 · Failure Modes and 06 · Advanced Extensions.


4. Failure Modes & First-Principles Breakdowns

Hub signposts - the folder’s failure-mode analysis lives in 05 · Failure Modes & Practice. In one line each:

  1. Adverse selection is structural, not incidental. The AMM cannot cancel or skew its quotes; arbitrageurs and sandwich bots pick off every stale price. Divergence loss is the adverse-selection cost of the passive book - it maps one-to-one onto the Glosten–Milgrom / VPIN framing of Adverse Selection and Toxic Order Flow.
  2. Fees rarely cover LVR on volatile assets. Our simulation shows that at (annualized) and annual turnover, all standard Uniswap fee tiers (0.01%, 0.05%, 0.30%) lose money net of divergence loss - the breakeven fee is .
  3. No circuit breakers, 24/7. Crypto venues never close and have no exchange-level circuit breakers or price bands. A crash or an oracle manipulation that would trip a halt on a CEX is just another (faster) arbitrage trade against the AMM - 05.
  4. Protocol risk compounds market risk. Smart-contract risk, bridge/peg risk, and oracle risk are additive to the microstructure risk - there is no bailout, no exchange guarantee, and no order of protection.

5. References

  • Adams, Hayden, Zinsmeister, Noah, Salem, Moody, Keefer, River & Robinson, Dan: Uniswap v3 Core (2021), the Uniswap v3 whitepaper. Canonical source for concentrated liquidity; the v3 token formulas above are transcribed and numerically verified.
  • Clark, Joseph: The Replicating Portfolio of a Constant Product Market (2020), SSRN 3550601. *The closed-form proof that a CPMM LP’s payoff is a short position in a bundle of European options
  • Milionis, Jason, Moallemi, Ciamac C., Roughgarden, Tim & Zhang, Anthony Lee: Automated Market Making and Loss-Versus-Rebalancing (2022), arXiv:2208.06046. Introduces LVR, decomposes LP returns into the rebalancing-strategy return plus “fees minus LVR,” and proves the instantaneous rate.
  • Capponi, Agostino & Jia, Ruizhe: The Anatomy of a Liquidity Provision in Automated Market Makers (2022), arXiv:2210.07852. The adverse-selection view of AMM LPs; LP losses decomposed across fee tiers and pool sizes.
  • Lehar, Alfred & Parlour, Christine: Decentralized Exchange: The Uniswap Automated Market Maker (2023). Empirical anatomy of who provides and who withdraws Uniswap v2/v3 liquidity, and why LPs flee volatile pools.

6. Connected Graph Bridges

Beginner: start at 01 · Practitioner: start at 05