Trade
The engine

How Strobe works

The engine

The books, the risk check, the journal and how ack time is measured.

The engine runs one order book per market (SOL-PERP, BTC-PERP, ETH-PERP) in memory. It takes signed actions over the WebSocket, applies them one at a time and answers each with an ack or a reject.

Matching

Each book is a central limit order book in price-time priority. A buy matches the lowest ask first, and among orders at one price the one that rested first fills first. A limit order that doesn't fill in full rests at its price, unless its time in force says otherwise (Orders).

Before an order touches the book, the engine checks that the account's free margin covers the order's initial margin. An order that fails the check is rejected and nothing on the book moves. Because margin is cross, the check uses the whole account: every position and resting order in every market.

Ack time

The engine measures each order from the moment it receives it to the moment it sends the ack, in microseconds. Every ack carries its own figure, every trade on the tape carries the figure of the taker order that made it, and the latency feed publishes the p50 and p99 over a recent window, which is what the site shows.

The figure covers the engine's own work. Time on the network between your browser and the engine comes on top of it.

The journal

The engine writes every accepted action to a journal before acknowledging it. On a restart it replays the journal and arrives at the same state, with the same state hash, as before it stopped. The state hash is what each settlement batch posts to the program.

The house market maker

A separate process quotes every book around the index price with a small spread, so the first trader on a book always has something to fill against. It signs and sends its orders through the same public API as any trader and has no other access to the engine.