← Work
05 / 06LEDGER
COMPILING…

Crank the event rate. Raise volatility. Watch the book reshape and the frame time not move.

A trading terminal that eats fifty thousand events a second.

LEDGER runs a synthetic matching engine on the main thread: a random-walk mid price with volatility regimes, a resting order book of 320 price levels, and a stream of add, cancel, modify, and trade events at a rate you choose, up to a hundred thousand per second. Everything lives in pre-allocated typed arrays; the hot loop allocates nothing, so the garbage collector has nothing to do and frame times stay flat.

The view is a liquidity heatmap: each frame the current book is written as one column into a ring texture on the GPU, and a shader draws the history scrolling left with resting size mapped to brightness. Candles, trades, and the mid line are instanced geometry on top. The ladder on the right is the live book.

This is the pattern I use for real terminals: binary in, typed arrays in the middle, one buffer upload per frame out. No DOM in the data path.

>
↑↓ navigate↵ run/ opens this