Skip to content
Projects / Phase 4.2 · Capstones

Inventory-aware market-making research (Coinbase BTC-USD)

This project replicates Avellaneda & Stoikov (2008) on 69 full sessions of Coinbase BTC-USD: the exponential execution-intensity law; the claim that inventory-aware quotes cut inventory and P&L dispersion relative to symmetric quotes.

Background

Market makers post buy and sell quotes and earn the spread when both sides fill. Their main risk is inventory: after a run of fills on one side they hold a position that loses money if the price keeps moving. Inventory-aware models such as Avellaneda–Stoikov and Guéant–Lehalle–Fernandez-Tapia (GLFT) shift and widen quotes to bring inventory back towards zero.

Adverse selection is the harder problem. Passive orders tend to fill just before the price moves against them, and an exchange fee or rebate of a basis point can decide whether the business pays. Backtests are difficult too, because a replay cannot know exactly where a resting order would have sat in the queue.

Why build it

This quant trading project follows quant trader and market-making research roles at proprietary trading firms, which ask for pricing, model development and risk management inside a trading team. It asks a proprietary desk whether to approve a small BTC-USD market-making book on Coinbase, and if so with which quoting policy and controls.

The learner tests the Avellaneda–Stoikov assumptions on Coinbase data from Tardis.dev, then replays symmetric, Avellaneda–Stoikov and GLFT quoting with latency, a cash and inventory ledger and several fill assumptions. The answer is a clear no at a zero maker fee, together with the fee level that would change it.

Headline result

A market-making replay comparing symmetric, Avellaneda–Stoikov and GLFT quoting. Every policy lost money at a zero maker fee because of adverse selection, while a 1 bp rebate would turn almost all of them positive: the fee tier decides the business.

Figures

  • Per-session P&L split into spread capture, 60-second adverse selection and other costs for seven BTC quoting policies, 2023–2026
    Every quoting policy lost money: the price moved against fills by 1.6–2.7 times the spread captured, and 17 times when joining the best quotes.
  • Mean session P&L of seven quoting policies under optimistic, queue-based and conservative fill assumptions, evaluation sessions
    The fill model barely matters: mean session P&L differs by at most USD 1.1 across assumptions for every policy except joining the best quotes.
  • Cumulative P&L of the monthly desk rule, always joining the best quotes, and the hindsight-best policy, 2023–2026
    The monthly review paused quoting in 44 of 45 sessions, avoiding the USD 11,750 that always joining the best quotes would have lost.
  • Hit rate of quotes by distance from the mid, with exponential fit, and the fitted decay rate per session
    Fill intensity decays exponentially with distance from the mid (median 0.66 per bp, R² above 0.9 in 68 of 69 sessions), as the model assumes.

Data used

  • Tardis.dev Coinbase BTC-USD level-2 book updates, trades and quotes: 69 monthly sessions, 2021–2026

Topics covered

  • Market making project
  • Inventory-aware market making
  • Avellaneda–Stoikov model
  • Adverse selection and spread capture
  • Queue position and fill modelling
  • Maker fees and rebates
  • Coinbase BTC-USD level-2 data

Members open the full write-up, notebook, tested code and data in the project reader.