fivenines
1/39

Theory Tutorial

What a stock exchange actually does

Time
5m
Level
not specified
Artifacts
theory + practice
Progress0%
Lesson 0.1

What a stock exchange actually does

The four jobs every exchange performs, and the one-sentence version of each.

A conventional backend accepts requests and returns responses. An exchange adds a deterministic decision point and a feedback loop: published prices cause the next wave of orders.

The obvious shortcut is to treat the venue as a matching algorithm behind an API, then bolt reporting and settlement onto whatever rows the matcher happens to write. Yet accepted commands enter one ordered decision path, and every execution produces mutually consistent facts for the trader, the market, and post-trade processing.

Strip away the regulation, the co-location halls, and the ticker tape, and an exchange is a machine with four jobs:

  1. Take orders in. Accept instructions to buy or sell — safely, fairly, and only from people allowed to trade.
  2. Match them. Pair willing buyers with willing sellers according to published, deterministic rules.
  3. Tell everyone what happened. Broadcast prices, quotes, and trades to the entire market at once — market data is the exchange's most consumed product.
  4. Make the trade real. After the match, move the money and the shares: clearing and settlement.
flowchart LR
    T["Traders"] -- orders --> IN["1 · Order intake"]
    IN --> M["2 · Matching"]
    M -- prices and trades --> MD["3 · Market data"]
    MD -- broadcast --> T
    M -- executed trades --> PT["4 · Clearing and settlement"]
    PT -- cash and shares move --> T
    
The core loop. Orders flow in, matches flow out as public market data, and executed trades flow into post-trade processing. Everything you build in this course elaborates one of these four boxes.

Notice the loop: market data feeds back into traders' decisions, which produce more orders. This feedback loop is why latency fairness matters — if some participants see prices before others, they can systematically pick off the slow. It is also why market data and matching must never disagree.

Suppose matching succeeds while a retail feed is unavailable. If the matcher waits for that consumer, trading stops; if reporting reconstructs the trade later from a different source, the public and private histories can disagree. The four jobs therefore share facts, not availability fate.

An exchange = intake + matching + market data + post-trade. Market data is a product, not a byproduct — and it must be released fairly.

Next step

See what actually stuck.

Take the practice scenarios now.