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
  • Measuring and decomposing the bid–ask spread
  • The Glosten–Milgrom model

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

Spread Estimation

Estimate the bid-ask spread from trades alone: classify a tape into buys and sells, compute Roll's measure and the effective spread, and see where they disagree.

True market

10.0¢
220
2.5¢
010
35%
00.9
120
30640
1
19999
Roll 2√(−cov)
2√(19.92) = 8.9¢
Effective 2|p − m|
10.0¢
Theory for Roll: S·√(1 − α)
8.1¢
Trade tape
Trade prints
Roll estimate
8.9¢
Roll error vs true S
−11%
Lag-1 autocorrelation of Δp
−0.42
Effective spread
10.0¢

About this tool

Quotes are not always available, but trade prices usually are. Spread estimators recover the bid-ask spread from the trades themselves. Roll's measure uses the fact that trades bounce between the bid and the ask: buys print high and sells print low, so consecutive price changes are negatively correlated. If the true value follows a random walk, the spread is s = 2√(−cov(Δp_t, Δp_{t−1})). When quotes are available, the effective spread measures what each trade really cost: 2|p − mid|, twice the distance of the trade price from the mid. This lab lets you classify a tape by hand and compare both measures.

Frequently asked questions

Why are consecutive price changes negatively correlated?

Because of bid-ask bounce. If the last trade was a buy at the ask, the next trade is equally likely to be a buy or a sell, so on average the next price change is downward. After a sell at the bid it is upward on average. Even when the true value does not move at all, the trade price zigzags between the two quotes and the changes have negative autocovariance.

How does the Roll measure work?

With a constant half-spread c and random buy/sell directions, the covariance of consecutive price changes is −c². Solving for the spread gives s = 2c = 2√(−cov). You only need a series of trade prices. If the sample covariance happens to be positive, the formula has no real answer; that is common in short samples and a sign the estimate is unreliable.

What is the effective spread?

It measures the cost of a single trade against the mid quote at the time: effective spread = 2 × |trade price − mid|. A trade at the ask has an effective spread equal to the quoted spread; a trade inside the quotes has a smaller one. Averaging over many trades gives the cost that traders actually paid, which can differ from the quoted spread on the screen.

Why does informed trading make Roll's estimate too low?

Roll assumes buys and sells are independent of future price moves. Informed traders break that: after a buy the value tends to rise, which adds positive correlation to the price changes and cancels part of the negative bounce. The covariance becomes less negative and Roll's estimate falls below the true spread. The lab lets you raise the informed share and watch the gap open.

Learn the theory

  • Measuring and decomposing the bid–ask spread — Quoted, effective and realised spreads, the Roll estimator from trade prices alone, and the split into adverse selection and the rest.
  • 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.