Where you are. You have built the book. It only works if orders are resting in it, and resting an order means promising to trade at a price you named while everyone else keeps their freedom to choose. This lesson is about the people who make that promise on both sides at once, all day, and what they are actually being paid for.
Quoting both sides of something you have no opinion about
You will buy at 99.90 and sell at 100.10. You have no view on whether the price is going up or down; you simply want to be the one everybody trades against.
Somebody sells to you at 99.90. Somebody else buys from you at 100.10. You are flat again and twenty pence better off, and you did not need to be right about anything.
Do that a thousand times a day and it is a business. Do it on the wrong day and it is a catastrophe, and the difference between those two days is the whole subject of this lesson.
The idea in one paragraph
A market maker quotes a price to buy and a price to sell simultaneously, and earns the gap between them. That gap is not free money for a service rendered; it is compensation for two specific risks. The first is inventory: the maker ends up holding whatever the market is selling, and the price can move against that holding before it can be laid off. The second is sharper and less intuitive: some of the people trading against the quote know something the maker does not, and those trades are systematically the losing side. A maker who quotes too tight collects a thin spread on ordinary flow and still pays in full when informed flow arrives, so the spread has a floor set not by competition but by how badly the maker expects to be picked off. That is adverse selection, and it is the reason spreads widen exactly when markets get frightening.
Balanced flow: the business as advertised
Run forty trades where buyers and sellers alternate and the mid price does not move. Every trade earns the maker half the spread against the mid, the inventory returns to flat after each pair, and the profit is simply the number of fills times the half-spread.
That is the picture in the brochure: a toll collected on flow, with no view taken and no position held for long.
Informed flow: the business as it can actually go
Now run forty trades where every one is a buy, and the mid drifts up as they arrive - because the buying is happening for a reason the maker cannot see.
The maker sells at the ask every time, so it is short more with every fill. Each individual trade looked profitable at the moment it happened: sold above the mid, as designed. But the mid keeps moving away, so the accumulating short position loses more than the spread ever collected.
Why spreads widen when you least want them to
Put the two risks together and the maker’s behaviour in a crisis becomes obvious rather than cynical. When prices are moving violently, inventory risk is higher because the position moves further before it can be laid off, and adverse selection is higher because the proportion of people trading for a reason goes up.
So the maker widens. Trading costs everyone else more at exactly the moment they most want to trade, and in the extreme the maker stops quoting altogether, which is what “the market seized up” means in mechanical terms. Nobody withdrew liquidity out of malice; the price of providing it exceeded what anyone would pay.
Check yourself
1. A maker quotes both sides and takes no view on direction. Where does its profit come from, and what is it compensation for?
From the spread: buying below the mid and selling above it. It compensates for inventory risk, the chance the price moves against whatever the maker is left holding, and for adverse selection, the chance the person trading against the quote knows something the maker does not.
2. In the losing run, every trade was profitable when executed. So where exactly did the money go?
Into the position that accumulated. Each fill sold above the mid, but the mid then moved away, so the growing short lost more than the collected spread. The loss is a property of the sequence and its correlation with the price move, not of any individual trade, which is why it cannot be found by auditing trades one at a time.
3. Why can a maker not simply quote a very tight spread and win all the flow?
Because the spread has to cover the informed trades, not just the average one. A tight quote collects less on ordinary flow while paying just as much when somebody who knows more trades against it. Competition pushes spreads down only to the floor set by adverse selection; below that, winning more flow means losing more money.
4. Explain “the market seized up” in terms of this lesson’s two risks.
Both rose at once: prices moving fast made inventory more dangerous to hold, and a higher proportion of informed trading made every fill more likely to be a losing one. Makers widened to compensate and eventually stopped quoting, because the price of providing liquidity exceeded what anyone would pay for it. No malice is required for the mechanism to produce that outcome.
Do this
Run the same maker through both regimes and watch the second one take the money back.
python3 code/market_maker.py
The starter leaves you the quoting-and-fill step: quote the mid plus and minus the half-spread, and when the customer buys, the maker sells at the ask - cash up, inventory down - and the reverse when the customer sells. The assertions check that balanced flow leaves the maker flat with exactly the half-spread earned per fill, that one-way flow leaves it short by the number of fills, and that its profit is negative. Success prints both regimes and the line:
the spread is not free money: it is payment for taking the other side, and it is a loss whenever the other side knows more
The completed version is in solutions/market_maker.py.
What you can now do. You can explain the spread as the price of two specific risks, and say why it widens in a crisis without reaching for anybody’s motives. That completes the machinery of a market: instruments, prices, a book and someone standing in the middle. The rest of the module is the cast who use it, starting with the largest pools of money in the world.