6.5.2HFT & Advanced Concepts

Learn about market making at scale

2,384 words11 min readdifficulty · medium

WHAT is market making?

WHY do they exist? Buyers and sellers rarely arrive at the same instant. The MM stands in the middle, absorbing the timing mismatch into its own inventory, in exchange for the spread. Without them, you'd wait for a natural counterparty ("I want AAPL now but nobody wants to sell now").

"At scale" means: a modern MM (Citadel Securities, Jane Street, Virtu) quotes tens of thousands of instruments, holding positions for milliseconds, doing millions of trades/day. The math per-trade is tiny; the statistics is everything.


HOW the money is made — derive the edge

Assume a "true" (fair) price mm = the mid: m=Pa+Pb2m = \frac{P_a + P_b}{2}

The half-spread is δ=s2=Pam=mPb\delta = \frac{s}{2} = P_a - m = m - P_b.

Derivation of expected profit per round-trip. Suppose the true price does not move. The MM sells at Pa=m+δP_a = m+\delta to one trader and buys at Pb=mδP_b = m-\delta from another. Net cash: π=(Pam)+(mPb)=δ+δ=s\pi = (P_a - m) + (m - P_b) = \delta + \delta = s

But two things eat this edge:

  1. Adverse selection — informed traders trade against you when the price is about to move your way. If a trader buys from you (lifts your ask) precisely because the price is going up, you sold too cheap.
  2. Inventory risk — if buys and sells don't match, you carry a position exposed to price moves.

Adverse selection — the real enemy at scale

Let α\alpha = expected mid-move against you right after a fill (in price units). Then:

Consequence: widen δ\delta when flow is toxic, tighten when flow is benign (retail). This is why retail-order flow (uninformed) is valuable — hence Payment for Order Flow (PFOF).


Inventory risk — the Avellaneda–Stoikov idea (from scratch)

Model the MM's wealth including inventory value. Hold qq shares, cash xx, mid mm. Mark-to-market value: V=x+qmV = x + q\,m

The MM sets a reservation price rr = the price at which it's indifferent to holding inventory. With risk aversion γ\gamma, price volatility σ\sigma, and time-to-close TtT-t:

Then quotes are placed symmetrically around rr (not mm), with total spread from a utility-maximizing formula: s=γσ2(Tt)+2γln ⁣(1+γk)s^\ast = \gamma\sigma^2(T-t) + \frac{2}{\gamma}\ln\!\left(1+\frac{\gamma}{k}\right) where kk governs order-arrival intensity. Why two terms? First term = inventory-risk premium; second = the width needed to balance fill-rate vs. edge (a monopolist's optimal markup).

Figure — Learn about market making at scale

WHY "at scale" changes everything

Portfolio inventory variance for NN roughly-uncorrelated names: Var ⁣(iqiri)iqi2σi2(uncorrelated)\text{Var}\!\left(\sum_i q_i\, r_i\right) \approx \sum_i q_i^2\sigma_i^2 \quad\text{(uncorrelated)} So risk per dollar of edge falls as you add names — why breadth beats depth. Correlated names (whole sector) don't diversify; MMs hedge those with the index/futures.


Worked examples


Common mistakes


Flashcards

What two prices does a market maker continuously post?
A bid (buy) PbP_b and an ask (sell) PaP_a — a two-sided market.
Define the spread and half-spread.
Spread s=PaPbs=P_a-P_b; half-spread δ=s/2=Pam=mPb\delta=s/2=P_a-m=m-P_b where mm is the mid.
Gross edge on a matched round-trip with no price move?
The full spread s=2δs=2\delta (one half-spread per leg).
Formula for realized edge per trade including adverse selection?
E[π]=δα\mathbb{E}[\pi]=\delta-\alpha, where α\alpha is the average adverse mid-move against you.
Why is retail (uninformed) order flow valuable to a MM?
It has low adverse selection (α0\alpha\approx0), so the spread is nearly pure profit — the basis of PFOF.
What is the reservation price and its formula?
The inventory-indifference price r=mqγσ2(Tt)r=m-q\gamma\sigma^2(T-t); you quote around rr, not mm.
Why skew quotes when long inventory (q>0q>0)?
r<mr<m, so you lower bid/ask to attract sellers and repel buyers, mean-reverting inventory to zero.
Meaning of the two terms in Avellaneda–Stoikov optimal spread?
γσ2(Tt)\gamma\sigma^2(T-t) = inventory-risk premium; 2γln(1+γ/k)\frac{2}{\gamma}\ln(1+\gamma/k) = fill-rate vs edge markup.
For N independent trades, how do total mean, total variance, and total std scale?
Mean N\propto N, variance N\propto N (grows linearly), std N\propto\sqrt N.
What actually shrinks like 1/N at scale?
The variance of the AVERAGE (per-trade) P&L; the total P&L variance grows like Nσπ2N\sigma_\pi^2.
Why does "at scale" help despite total risk growing?
The ratio mean/std =μσπN=\frac{\mu}{\sigma_\pi}\sqrt N grows — edge outgrows risk, so risk-adjusted return improves.
How do MMs handle correlated names that don't diversify?
Hedge the common factor with an index/future rather than relying on cancellation.

Recall Feynman: explain to a 12-year-old

Imagine a lemonade stand that says "I'll buy your lemons for 9 cents and sell lemonade for 11 cents" — always. You make 2 cents each time you buy and sell. That 2 cents is the spread. Now if too many people keep selling you lemons and nobody buys, your fridge overflows (that's inventory risk), so you drop your prices to get rid of extra lemons. And if a super-smart farmer only sells you lemons right before lemon prices crash — you got tricked (that's adverse selection). A big lemonade company runs a stand in every town at once. Each town is a coin-flip of luck, so the total wobble still gets bigger with more towns — but your average per town becomes super steady and predictable, and your total profit grows even faster than the wobble. Tiny 2-cent bits × zillions of steady trades = real, reliable money.

Connections

  • Bid-Ask Spread — the raw material of the MM's edge.
  • Adverse Selection & Informed Trading — why the spread is earned.
  • Inventory Risk & Avellaneda-Stoikov Model — the quoting math.
  • Payment for Order Flow (PFOF) — monetizing benign flow.
  • Law of Large Numbers — statistical backbone of "at scale."
  • Order Book Dynamics — where quotes actually live.
  • Delta Hedging — how correlated inventory is neutralized.

Concept Map

posts

posts

defines

defines

half is

averages to

averages to

gross edge

reduced by

reduced by

minus alpha gives

drives

makes retail flow valuable

survives via

Market Maker

Bid price Pb

Ask price Pa

Spread s = Pa - Pb

Half-spread delta

Mid price m

Round-trip profit = 2 delta

Adverse selection alpha

Inventory risk

Realized edge = delta - alpha

Payment for Order Flow

Scale across many names

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, market maker matlab liquidity ki dukaan. Woh hamesha do price bolta hai — ek bid (main itne me kharidunga) aur ek ask (main itne me bechunga). Beech ka gap hi spread hai, aur wahi uska profit. Agar ek banda tumse bechta hai 99.99 pe aur doosra kharidta hai 100.01 pe, aur price hilta nahi, to tumne poora spread (2 paisa) kama liya. Chota lagta hai, par ye kaam din me lakhon baar hota hai — isliye "at scale" bolte hain.

Par do dushman hain. Pehla adverse selection: jo smart trader tumhare against trade karta hai, usko kuch pata hota hai — price uske favour me move karta hai, aur tum ghaate me. Isliye realized edge =δα=\delta-\alpha hota hai, yani spread me se information-cost ghatao. Isi wajah se retail (uninformed) flow valuable hai — usme α\alpha chota hota hai, PFOF ka pura khel yahi hai. Doosra dushman inventory risk: agar log sirf bech rahe hain, tumhare paas maal jama ho jaata hai. Iska ilaaj — reservation price r=mqγσ2(Tt)r=m-q\gamma\sigma^2(T-t). Long ho to rr mid se neeche, quotes neeche skew karo taaki inventory zero ki taraf aaye.

Ab "scale" ka asli sach — dhyaan se. Bahut log galti se kehte hain ki total P&L ka variance 1/N1/N se girta hai. Galat. NN independent trades ke liye total variance =Nσπ2=N\sigma_\pi^2 hota hai, yani ye linearly badhta hai (std N\propto\sqrt N). Jo cheez 1/N1/N se girti hai woh hai average (per-trade) P&L ka variance — yahi Law of Large Numbers hai, jo result ko reliable banata hai.

Phir scale help kaise karta hai? Kyunki mean N\propto N badhta hai par std sirf N\propto\sqrt N — matlab edge, risk se zyada tezi se badhta hai. Ratio mean/std =μσπN=\frac{\mu}{\sigma_\pi}\sqrt N upar jaata hai, yani risk-adjusted return improve hota hai, chahe absolute risk badhe. Aur alag-alag stocks pe faila do (breadth) to uncorrelated inventory cancel ho jaata hai; jo correlated hain unko index/futures se hedge karo. Yaad rakho: SAI — Spread charge karo, Adverse minus karo, Inventory sambhaalo.

Test yourself — HFT & Advanced Concepts

Connections