Zerodha HLD: The Matching Engine at the Heart of a Stock Exchange
A stock exchange system design (Zerodha): a limit order book with price-time priority, the matching algorithm, an in-memory engine kept durable by a journal, and correctness over availability.
"Design Zerodha" — or any stock exchange — and the watchlists, charts, and portfolios are a sideshow. The heart is one component that must be fast, exactly correct, and perfectly fair all at once: the matching engine. It takes a stream of buy and sell orders and pairs them off by strict rules, in microseconds, with money on every decision. Get the matching wrong and you've mis-filled a trade — a real financial loss and a regulatory incident. So this design is the opposite of the Amazon cart: where the cart chose availability over consistency, an exchange chooses correctness and determinism ove…
What’s inside
Read this one free
Sign in and your first premium article is on us — read Zerodha HLD: The Matching Engine at the Heart of a Stock Exchange free.