Pro Desk

Market Microstructure: How Prices Actually Form

A price is the output of a queue, an auction and a set of dealers pricing the risk that you know something they do not. Here is the machinery underneath the last trade.

AI-assisted, reviewed and edited by John James. How we use AI

8 min read

Your order does not go where you think it goes, and it does not get the price you think it gets. You clicked at 50.04. You paid 50.052 on average, the print that everyone else saw was 50.06, and the quote you clicked on had been gone for a hundred milliseconds before your broker’s router made a decision on your behalf. Nothing about that is a scandal. It is arithmetic, and the arithmetic is the subject here.

Start with how an order reaches an exchange and who is quoting the other side of it if either is unfamiliar. This guide picks up where they stop.

There is no price, there is a book

A stock does not have a price at any instant. It has two queues. One is a stack of resting bids sorted high to low, the other a stack of offers sorted low to high, and within each price level the orders sit in the sequence they arrived. The top of each stack is what your screen calls the quote.

A market order does not find a price. It eats the book until it is full.

Say 400 shares rest at 50.04 and 900 more at 50.06. Your market order for 1,000 takes all 400 at the first level and 600 at the second. Your average is (400 x 50.04 + 600 x 50.06) / 1,000 = 50.052. The last print, the one that becomes the price on every screen in the world, is 50.06, so you moved the market two cents on your way in and paid for the privilege of doing it.

Retail platforms show you the top of the book. Your cost is decided by the part underneath it.

Queue position is an asset

US exchanges work on price then time priority. Beat the best price and you jump to the front. Match it and you join the back of whatever is already there.

This matters more than it sounds. An order at the front of a 50,000 share queue gets filled. An order at the back of the same queue usually watches the price walk away without it, which is why a passive limit order that “should have filled” did not. You were in the line, just nowhere near the front of it.

So there is a reward for displaying and there are reasons to hide. Iceberg orders show a slice and reload. Midpoint pegs sit between the quotes and never display. Dark venues keep the interest off the tape until a match happens. The visible book therefore understates real liquidity in large caps, and it can flatter liquidity in thin names, where one participant quotes the same 300 shares on five venues at once and you count 1,500.

Reg NMS ties the venues together through the national best bid and offer, and no venue may trade through a better protected quote elsewhere. What that means for you is simple. Your broker’s routing decision picks which queue you stand in, and you do not make it. The dark pools and Reg NMS guide covers who is paying whom for that decision.

What the spread is charging you for

A quoted spread has to cover three separate costs before the person quoting it makes anything.

Component What it pays for When it takes over
Order processing Exchange fees, clearing, technology, capital Cheap names with little volume
Inventory The risk of holding something unwanted until it can be unwound Illiquid names, overnight, month end
Adverse selection Losses to counterparties who know more than the quoter Earnings, unscheduled news, index changes

In a heavily traded large cap the first two round to nothing. Adverse selection is the whole spread.

Watch what happens ninety seconds before an earnings release. A penny spread becomes fifteen cents. Nobody’s clearing costs changed in that ninety seconds and nobody bought new hardware; the probability that the next person lifting the offer knows something changed, and the price of standing in front of that person changed with it.

Sit in the dealer’s chair for a minute

You are quoting 50.02 bid for 500, 50.04 offered for 500, all day, in a stock that trades a penny wide, and both sides come to you in roughly equal numbers, so you earn two cents on every round turn. It is a good business.

Then a fund decides to sell 800,000 shares. Its algorithm slices the order and hits your bid. You buy 500. You buy 500 again. The stock keeps sinking, because there are 790,000 shares still behind the ones you already own, and every purchase you made was at a price that will not trade again today.

Your defenses are the obvious ones. Widen the quote. Show less size. Skew the bid lower as inventory builds. Stop quoting entirely when you cannot estimate what the flow knows.

All four look identical from a retail screen, where the market gets thin at exactly the moment you want to trade, and what you are watching there is the same phenomenon seen from the side that is losing.

It also explains payment for order flow. Retail orders are, on average, less informed than the 800,000 share seller, and a wholesaler pays for that flow precisely because it carries less adverse selection, which lets it fill you inside the public quote and still clear a profit on the other side. You get price improvement and the wholesaler gets a benign counterparty. Both halves of that are true at once.

Measure your own fills or stop having opinions about execution

Three numbers, computed from data your broker already gives you.

Effective spread is 2 x |fill price - midpoint at arrival|. You buy 1,000 shares at 50.04 when the quote was 50.02 by 50.04, so the midpoint was 50.03 and your effective spread is 2 x 0.01 = $0.02. One cent a share one way, $10 on the trade.

Realized spread asks what the dealer kept. Take the midpoint five minutes later, call it 50.045, and compute 2 x (50.04 - 50.045) = -$0.01. The dealer lost money on you. The price kept moving your way after the fill, which is the fingerprint of informed flow. Consistently negative realized spreads mean somebody is paying for the information in your orders.

Implementation shortfall compares your average fill to the price when you decided. Decide at 50.00, fill at an average of 50.06, and you gave up six cents a share to impact, delay and whatever the stock was going to do anyway, which makes it the only one of the three numbers that charges you for being slow.

The index moves first, then the stocks

For one stock on an ordinary day, discovery happens in the book: somebody informed takes liquidity, the quotes step back, the midpoint resets, and the new level holds because somebody paid real money to establish it.

At the index level the order reverses. E-mini S&P futures trade nearly around the clock with enormous size at the touch, so a macro view lands there first, then in the biggest ETFs, then in the individual names. Futures contract mechanics covers the instrument itself. The point here is sequence. When the cash market opens after an overnight move, it is catching up to a price formed somewhere else while you were asleep.

Options are a third channel and the strangest one, because dealer hedging can move a stock without anybody forming a view about the stock at all. Options flow and dealer gamma is the mechanism. Breadth data is the fast check on which channel a move came through: 480 names up together is index flow, 40 names up is somebody’s opinion.

Liquidity has a shape, and so does its absence

The open and the close are single price call auctions. Orders accumulate, imbalances are published, and everything crosses at the price that maximizes executed volume; the closing auction is the deepest liquidity event of the US equity day, because index funds, benchmark orders and rebalancing flows all target the official close.

So liquidity at 15:59 is cheap, and liquidity at 09:31 is often a mirage, all wide quotes and violent reversion while the overnight imbalance clears. The market hours guide has the schedule. The microstructure point is that the intraday liquidity curve is a predictable U, and trading against the shape of it costs money nobody is compensating you for.

Then there are the halts. Limit up limit down bands and market wide circuit breakers exist to interrupt the loop where a falling price triggers stops, the stops consume the book, and the emptied book lets the price fall further. The behavioural detail is the one to carry with you. As a band is approached, resting liquidity is pulled, because nobody wants to be the last quote standing into a halt, and the book is therefore thinnest at the exact moment your stop is most likely to trigger. That is how a stop ten percent away fills thirty percent away. Order types explains the instrument. Microstructure explains why the instrument fails worst when you need it.

What this knowledge is actually worth

Not a strategy. Microstructure edges decay faster than anything else in markets, and the people harvesting them spend tens of millions to sit closer to the matching engine than you ever will. Reading about queue dynamics does not put you in the queue.

What it buys you is an execution policy, and that is worth real basis points. Use limit orders in anything thin. Avoid the first and last few minutes unless you specifically want auction liquidity. Size against displayed depth. Pull your fills once a month, compare them to the arrival midpoint, and keep the number where you can see it.

Anyone running a momentum book or a mean reversion book has a gross edge per trade small enough that execution decides whether the strategy exists at all. Test what stuck with the market microstructure quiz, then read short selling for the part of the plumbing that runs on borrowed stock.

Frequently asked questions

What is market microstructure?

Market microstructure is the study of how trading rules, order types and dealer behaviour turn buying and selling interest into an actual printed price. It covers the limit order book, the bid ask spread and its components, how orders are routed between venues, and how information gets into prices. It is the layer between your decision to trade and the number that appears on your fill.

What is adverse selection in trading?

Adverse selection is the risk a liquidity provider takes that the person hitting their quote knows something they do not. If a market maker buys at the bid all morning and the stock then drops on news, every one of those purchases was a loss. Quoted spreads widen to compensate for that risk, which is why spreads blow out before earnings and around unscheduled announcements.

Why does the bid ask spread exist?

A quoted spread pays for three things at once: the operational cost of running a quoting business, the inventory risk of holding a position the dealer did not want, and the adverse selection cost of trading against better informed counterparties. In liquid large caps the first two are close to negligible and adverse selection dominates. That is why spreads track uncertainty rather than trading volume alone.

What is the difference between quoted and effective spread?

The quoted spread is the difference between the best bid and best offer on the screen. The effective spread is twice the distance between your fill price and the midpoint at the time your order arrived, so it measures what you actually paid rather than what was advertised. Effective spread is often narrower than quoted for small orders that get price improvement, and much wider for large orders that walk the book.

Does microstructure matter for long term investors?

It matters at the moment of trading and rarely after that. A buy and hold investor who trades twice a year gives up a few basis points to the spread and will never notice it against years of returns. It matters a great deal for anyone trading frequently, trading illiquid names, or running a strategy whose expected edge per trade is measured in single digit basis points.

What is price discovery?

Price discovery is the process by which scattered private information and opinion get aggregated into one number. It happens through trading: informed participants take liquidity, quotes move away from them, and the price settles at a new level. In US equities a large share of price discovery for index names happens in the futures market first, with the cash market following.