KAI Terminal · Engineering
Building a real-time options-trading platform
Notes on the architecture and the calls behind KAI Terminal — a multi-broker desk for Indian index options with an automated risk engine. We share the design and the trade-offs, not the trading edge.
The environment KAI Terminal gets built in
One git repo, one bootstrap script, and a single idea carried through every layer: vim motions everywhere. A tour of the terminal, shell, multiplexer, and editor setup behind the product — now open source.
A trading risk engine as a pure function
How KAI Terminal's automated risk engine stays correct under fire: all the decisions live in a pure, deterministic function, and the I/O stays dumb. A functional core, imperative shell story.
Redis pub/sub as a tick bus — and when not to
Why KAI Terminal moves live market ticks over Redis pub/sub instead of a bespoke in-process channel, the latency reasoning behind it, and the trade-off that comes with it.
A multi-broker abstraction the engine never sees
How KAI Terminal connects to multiple brokers without letting a single broker name leak into the risk engine — capability-based interfaces, a dependency sink, and registries keyed by broker type.