Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Market Microstructure
Order Book
Market Making
LabMarket making desk
Avellaneda–Stoikov
Glosten–Milgrom
Kyle Model
Spread Estimation
Connected Guides
  • The Glosten–Milgrom model
  • Adverse selection and informed trading

© 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.

Glosten–Milgrom

Why spreads exist even without costs: a Bayesian market maker sets the ask and the bid as the expected value after a buy and after a sell.

Random seed: 1

Setup

Model
20%
00.95
0.50
0.050.95
50
1080
Update with live numbers

ask = E[V | buy] = 0.962·0.600 / (0.962·0.600 + (1 − 0.962)·0.400) = 0.975

bid = E[V | sell] = 0.962·0.400 / (0.962·0.400 + (1 − 0.962)·0.600) = 0.945

A buy is more likely when the value is 1, so the maker charges for that news before it trades.

Quotes and belief, trade by trade
AskBidBelief P(value 1)

Dotted line: the true value (1). Click a tile to flip that trade; later quotes re-learn.

trade 50 of 50
trade 0 of 50trade 50 of 50

Trade 50: SELL, μ 0.975 → 0.962

Belief P(value 1)
0.962
Spread now
0.030
Buys / sells
29 / 21
Trades to 90%
22
Spread over time

Spread 0.200 → 0.021: it shrinks as the maker learns.

Maker's belief now
value 00.038
value 10.962

About this tool

The Glosten–Milgrom model explains the bid-ask spread with information alone. The asset is worth either a high or a low value, and the market maker does not know which. Each arriving trader is informed with probability π and knows the true value, or is a noise trader who buys or sells at random. A buy is therefore a hint that the value is high. A competitive market maker who breaks even on average sets the ask equal to the expected value given a buy, ask = E[V | buy], and the bid equal to the expected value given a sell, bid = E[V | sell]. The spread is the gap between those two conditional expectations.

Frequently asked questions

Why is the ask above the bid if there are no costs?

Because a buy order carries information. If some buyers know the value is high, the market maker's best guess of the value after seeing a buy is higher than after seeing a sell. Setting each quote to that conditional expectation means the maker breaks even against the mix of traders, and the gap between the two is the spread. More informed traders, a larger π, means a wider spread.

How does the market maker learn?

By Bayes' rule. After every trade the maker updates the probability that the value is high: a buy raises it and a sell lowers it, by an amount that depends on π. Over many trades the belief drifts towards the truth, the quotes follow it and the spread narrows as uncertainty shrinks. The lab draws this belief path trade by trade so you can see the learning happen.

Are the market maker's beliefs a martingale?

Yes. Given everything seen so far, the expected next belief equals the current belief, so the quoted mid has no predictable drift. Beliefs do move, sometimes a lot, but never in a direction the maker could have forecast. This is the same idea as an efficient price: the price already reflects all public information, and only new trades move it.

Who pays for the informed traders' profits?

The noise traders. Against informed traders the maker loses on every trade, against noise traders it gains the half-spread, and the quotes are set so the two cancel on average. A common misconception is that the market maker profits from the spread here; in this model its expected profit is zero, and the spread is a transfer from uninformed to informed traders.

Learn the theory

  • The Glosten–Milgrom model — A Bayesian market maker facing informed and noise traders: quotes as conditional expectations, a spread from the informed share, and learning trade by trade.
  • Adverse selection and informed trading — Why trading with someone who knows more costs money, markouts as the measure of that cost, toxic flow, and how informed traders change the best spread.