← Back
Home › Systems › Finance and trading

exchange

exchange order matching engine

Nasdaq, LMAX

SystemTechniques · 6Primitives · 39 exchange Clock synchronizationdistributed · medium: Estimate a clock's offset from four timestamps, filter out queueing noise, and steer the clock smoothly; NTP gets about a millisecond, PTP with hardware timestamps under a microsecond.›Raftdistributed · medium: Leader-based consensus on a replicated log; one leader per term, majority commit; the default for a strongly consistent replicated state machine.›Call auction clearingfinance · medium: Uniform-price call auction: aggregate supply/demand curves and find the clearing price and volumeMatching enginefinance · medium: Single-threaded, deterministic loop that journals sequenced orders, matches them by price-time priority against a limit order book and emits trades.›Total order sequencerfinance · medium: Single sequencer stamps every inbound message so replicated deterministic state machines (LMAX style) replay identicallyState-machine snapshotsdistributed · medium: Periodically save the state a log has produced at index i so the log prefix can be deleted; recovery and catch-up become load snapshot plus replay suffix.›Write-ahead logstorage · low: Append each change to a checksummed sequential log and fsync it before touching data pages; the basis of crash durability in nearly every database.›Limit order bookfinance · low: Per-symbol store of resting orders as FIFO queues per price level; array-indexed ticks plus intrusive lists give O(1) add, cancel and best-price lookup.›Money representationfinance · low: Store money as integer minor units with an explicit currency exponent, compute in wider integers, and round once with a named rounding mode.›Low-latency hot pathfinance · low: Rules for microsecond trading paths: one pinned busy-polling thread per stage, no allocation, syscalls, locks or page faults after startup, kernel-bypass I/O, and measured tails.›IP multicastnetworking · low: Send each datagram once to a class D group address; the network copies it to every joined receiver, and sequence numbers let receivers find loss.›SPSC ring bufferdata-structures · low: Bounded wait-free queue for exactly one producer and one consumer thread, built from an array and two indices with acquire/release ordering.›Event sourcingfinance · low: Persist state changes as an append-only stream of immutable events per entity; current state is a fold over them, guarded by expected-version appends.›FIX protocol (session layer)finance · low: Tag=value order-entry protocol over TCP with per-direction sequence numbers, heartbeats and resend so sessions survive disconnects without losing or duplicating orders.›Pre-trade risk checksfinance · low: Constant-time gate in front of order entry that rejects fat-finger, over-limit and runaway orders using worst-case exposure counted over open orders.›Kernel-bypass networkingnetworking · low: User space (DPDK, AF_XDP) or an in-driver eBPF hook (XDP) handles packets straight from NIC rings, skipping sockets, for 10-40 Mpps per core.›Sequenced multicast feednetworking · low: Exchange order-by-order data as fixed binary messages in sequenced UDP multicast packetsZero-copy serializationnetworking · low: Wire formats laid out like in-memory structs (FlatBuffers, Cap'n Proto, SBE, rkyv) so readers access fields in place with no decode pass or allocation.›Arena allocatorsystems · low: Allocate by bumping a pointer through big chunks and free everything at once: a few instructions per allocation for objects sharing a lifetime.›PID controllerrobotics · low: Drive a measured value to a setpoint with three terms on the error: proportional, integral, derivative. The default feedback loop for motors, heaters, drones and gimbals.›Phase-locked loop (digital)signal-processing · low: Feedback loop that locks a local oscillator to the phase and frequency of an input tone; the core of carrier recovery, clock recovery and GNSS tracking.›Robust statisticsstatistics · low: Location and scale estimates (median, MAD, trimmed mean, Huber M-estimator) that stay correct when a minority of the data is garbage.›+ 23 more primitives

Similar systems

Share the most building blocks with this one.

In-house systems

Named systems of this kind at large companies, with their paper or write-up.