One unit · two possible values · no fee anywhere

The Gap Between Bid and Ask

In a competitive binary market model, a dealer with no fees, inventory cost, or expected profit still quotes a positive gap when some traders know more. Move the informed fraction, send real orders through Bayes' rule, audit 960,000 trades, and test the elastic-liquidity case where one side loses its break-even quote. Every model result is computed live, with the model's boundaries kept visible.

The dealer does not know whether this asset will finish at 0 or 1. The next trader might know. A buy is therefore not only a request. It is evidence.

Sequential Bayesian market

Changing the informed fraction resets the order-flow path.
Private terminal value
Bid · dealer buys posterior after a sell
Public value Pr(value = 1)
Ask · dealer sells posterior after a buy
computing the symmetric quote…
computing the current spread…

Preparing the market…

tradeordertraderpricepublic value
No orders yet.

The first quote begins from equal odds. An informed trader buys only when the value is 1 and sells only when it is 0. A liquidity trader flips a fair coin. If the informed fraction is π, Bayes' rule makes the first ask (1 + π) / 2 and the first bid (1 - π) / 2. Their difference is exactly π. No fee term appears.

The identity has an address. spread = π is exact only at the half prior in this symmetric binary, unit-trade model. Send an order and the belief moves away from one half. The next spread is recomputed from that new belief and is generally not π. As order flow reveals the value, both quotes tend toward it and the spread tends toward zero.

Depth I · the rent objectionA gap that is not profit

If a spread survives, perhaps the dealer is simply collecting it. The model gives a harder answer. Competition sets each quote to the asset's expected value conditional on the order that reaches it. The dealer loses to informed traders and gains from liquidity traders. Before knowing which arrives, those terms cancel.

Zero-profit audit

Exact at the current quote, then realised across a seeded ensemble.

E[profit | buy]

ask minus E[value | buy]

E[profit | sell]

E[value | sell] minus bid

E[next price]

compare with current public value

Sequential trades

Mean dealer P&L

Terminal midpoint error

starts at an absolute error of one half

Computing the audit…

The realised total on one path can finish positive or negative. Zero expected profit is an ensemble statement, not a promise that every dealer ledger closes at zero. It is also a model assumption motivated by competition, not a measurement of real market makers' earnings.

Depth II · price discoveryThe order speaks before the news

Return to the first instrument and send 24 orders. The public value moves even though no public announcement occurs. Each transaction price is the posterior after its order: the ask after a buy, the bid after a sell. Glosten and Milgrom prove that this transaction price sequence is a martingale relative to public and dealer information. In the instrument, the exact one-step audit reads P(buy) × ask + P(sell) × bid = current value.

A martingale need not sit still. Conditional on the hidden truth, informed orders bias the path toward that truth. Across both possible truths before either is known, the expected next move is zero. That is how the quote can discover information without offering a predictable profit.

Depth III · when the quote disappearsPush until one side closes

The always-trade binary toy above cannot honestly demonstrate a market shutdown for any informed fraction below one. Its liquidity traders trade regardless of price. For breakdown, the paper adds price-sensitive liquidity demand. This separate lab reconstructs its ask-side break-even equation.

Raise this beyond the computed closure threshold to remove the ask quote.
computing

Solving the dealer's break-even equation…

computing…

Here the asset is 1 or 11, the high-value prior is 0.20, and a liquidity buyer's preference multiplier is uniform from 0 to 2. Those are model inputs, not measurements. As α rises, the quote needed to cover informed losses drives away liquidity buyers. Past the live discriminant threshold, no ask makes expected profit zero. This is a partial, buy-side closure in this parameterisation. It is not the same mechanism as the first instrument's shrinking spread.

The check

The live page and the dependency-free Node verifier derive their results from the same conditional probabilities. At the initial 35% setting, the browser recomputes:

initial bid / ask / spreadcomputing exact tree, mean posterior error after 80computing seeded mean P&L / standard errorcomputing elastic-liquidity closure thresholdcomputing

Run node research/the-gap-between-bid-and-ask/verify-the-gap-between-bid-and-ask.mjs. It checks the quote identity over six informed fractions, the zero-profit and martingale equations across 30 non-symmetric states, an exact 80-trade probability tree, a seeded 960,000-trade simulation, and the breakdown quadratic. Any failed assertion exits non-zero.

Model ledger: exactly what each trader does

Primary sources. Lawrence R. Glosten and Paul R. Milgrom, “Bid, Ask and Transaction Prices in a Specialist Market with Heterogeneously Informed Traders,” Journal of Financial Economics 14 (1985), 71–100. Proposition 1 supplies the conditional-expectation quotes; Proposition 2 supplies the transaction-price martingale; section 3 supplies the elastic-liquidity breakdown equation. Lawrence R. Glosten and Lawrence E. Harris, “Estimating the Components of the Bid/Ask Spread,” Journal of Financial Economics 21 (1988), 123–142, empirically separates an asymmetric-information component from a component containing inventory, monopoly, and clearing costs.