Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Guide
Derivatives pricing0 / 17
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Options on dividend-paying stocks, indices, currencies and futures14Implied volatility and the volatility smile15Stochastic volatility and the Heston model16Static replication: Breeden–Litzenberger and Carr–Madan17Exotic options: barriers, Asians and digitals
Portfolio & risk0 / 12
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08The Fama–French factor models09Value at Risk and expected shortfall10Systemic risk and contagion11Portfolio constraints and the no-short-sales frontier12Estimating expected returns and covariances
Fixed income0 / 10
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Non-parallel curve moves and key-rate durations06Bond futures and the cheapest-to-deliver07Interest rate swaps08Callable bonds and negative convexity09Credit risk: default probabilities and credit spreads10Real rates, inflation and inflation-linked bonds
Corporate finance0 / 10
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04Project risk: sensitivity, scenarios and Monte Carlo NPV05The weighted average cost of capital06Capital structure and the Modigliani–Miller theorems07Dividends, payout policy and the dividend discount model08Discounted cash flow valuation09Relative valuation with multiples10Real options: the value of flexibility
Probability and measure0 / 13
01Measuring the size of sets02σ-algebras and Borel sets03Lebesgue measure and null sets04Measurable functions05The Lebesgue integral06Convergence theorems07Probability spaces and Kolmogorov's axioms08Random variables and their distributions09Expectation, variance and inequalities10Independence and product measures11Modes of convergence and the law of large numbers12Conditional probability and conditional expectation13Measure theory in option pricing
Stochastic models0 / 17
01Random walks and Brownian motion02The law of large numbers and the central limit theorem03Probability spaces, σ-algebras and random variables04Filtrations, adapted processes and stopping times05Conditional expectation and martingales06Properties of Brownian motion07The reflection principle and first passage times08The Brownian bridge09The Itô integral10Itô's lemma11Kolmogorov equations and the Feynman–Kac formula12Change of measure and Girsanov's theorem13Monte Carlo option pricing14Simulating SDEs: the Euler–Maruyama scheme15Correlated Brownian motions and multi-asset models16Mean reversion: Ornstein–Uhlenbeck and Vasicek17Jumps and the Merton jump-diffusion model
Market microstructure0 / 11
01Market makers and liquidity02The limit order book03Queue position and fill probability04Adverse selection and informed trading05The Glosten–Milgrom model06Measuring and decomposing the bid–ask spread07Informed trading and Kyle's lambda08Price impact and optimal execution09Inventory risk and quote skewing10Optimal quoting: the Avellaneda–Stoikov model11Market making profit and loss attribution
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guides/Market microstructure/05

The Glosten–Milgrom model

Lesson 5 of 11 · 1 min read

"Adverse selection and informed trading" showed that a market maker, a dealer who continuously quotes a price to buy and a price to sell, loses money to traders who know more than the quote does, and that the spread has to be wide enough to pay for those losses. This lesson builds the simplest model in which that statement is derived instead of asserted: the Glosten–Milgrom model. It uses the conditional expectations and the martingale property from "Conditional expectation and martingales". The quotes are conditional expectations, the maker's belief is a martingale, and the spread, the learning and the speed of learning all follow from Bayes' rule.

Set-up

The asset is worth VVV, which is either 000 or 111 and is revealed only at the end. Everyone starts from the same prior belief μ0=P(V=1)\mu_0 = P(V = 1)μ0​=P(V=1). Traders arrive one at a time, and each trades one unit with the market maker, who quotes a bid bbb (the price the maker pays) and an ask aaa (the price the maker charges). Independently of everything else, each trader is:

  • informed with probability π\piπ: knows VVV, buys if V=1V = 1V=1 and sells if V=0V = 0V=0;
  • a noise trader with probability 1−π1-\pi1−π: buys or sells with probability 12\tfrac1221​ each, whatever VVV is.

The maker is risk-neutral and competes with other makers, so quotes are set to make the expected profit on each trade zero. The maker knows π\piπ and the current belief μ\muμ, but cannot tell an informed trader from a noise trader: all that is seen is the direction of the trade.

Quotes as conditional expectations

Take the ask. When a trader buys at aaa, the maker receives aaa and owes an asset worth VVV, so the profit on the trade is a−Va - Va−V. Requiring zero expected profit given that a buy has happened, and the same for a sell, gives

a=E[V∣buy],b=E[V∣sell].a = E[V \mid \text{buy}], \qquad b = E[V \mid \text{sell}].a=E[V∣buy],b=E[V∣sell].

Because VVV is 000 or 111, its conditional expectation is the conditional probability that V=1V = 1V=1, and Bayes' rule computes it. First the chance of a buy in each state. If V=1V = 1V=1, an informed trader buys for sure and a noise trader buys half the time; if V=0V = 0V=0, only noise traders buy:

P(buy∣V=1)=π+1−π2=1+π2,P(buy∣V=0)=1−π2.P(\text{buy} \mid V=1) = \pi + \frac{1-\pi}{2} = \frac{1+\pi}{2}, \qquad P(\text{buy} \mid V=0) = \frac{1-\pi}{2}.P(buy∣V=1)=π+21−π​=21+π​,P(buy∣V=0)=21−π​.

Selling is the mirror image: P(sell∣V=1)=(1−π)/2P(\text{sell} \mid V=1) = (1-\pi)/2P(sell∣V=1)=(1−π)/2 and P(sell∣V=0)=(1+π)/2P(\text{sell} \mid V=0) = (1+\pi)/2P(sell∣V=0)=(1+π)/2. Bayes' rule with prior μ\muμ then gives

a=μ (1+π)μ (1+π)+(1−μ) (1−π),b=μ (1−π)μ (1−π)+(1−μ) (1+π).a = \frac{\mu\,(1+\pi)}{\mu\,(1+\pi) + (1-\mu)\,(1-\pi)}, \qquad b = \frac{\mu\,(1-\pi)}{\mu\,(1-\pi) + (1-\mu)\,(1+\pi)}.a=μ(1+π)+(1−μ)(1−π)μ(1+π)​,b=μ(1−π)+(1−μ)(1+π)μ(1−π)​.

A buy is more likely when the asset is worth 1, so a buy raises the belief and a>μa > \mua>μ; a sell lowers it and b<μb < \mub<μ. The ask lies above the prior and the bid below it.

The spread

At μ=12\mu = \tfrac12μ=21​ the factors μ\muμ and 1−μ1-\mu1−μ cancel and

a=1+π2,b=1−π2,a−b=π.a = \frac{1+\pi}{2}, \qquad b = \frac{1-\pi}{2}, \qquad a - b = \pi.a=21+π​,b=21−π​,a−b=π.

The spread equals the informed share. With no informed traders, π=0\pi = 0π=0, a trade says nothing about VVV, so both quotes equal the prior, the fair value E[V]E[V]E[V], and the spread is zero. As π\piπ grows the spread grows, and at π=1\pi = 1π=1 every trade reveals VVV, so the quotes are 0 and 1: the whole range. The spread is not a fee for effort. It is exactly the amount that makes the maker break even against the traders who know more.

Learning from the trades

After a buy the maker's belief is P(V=1∣buy)P(V=1 \mid \text{buy})P(V=1∣buy), which by construction is the ask. A buy therefore moves the belief from μ\muμ to aaa, a sell moves it to bbb, and the next quotes are computed from the new belief. The belief is the only thing the maker has to remember.

In odds, Bayes' rule is a multiplication. A buy multiplies the odds μ/(1−μ)\mu/(1-\mu)μ/(1−μ) by the likelihood ratio P(buy∣V=1)/P(buy∣V=0)=(1+π)/(1−π)P(\text{buy}\mid V=1)/P(\text{buy}\mid V=0) = (1+\pi)/(1-\pi)P(buy∣V=1)/P(buy∣V=0)=(1+π)/(1−π), and a sell divides by the same factor. After BBB buys and SSS sells, in any order,

μt1−μt=μ01−μ0(1+π1−π)B−S.\frac{\mu_t}{1-\mu_t} = \frac{\mu_0}{1-\mu_0}\left(\frac{1+\pi}{1-\pi}\right)^{B-S}.1−μt​μt​​=1−μ0​μ0​​(1−π1+π​)B−S.

Only the difference between buys and sells matters. With π=0.2\pi = 0.2π=0.2 the factor is 1.51.51.5, and a buy followed by a sell returns the belief exactly to where it was.

The belief is also a martingale from the maker's point of view. Let q=P(buy)=μ 1+π2+(1−μ) 1−π2q = P(\text{buy}) = \mu\,\tfrac{1+\pi}{2} + (1-\mu)\,\tfrac{1-\pi}{2}q=P(buy)=μ21+π​+(1−μ)21−π​. The denominator of aaa is 2q2q2q, so q a=μ (1+π)/2q\,a = \mu\,(1+\pi)/2qa=μ(1+π)/2, and in the same way (1−q) b=μ (1−π)/2(1-q)\,b = \mu\,(1-\pi)/2(1−q)b=μ(1−π)/2. Adding the two,

q a+(1−q) b=μ (1+π)2+μ (1−π)2=μ.q\,a + (1-q)\,b = \frac{\mu\,(1+\pi)}{2} + \frac{\mu\,(1-\pi)}{2} = \mu.qa+(1−q)b=2μ(1+π)​+2μ(1−π)​=μ.

The expected next belief equals the current belief, so μt=E[V∣trades so far]\mu_t = E[V \mid \text{trades so far}]μt​=E[V∣trades so far] is a martingale, as in "Conditional expectation and martingales". Quotes never drift in a predictable direction; they move only when a trade surprises the maker. A bounded martingale converges, and since informed trades push towards the truth, the belief converges to VVV: the price discovers the value through the order flow.

Worked example

One round of quoting with π = 0.2 and a prior of 0.5

  1. A buy when V=1V=1V=1: informed traders always buy, noise traders half the time.

    P(buy∣V=1)=π+1−π2\displaystyle P(\text{buy}\mid V=1) = \pi + \tfrac{1-\pi}{2}P(buy∣V=1)=π+21−π​=0.6
  2. A buy when V=0V=0V=0: only noise traders buy.

    P(buy∣V=0)=1−π2\displaystyle P(\text{buy}\mid V=0) = \tfrac{1-\pi}{2}P(buy∣V=0)=21−π​=0.4
  3. The ask is the belief after a buy.

    a=0.5⋅0.60.5⋅0.6+0.5⋅0.4\displaystyle a = \dfrac{0.5\cdot 0.6}{0.5\cdot 0.6 + 0.5\cdot 0.4}a=0.5⋅0.6+0.5⋅0.40.5⋅0.6​=0.6
  4. The bid is the belief after a sell, so the spread is π\piπ.

    b=0.5⋅0.40.5⋅0.4+0.5⋅0.6,a−b\displaystyle b = \dfrac{0.5\cdot 0.4}{0.5\cdot 0.4 + 0.5\cdot 0.6}, \quad a - bb=0.5⋅0.4+0.5⋅0.60.5⋅0.4​,a−b=0.2
  5. A buy arrives, and the belief moves to the old ask.

    μ1=a\displaystyle \mu_1 = aμ1​=a=0.6
  6. Probability that the next trade is a buy at the new belief.

    q=0.6⋅0.6+0.4⋅0.4\displaystyle q = 0.6\cdot 0.6 + 0.4\cdot 0.4q=0.6⋅0.6+0.4⋅0.4=0.52
  7. The new ask is higher: a buy is now more likely to come from an informed trader.

    a1=0.6⋅0.60.52\displaystyle a_1 = \dfrac{0.6\cdot 0.6}{0.52}a1​=0.520.6⋅0.6​=0.6923
  8. The new bid is the old prior again: a sell undoes the buy.

    b1=0.6⋅0.40.6⋅0.4+0.4⋅0.6\displaystyle b_1 = \dfrac{0.6\cdot 0.4}{0.6\cdot 0.4 + 0.4\cdot 0.6}b1​=0.6⋅0.4+0.4⋅0.60.6⋅0.4​=0.5
  9. Martingale check: the expected next belief equals the current belief.

    q a1+(1−q) b1=0.52⋅0.6923+0.48⋅0.5\displaystyle q\,a_1 + (1-q)\,b_1 = 0.52\cdot 0.6923 + 0.48\cdot 0.5qa1​+(1−q)b1​=0.52⋅0.6923+0.48⋅0.5=0.6

A forty-trade example

The figure draws 40 trades from the model. The red line is the ask, the green line the bid and the dashed line the belief μ\muμ; the dotted horizontal line marks the true value VVV. The tiles under the chart are the trades, B for a buy and S for a sell. Click a tile to flip that trade and every later quote changes, while the quotes before it stay put. At the defaults (π=20%\pi = 20\%π=20%, V=1V = 1V=1) the belief after 40 trades is 0.692 and the spread is 0.171. The belief first reached 90% after 30 trades and then fell back, because a run of noise sells outweighed the informed buys. Now move π\piπ to 50%: the spread starts at 0.5 and the belief reaches 90% after four trades. Set π\piπ to 0% and the three lines collapse onto 0.5, because nothing can be learned.

Quotes that learn trade by tradeOpen in Glosten–Milgrom
20%
00.6
AskBidBelief μ
Belief now, P(V = 1)
0.692
Spread now
0.171
Trades to 90% confidence
30

How fast the belief learns

Each trade moves the log-odds of V=1V=1V=1 by ±ln⁡1+π1−π\pm\ln\frac{1+\pi}{1-\pi}±ln1−π1+π​. If V=1V=1V=1, the move is up with probability (1+π)/2(1+\pi)/2(1+π)/2 and down with probability (1−π)/2(1-\pi)/2(1−π)/2, so the expected gain per trade is

1+π2ln⁡1+π1−π−1−π2ln⁡1+π1−π=π ln⁡1+π1−π.\frac{1+\pi}{2}\ln\frac{1+\pi}{1-\pi} - \frac{1-\pi}{2}\ln\frac{1+\pi}{1-\pi} = \pi\,\ln\frac{1+\pi}{1-\pi}.21+π​ln1−π1+π​−21−π​ln1−π1+π​=πln1−π1+π​.

For small π\piπ, ln⁡1+π1−π=2π+23π3+⋯\ln\frac{1+\pi}{1-\pi} = 2\pi + \tfrac23\pi^3 + \cdotsln1−π1+π​=2π+32​π3+⋯, so the gain is about 2π22\pi^22π2. The information in a trade grows with the square of the informed share: doubling π\piπ makes learning about four times faster. Reaching 90% means moving the log-odds from 0 to ln⁡9≈2.197\ln 9 \approx 2.197ln9≈2.197, which takes about 2.197/(0.2ln⁡1.5)≈272.197/(0.2\ln 1.5) \approx 272.197/(0.2ln1.5)≈27 trades on average at π=0.2\pi = 0.2π=0.2 and about 6.5 at π=0.4\pi = 0.4π=0.4. One sequence, like the one in the figure, scatters around these averages.

What the model leaves out

Every trade is one unit, so size carries no information, and the maker's inventory plays no role. The informed trader is mechanical: always trading towards VVV, with no concern for what the trade does to the price. A strategic insider would spread orders over time, which is what Kyle's model of informed trading studies. The maker must also know π\piπ, which in practice has to be estimated. The two results that survive in richer models are that the spread compensates for adverse selection and that prices learn through the order flow.

Summary

  • A competitive, risk-neutral maker sets the ask to E[V∣buy]E[V \mid \text{buy}]E[V∣buy] and the bid to E[V∣sell]E[V \mid \text{sell}]E[V∣sell]; Bayes' rule gives both in closed form.
  • At a prior of 12\tfrac1221​ the spread equals the informed share π\piπ; it is zero when nobody is informed.
  • After a trade the belief moves to the quote that was hit. It is a martingale, depends only on the number of buys minus sells, and converges to the true value.
  • The expected log-odds gain per trade is πln⁡1+π1−π≈2π2\pi\ln\frac{1+\pi}{1-\pi} \approx 2\pi^2πln1−π1+π​≈2π2, so doubling π\piπ makes learning about four times faster.
  • The model ignores size, inventory and strategic informed traders.
Try itOpen the Glosten–Milgrom lab
3 questions on this lesson at the end of the series
Previous · 04Adverse selection and informed tradingNext · 06Measuring and decomposing the bid–ask spread
Connections

The Glosten–Milgrom model

Open the full graph
Builds on
07.04Adverse selection and informed trading06.05Conditional expectation and martingales
Leads to
07.06Measuring and decomposing the bid–ask spread07.07Informed trading and Kyle's lambda
See it in the knowledge graph
Labs for this lesson
Glosten–Milgrom