Objective
Explain, with numbers, why a trade moves the price: derive a spread from adverse selection, update quotes after a run of buys, and estimate what a large order will cost to execute. This is the bridge between "make me a market" games and how real execution desks think.
Two kinds of flow
Every order a market maker sees comes from one of two broad groups:
- Informed flow trades because it knows (or believes) something about value: a fundamental view, a faster read of news, a large parent order it is working. It buys when value is above your ask and sells when it is below your bid. Every informed fill loses you money on average.
- Uninformed (noise or liquidity) flow trades for reasons unrelated to short-term value: index rebalancing, hedging, cash flows, retail. On average it pays you the half-spread.
You cannot tell them apart order by order. You can only set prices so that what you earn from the second group pays for what you lose to the first, and you can learn from the direction of flow. That learning is what moves prices.
Glosten–Milgrom: the spread from adverse selection
The cleanest model: value is either or , with . Each period one trader arrives. With probability they are informed (buy if , sell if ); otherwise they buy or sell with probability each. The market maker is competitive and risk-neutral, so each quote earns zero expected profit conditional on being hit:
This is the key idea: you do not quote the unconditional mean, you quote the mean given that someone chose to trade with you on that side. By Bayes,
With this simplifies to , so
The spread is proportional to the share of informed traders and to the size of the information they hold. No inventory cost, no fees: adverse selection alone forces a spread.
Worked example
Glosten–Milgrom quotes and a run of buys
is 90 or 110 with equal probability, and 30% of traders are informed. (a) Find the bid and ask and check the market maker breaks even on a buy. (b) The first order is a buy. Re-quote. (c) What happens to the quotes if buys keep coming?
Show solutionHide solution
(a) and . With a 50/50 prior, , so
Spread . Break-even check on a buy: buys arrive with probability and informed buys with probability , so 30% of buyers are informed. Against them you sell at 103 something worth 110 (); against the rest you sell at 103 something worth 100 on average (). Expected profit .
(b) After the buy, , so fair value is now : the old ask has become the new mid. Applying Bayes again from :
- another buy gives , so the ask is about 105.50;
- a sell gives , so the bid is 100.00.
New quote 100.00 / 105.50, around a fair value of 103.
(c) Iterating:
| Buys so far | Bid | Ask | Spread | |
|---|---|---|---|---|
| 0 | 0.500 | 97.00 | 103.00 | 6.00 |
| 1 | 0.650 | 100.00 | 105.50 | 5.50 |
| 2 | 0.775 | 103.00 | 107.30 | 4.30 |
| 3 | 0.865 | 105.50 | 108.45 | 2.94 |
Two lessons. Each buy permanently moves the price up (the bid after buys equals the ask after ), because the trade carried information. And the spread narrows as the market maker becomes more certain: less left to learn means less to lose to the informed.
def gm_quotes(p_high, v_low, v_high, alpha):
"""Glosten-Milgrom bid and ask when V is v_low or v_high and a fraction alpha of traders is informed."""
buy_h, buy_l = alpha + (1 - alpha) / 2, (1 - alpha) / 2 # P(buy | V high), P(buy | V low)
p_buy = p_high * buy_h / (p_high * buy_h + (1 - p_high) * buy_l) # P(V high | buy)
p_sell = p_high * buy_l / (p_high * buy_l + (1 - p_high) * buy_h) # P(V high | sell)
ask = v_low + (v_high - v_low) * p_buy
bid = v_low + (v_high - v_low) * p_sell
return bid, ask, p_buy, p_sell
p = 0.5
for n in range(4):
bid, ask, p_buy, _ = gm_quotes(p, 90, 110, 0.3)
print(f"after {n} buys: P(high)={p:.3f} bid={bid:.2f} ask={ask:.2f} spread={ask - bid:.2f}")
p = p_buy # the next order is another buy
Output:
after 0 buys: P(high)=0.500 bid=97.00 ask=103.00 spread=6.00
after 1 buys: P(high)=0.650 bid=100.00 ask=105.50 spread=5.50
after 2 buys: P(high)=0.775 bid=103.00 ask=107.30 spread=4.30
after 3 buys: P(high)=0.865 bid=105.50 ask=108.45 spread=2.94
Order-flow imbalance
In practice you do not know , but you can watch which side is aggressing. Classify each trade as buyer- or seller-initiated (a trade at the ask is a buy; at the bid, a sell). Over a window,
Short-horizon price changes are strongly correlated with contemporaneous OFI, roughly linearly for small imbalances: . Book-based versions also count changes in resting size at the best bid and ask (a bid queue that keeps growing is buying pressure even before any trade). The microprice from the order-book lesson is a static cousin of the same idea.
For a market maker, persistent one-sided OFI is the real-world version of "the interviewer keeps buying": move your fair value with it and lean your inventory against it.
Example. In five minutes, 120,000 shares trade at the ask and 80,000 at the bid. OFI ; imbalance ratio . If you have estimated cents per 1,000 shares of net flow, the model attributes about cents of upward move to this flow.
Temporary and permanent impact
When someone executes a large metaorder (a parent order split into many child orders), the price path typically rises during execution, peaks at the end and then partly reverts. Split the move into two parts:
- Permanent impact: the part that stays. It reflects the information the market inferred from the flow (Glosten–Milgrom's learning). It does not depend much on how fast you trade, only on how much.
- Temporary impact: the extra cost of demanding liquidity quickly, walking the book and paying liquidity providers to take the other side. It decays once you stop. It grows with trading rate, which is why execution algorithms slice orders over time.
The Almgren–Chriss framework models these as permanent impact proportional to the quantity traded so far and temporary impact proportional to the current trading rate, then trades off impact (trade slowly) against price risk while the order is outstanding (trade fast). Risk-averse traders front-load; risk-neutral ones spread evenly.
The square-root law
The most robust empirical regularity in execution: the peak impact of a metaorder of size is approximately
where is daily volatility, is average daily volume and is a constant of order 1 (estimates typically lie roughly between 0.5 and 1). It has been reported across equities, futures, options and crypto, for metaorders from a small fraction of a percent to a few percent of daily volume.
Treat it as an empirical rule of thumb, not a law of nature: it describes averages over many metaorders, with large dispersion around any single order, and it says nothing about how the cost depends on execution speed within a day. Two consequences worth knowing cold:
- Impact per share is concave in size: four times the order means twice the impact per share.
- Total cost is impact times quantity, so it scales like : four times the order costs eight times as much.
Worked example
costing an order and measuring slippage
(a) A stock has daily volatility 2%. You want to buy $10m, which is 1% of average daily volume. Take . Estimate impact in bps and in dollars, then repeat for $40m (4% of ADV).
(b) A portfolio manager decides to buy 50,000 shares when the price is 40.00. The desk fills 40,000 shares at an average of 40.15; the remaining 10,000 are never filled and the stock closes at 40.60. Compute the implementation shortfall.
Show solutionHide solution
(a) bps. On $10m that is about $20,000.
At $40m: bps, so about $160,000. Four times the size, twice the impact per share, eight times the cost. This is why large funds care about capacity: returns per dollar fall as assets grow.
(b) Slippage is measured against the decision (arrival) price, here 40.00. Implementation shortfall splits into:
- Execution cost on what was filled: $6,000. This includes half-spreads, impact and any drift during execution.
- Opportunity cost on what was not filled: $6,000. The paper portfolio would have earned this; the real one did not.
Total $12,000 against a paper position of $2,000,000, i.e. 60 bps. Fees and commissions would be added on top. Note the tension: trading more slowly would have cut execution cost but increased the opportunity cost when the price ran away.
How this comes up in interviews
- "Why do spreads exist?" Give the three costs (adverse selection, inventory, fixed/fees), then the Glosten–Milgrom argument: the ask is , not .
- "Someone keeps buying from you. What do you do?" Raise fair value (the flow is information), skew to shed the short, and consider whether the flow is informed or a large uninformed order you can earn from.
- "How would you execute a big order?" Split it, trade a modest fraction of volume, use passive orders where you can, and quote a cost estimate from the square-root law. Mention the trade-off between impact and risk.
- "Is impact linear in size?" No: roughly square-root per share for metaorders, while Kyle's linear is a model for small net flow over short windows.
Knowledge check
is 80 or 120 with equal probability and 25% of traders are informed; the rest buy or sell at random. In the Glosten–Milgrom model, what is the ask?
Knowledge check
Under the square-root impact law, you increase a metaorder from 1% to 9% of daily volume. By what factor does the total impact cost (impact per share times shares) grow?
Knowledge check
You buy a large block. The arrival price was 50.00, the price peaked at 50.20 as you finished, and a day later, with no news, it sits at 50.08. Which is the best estimate of your permanent impact?
Key takeaways
- Quotes are conditional expectations given the trade: ask , bid .
- In Glosten–Milgrom with a 50/50 prior, spread ; each trade moves the mid permanently, and spreads narrow as information is revealed.
- Order-flow imbalance predicts short-horizon moves; persistent one-sided flow should move your fair value.
- Impact = permanent (information, stays) + temporary (liquidity demand, decays). Trading faster raises temporary impact.
- Square-root law: impact , cost . An empirical average, not a guarantee.
- Slippage is measured against the decision price and includes the opportunity cost of what you failed to trade.
Practice problems
Finished reading?
Answer the 3 knowledge checks to complete this lesson (0 done).