Market Making¶
Difficulty intermediate
Overview¶
A market maker continuously posts both a bid and an offer, earning the spread by transacting against incoming order flow. Profits come from capturing the bid-ask spread net of inventory risk and adverse selection. Modern electronic market making is largely an algorithmic statistical-arbitrage discipline.
The Core Equation¶
where:
gross spread capturedhalf-spread × fills ·adverse selection costpost-trade midprice drift against you ·inventory P&Lmark-to-market on unhedged inventory ·fees / rebatesnet of maker rebates and taker fees. does: decomposes market-maker economics into the four components every desk monitors separately. Profitable when realized spread > realized adverse selection.
Quoting Mechanics¶
At any moment a market maker has live bid B and ask A quotes of some sizes:
where:
Bbest bid ·Abest ask ·mmidprice ·δhalf-spread ·rreservation (inventory-adjusted) price ·qcurrent inventory ·σvolatility ·γrisk aversion ·(T − t)time to horizon. does: quotes are centered on the reservation price, not the midprice — pushing bid down when long and ask down when short to encourage inventory mean-reversion. Core skew rule for any inventory-aware market maker.
The market maker skews quotes around the reservation price, not the midprice — pushing the bid down when long and the ask down when short to encourage inventory mean-reversion.
Avellaneda-Stoikov Model¶
A foundational stochastic-control framework. Two key outputs:
Optimal reservation price
where:
smidprice ·qinventory ·γrisk aversion ·σ²variance ·(T − t)time remaining. does: indifference price the market maker would accept to clear inventory. Quotes are placed symmetrically aroundr, not around the midprice — the source of the inventory skew.
Optimal spread
where:
δ*optimal half-spread ·γrisk aversion ·σ²variance ·(T − t)time to horizon ·korder-flow intensity (higherk⇒ flows arrive faster). does: first term is inventory risk premium, second is the monopoly spread under exponential arrival intensity. Used to set quote width in the Avellaneda-Stoikov framework.
Reference: Avellaneda & Stoikov, "High-frequency trading in a limit order book", Quantitative Finance, 2008.
Inventory Management¶
Inventory is the dominant non-spread risk. Three lever choices:
| Lever | Effect |
|---|---|
| Quote skew | Asymmetric spread to encourage offsetting trades |
| Quote size | Smaller size on the side aligned with inventory |
| Hedge | Trade related instruments (futures, ETFs) to offset |
| Kill-switch | Stop quoting if |q| exceeds threshold |
Adverse Selection¶
The fundamental cost: informed traders only hit your bid when they know price is going down, only lift your offer when they know it's going up.
Markout measures it directly — the midprice move in the seconds after your fill:
Negative markout ⇒ informed flow ⇒ widen quotes or pull from that book.
Flow Toxicity Indicators¶
| Signal | Interpretation |
|---|---|
| Order-book imbalance moves before trades | Informed traders front-running |
| Trade-size distribution skewed large | Institutional order |
| Recent markouts trending negative | Adverse selection rising |
| Cancel-replace ratio rising on opposite side | Other MMs leaning away |
Spread Decomposition¶
Three components every market maker should track separately:
where:
quoted spreadwhat you posted ·realized spreadwhat you actually kept after price drift ·adverse selectionlost to informed flow ·opportunity costmissed fills when your quote was beaten. does: isolates which component is killing PnL. If realized spread shrinks while adverse selection grows, you're being picked off — widen or pull. Used in TCA for market-maker performance.
| Component | How to measure |
|---|---|
| Realized spread | (Trade px − midprice 5 min later) · side |
| Adverse selection | (Midprice 5 min later − midprice at trade) · side |
| Opportunity cost | Spread paid by hitting when quote was beaten |
Maker-Taker Economics¶
Most modern exchanges charge takers a fee and pay makers a rebate. A market maker can be profitable on rebate alone if flow toxicity is low.
where:
effective spreadtotal earn per round-trip ·quoted spreadposted bid-ask width ·rebateper-side maker rebate (counted both directions). does: measures what a maker actually nets including exchange incentives. A maker can be profitable on rebate alone if flow toxicity is low — but chasing rebates with poor adverse-selection control is a classic blowup pattern.
But chasing rebates with poor adverse-selection control is a classic blowup pattern.
Cancellation and Quote Updates¶
A market maker re-quotes constantly:
Excessive cancellation is throttled by most exchanges (message rate limits, order-to-trade ratio caps). Quote management is a latency-sensitive engineering problem as much as a statistical one.
Practical Architecture¶
┌───────────────┐ ┌──────────────┐ ┌────────────────┐
│ Market Data │──▶│ Fair Value │──▶│ Quote Engine │──┐
│ (book, trades)│ │ + Vol Model │ │ (AS or other) │ │
└───────────────┘ └──────────────┘ └────────────────┘ │
▼
┌───────────────┐ ┌──────────────┐ ┌────────────────┐ ┌──────────┐
│ Risk Limits │◀──│ Inventory │◀──│ Fills / Acks │ │ Exchange │
│ & Kill-Switch │ │ Manager │ │ │ │ Gateway │
└───────────────┘ └──────────────┘ └────────────────┘ └──────────┘
Latency budget for a competitive MM: - Data → quote update: < 100 µs - Order ack → next decision: < 50 µs
Risk Controls¶
- Hard inventory cap — automatic flatten or quote pull above limit.
- Daily loss limit — kill switch on P&L floor.
- Message rate limit — to avoid exchange throttling.
- Volatility halt — pull quotes when σ exceeds threshold.
- Self-trade prevention — don't cross your own resting orders.
- Stale-quote protection — cancel quotes older than X ms.
Common Pitfalls¶
| Pitfall | Consequence |
|---|---|
| Quoting too tight | Hit by every informed flow |
| Ignoring inventory | One-way fills produce concentrated risk |
| Optimizing for rebate alone | Adverse selection dominates |
| No fair-value model | Quotes drift from market |
| No kill switch | Software bugs cost millions in seconds |
| Hedging in illiquid instruments | Hedge slippage > spread captured |
References: 1. Avellaneda & Stoikov, "High-frequency trading in a limit order book", Quantitative Finance, 2008. 2. Stoikov, "The micro-price: a high-frequency estimator of future prices", Quantitative Finance, 2018. 3. Cartea, Jaimungal & Penalva, Algorithmic and High-Frequency Trading, Cambridge, 2015.
q&a¶
Why don't market makers just always quote a wide spread?
Because someone else won't. Tight quotes win order flow; wide quotes get skipped. The competitive equilibrium is the spread at which expected revenue per fill = expected adverse selection cost. Wider than that and you starve; tighter and you bleed.
How is market making different from statistical arbitrage?
Market making earns the bid-ask spread by providing liquidity, with adverse selection as the main cost. Stat arb takes directional positions (often relative-value) based on statistical mispricings. MM is mostly mean-reverting inventory-management; stat arb is alpha-extraction. Both run on similar tech stacks.
What's the difference between a 'maker' and a 'taker'?
Maker: places a resting limit order that adds liquidity to the book. Taker: hits an existing order, removing liquidity. Most exchanges pay rebates to makers and charge fees to takers. Market makers are mostly makers (hence the name) but cross the spread when inventory needs cleaning up.
Why is adverse selection unavoidable?
Informed traders know something you don't. They sell to you when price is about to drop and buy from you when it's about to rise. The only defenses are: wider spreads (lose to competition), smarter pricing models (incorporate order-flow signals), and good inventory management (don't accumulate one-sided fills).
Can a retail trader make money market-making on crypto exchanges?
Possible but not easy. Lower fees and high spreads on smaller pairs help; thin books and toxic flow hurt. You need: low-latency colo or co-location, a fair-value model, a kill switch, and a budget for the bugs and inventory blow-ups that happen in your first 3 months. Most retail attempts lose.
Next Steps¶
- Statistical Arbitrage — related quant approach
- Pairs Trading — mean-reversion logic at lower frequencies
- Order Book Dynamics — the venue MMs operate in
- Latency Arbitrage — adjacent HFT discipline
- Low-Latency Architecture — the systems to run this in production