The Fundamental Problem of Trading
Trading has a timing problem. A seller arrives at 10:02, a buyer at 10:07. Without someone willing to hold inventory in between, neither trades — or both accept a terrible price from whoever happens to be around. The market maker exists to solve this temporal mismatch, and the spread is the price of that service.
An Engineering Lens
Before diving in, a framing device for those who think in systems:
A market is a distributed system for price discovery under adversarial conditions.
The analogy runs deep:
| Market concept | Engineering equivalent |
|---|---|
| Order book | Concurrent ordered data structure |
| Market makers | Servers providing liquidity, managing inventory under uncertainty |
| Price formation | Distributed consensus with private information and adversarial incentives |
| Adverse selection | The Byzantine generals problem of markets |
| Execution algorithms | Optimizers navigating stochastic latency and information leakage |
Keep this mapping in mind. Many microstructure results become intuitive once you see them as distributed-systems problems with economic payoffs.
Core Vocabulary
Five numbers define the state of any quoted market:
- Bid: the highest price at which someone will buy right now
- Ask (offer): the lowest price at which someone will sell right now
- Spread: the gap between them
- Mid: the conventional reference price
- Half-spread: the cost of a single crossing. When you “cross the spread” to buy at the ask, you pay relative to mid. This is the per-side transaction cost.
These definitions are universal — equities, rates, crypto spot, NFT floors. The units and tick sizes vary, but the structure is identical.
The Market Maker as Intermediary
Demsetz (1968) framed the insight cleanly: the spread is not a market imperfection but a price of immediacy. Buyers and sellers demand the option to trade now rather than wait for a natural counterparty. The market maker supplies that option and charges for it.
In modern terms, the market maker runs a service with three properties:
- Always-on quoting — posts bid and ask continuously
- Inventory absorption — takes the other side of every incoming order
- Risk management — adjusts quotes to control accumulated position
If you built credit-scoring systems at Goldman, you already know this pattern: the underwriter takes on risk the market cannot yet absorb and prices a spread to compensate. The market maker does the same thing, just at millisecond cadence.
P&L Model
A first-order approximation of market-maker P&L:
where is the half-spread earned per unit and is volume transacted. The inventory risk cost comes from holding a directional position while the true price moves — we formalize this in ho-stoll-inventory-model.
When flow is balanced (equal buying and selling), the market maker earns the spread cleanly. When flow is one-directional — say, everyone selling after an earnings miss — inventory accumulates and the maker bleeds on the position. The entire theoretical apparatus of microstructure exists to understand when and why flow becomes unbalanced.
Historical Context: From Floor to Fiber
Demsetz’s 1968 paper (“The Cost of Transacting”) was the first to treat the spread as an economic quantity worthy of explanation rather than an institutional artifact. Before that, spreads were viewed as a feature of exchange rules or specialist privileges.
The field then split into two research programs:
- Inventory models (Stoll 1978, Ho & Stoll 1981): the spread compensates for the risk of holding unwanted inventory. See ho-stoll-inventory-model.
- Information models (Glosten & Milgrom 1985, Kyle 1985): the spread protects against traders who know more than you. See glosten-milgrom-model and kyle-lambda.
Huang & Stoll (1997) later unified both perspectives into a single decomposition framework — see spread-decomposition.
But the institutions carrying out market-making transformed just as radically as the theory. That story plays out in three acts.
Act I: The Old World — Floor-Based Markets
Two competing designs dominated the 20th century:
-
NYSE (est. 1792): Auction market with specialists. A single designated specialist per stock maintained a physical order book and managed the auction. The specialist saw all order flow — a massive informational advantage — and had an affirmative obligation to maintain a fair and orderly market.
-
NASDAQ (est. 1971): Dealer market. Multiple competing dealers posted quotes on electronic screens. No single entity saw all flow. Competition between dealers was supposed to keep spreads tight. (It did not always work — see Act II.)
-
LSE: Quote-driven (dealer) until 1997, when the Stock Exchange Electronic Trading Service (SETS) introduced order-book trading for large-caps.
The key distinction — auction markets (centralized matching) vs. dealer markets (bilateral negotiation) — persists today, even though the floor is gone. Modern exchanges are electronic auction markets; OTC bond and FX markets remain largely dealer-driven.
Act II: The Revolution
Three regulatory shocks in a decade reshaped the landscape:
1. The NASDAQ scandal (1994). Christie and Schultz published a paper showing that NASDAQ dealers systematically avoided odd-eighth quotes (e.g., 10.375), maintaining artificially wide spreads of at least $0.25 on heavily traded stocks. The DOJ investigated. Result: the Order Handling Rules (1997), which forced dealers to display customer limit orders and honor better quotes posted on ECNs.
2. Decimalization (2001). The SEC mandated a switch from fractional pricing (minimum tick = 1/8 = 0.01). In distributed-systems terms: reducing the minimum granularity of the priority queue by 12.5x. Dealer profits collapsed. Electronic market-making, which could operate profitably at penny spreads through speed and automation, accelerated.
3. Reg NMS (2005, implemented 2007). Two rules changed everything:
- Order Protection Rule: exchanges must honor the National Best Bid and Offer (NBBO) across all venues. A trade cannot execute at an inferior price if a better quote exists elsewhere.
- Access Rule: caps access fees at $0.003 per share, preventing exchanges from charging prohibitive tolls to reach their quotes.
Reg NMS created the fragmented but interconnected US equity market we have today — 16+ exchanges, dozens of dark pools, all linked by the obligation to respect the NBBO.
Act III: The Modern Landscape
The result of these reforms is a market that looks like this:
┌──────────────────────┐
│ SIP (Consolidated │
│ Tape / NBBO feed) │
└──────────┬───────────┘
│ consolidates
┌───────────┬──────────┼──────────┬───────────┐
│ │ │ │ │
┌────┴───┐ ┌─────┴────┐ ┌──┴───┐ ┌───┴────┐ ┌───┴──────┐
│ NYSE │ │ NASDAQ │ │ Cboe │ │ IEX │ │ Dark │
│ ~22% │ │ ~16% │ │ ~16% │ │ ~3% │ │ Pools │
│ │ │ │ │ │ │ │ │ ~15-40% │
└────────┘ └──────────┘ └──────┘ └────────┘ └──────────┘
The Securities Information Processor (SIP) consolidates quotes from all lit exchanges into a single NBBO — the reference price that triggers Reg NMS protections. Dark pools (off-exchange venues) report trades but not pre-trade quotes, and their share of volume fluctuates between 15% and 40% depending on market conditions.
Who Makes Markets Today
The specialists and floor dealers are gone. Today’s dominant market makers are quantitative technology firms:
- Citadel Securities — handles roughly 25% of US equity volume
- Virtu Financial — publicly traded; famously reported only one losing trading day in six years
- Jane Street — dominant in ETFs and options
- Jump Trading — high-frequency across asset classes
- Major banks (Goldman Sachs, JPMorgan, Morgan Stanley) — still active, especially in less electronic markets (bonds, swaps, FX blocks)
When Goldman “streamed prices on exchanges to meet obligations,” they were likely operating as a Designated Market Maker (DMM) or Supplemental Liquidity Provider (SLP). These roles come with quoting obligations — continuous two-sided quotes within defined spread and size parameters — in exchange for benefits: reduced fees, information advantages (e.g., seeing order imbalances), and sometimes direct payments from the exchange.
From Pit to Protocol
The same economics apply on-chain. A Uniswap LP is a market maker: it posts a bid-ask schedule (the bonding curve), absorbs inventory (token imbalances), and earns a fee (the swap fee replacing the spread). The key difference is that the LP has no ability to update quotes in response to information — which makes adverse selection far more damaging. We return to this throughout the module.
Companion notebook: notebooks/market-microstructure/01-trading-fundamentals.py
— visualize bid-ask dynamics, simulate spread capture under balanced vs.
one-directional flow.
Questions to sit with:
- If the spread is the price of immediacy, what happens to spreads when the cost of waiting drops (e.g., high-frequency communication)?
- A Uniswap pool charges a flat fee regardless of who trades. Under what conditions does this under-price or over-price the actual risk?
- Why might a market maker widen their spread even when volatility has not changed?
- Decimalization reduced the tick size from 0.01. Who benefited? Who lost? What would happen if the tick went to $0.001?
- Reg NMS forces venues to honor the NBBO. What are the second-order effects of linking all venues into a single “distributed order book”? Think about latency arbitrage and the incentive to colocate.
- The engineering analogy frames adverse selection as a Byzantine generals problem. Where does the analogy break down — what can informed traders do that Byzantine nodes cannot?