fivenines
33/39
Lesson 4.1

Latency is a fairness property

What you'll learn

Why an exchange cares about microseconds when its users take milliseconds to blink — and the precise boundary (wire-to-wire) at which latency becomes the exchange's problem.

Building on

Lesson 0.1's feedback loop — market data drives orders — and its warning that unequal information timing lets the fast pick off the slow. That warning is this lesson's subject.

Start with who actually pays for latency: the market maker, whose resting quotes (1.3) are standing offers to trade at stated prices. When news moves the fair price, every microsecond until their cancel (2.7 made cancels sacred for exactly this reason) is a window in which anyone faster can hit their now-stale quote — a guaranteed loss called adverse selection. Market makers are not charities: they price that window into their spreads. Exchange latency is therefore a tax on every trade, paid by everyone, collected by no one — and latency variance is a heavier tax than latency itself, because a spread must price the worst plausible window, not the average one.

Before optimizing anything, fix the boundary of accountability:

flowchart LR
    subgraph EX["The exchange's accountability window — wire to wire"]
        W1["WIRE IN: first bit of the order crosses the exchange's edge"] --> ALL["gateway → sequencer → journal quorum → engine → publisher"]
        ALL --> W2["WIRE OUT: first bit of the ack / market data leaves"]
    end
    TRIN["Trader's stack and network — their problem, their investment"] --> W1
    W2 --> TROUT["Delivery back across the world — their problem again"]
    
Wire-to-wire: the only latency the exchange fully controls, and the only number comparable across participants. Everything inside must be measured (4.2), budgeted (4.3–4.4), and — crucially — equalized across participants (4.6).

The three rungs of the ladder, with their honest constituencies:

RungWire-to-wire p99Who it servesWhat dominates the budget
Millisecond~5 msRetail and global venues — users are 10–200 ms away over WAN anywayArchitecture: hops, protocol cost, the cross-zone quorum (3.2)
Sub-millisecond~500 µsInstitutional flow, regional venuesThe operating system: kernel crossings, scheduling, copies (4.4)
Colo~50 µsVenues whose participants rack servers in the same hallPhysics and jitter: cache misses, interrupts, the speed of light in fiber (4.4–4.5)

Notice what the ladder does not promise: that faster is always better. Each rung serves a real market; a global crypto venue at 50 µs would be spending fortunes to shave a number its WAN-distant users cannot perceive and its fairness does not require. As with the nines (3.1), the discipline is choosing the rung your contract needs — 4.7 closes the part on exactly that judgment.

Key ideas
  • Latency is priced into every spread; variance is priced at its worst case.
  • Wire-to-wire is the exchange's accountability window — measure and equalize there.
  • Three rungs, three constituencies; pick the one your contract needs, like the nines.
Next step

See what actually stuck.

Take the practice scenarios now.