Skip to content

Latency analysis

Each step of a trade, in the order it happens. Tiles show the median and p99 of the selected hour or day; click one to chart it.

Mon, Sep 28, 03:00 PM

Quoting

Our maker orders: from a change in the book to Kalshi confirming our order.

Hedging

Once our maker is filled: covering it with an IOC in the other book.

Maker fill → hedge fill

Both timestamps from Kalshi, one clock: the time the market had to move against us before the hedge matched.

Finer detail · stages inside each step

For diagnosing a slow step. Totals contain the stages listed with them: do not add them up. Click a row to chart it.

Inside the engine

Stagemedianp99maxn
Waiting to be read · Update in our kernel → the engine reads it.————
Parse · Read → message parsed.————
Decide · Parsed → decision taken.————
Read → decide, no order · Updates that led to no order: read → decision.————
Build the order · Decision → order ready.————
Write · Order ready → write returned (includes TLS encryption).————
Write → leaves the kernel · Can be negative: the kernel may send before write returns.————
Engine reacts, REST mode · Kernel RX → kernel TX. Only measured until 24-sep, when orders went through REST.————
Delta → order, REST mode · Kalshi’s delta timestamp → kernel TX. Only measured until 24-sep (REST).————
Engine total · Read → write returned.————
TLS decrypt · Inside “waiting to be read”.————
TLS encrypt · Inside “write”.————
Between reactor turns · Can include idle time.————

Order path through the sidecar

Stagemedianp99maxn
Handed to FIX → live at Kalshi · The order is handed to the FIX thread → Kalshi’s TransactTime on its final report. Kalshi’s clock has ms resolution and the offset between clocks is only estimated (±1.3 ms seen): indicative, not exact.————
Engine → Kalshi’s answer · Engine update → the sidecar has Kalshi’s answer.————
Waiting to send · Sidecar receives the order → sends it.————
Dispatch · Received from the engine → dispatched.————
Lane queue · Dispatched → enters its connection lane.————
Socket write · Write start → write returned.————
Network + Kalshi · Request leaves our kernel → answer reaches it.————
Request → answer · As measured by the sidecar’s transport.————
Wake-up · Answer in the kernel → sidecar awake.————
Read the answer · Awake → answer parsed.————
Apply · Answer parsed → applied.————
Sidecar total · Sidecar receives the order → result.————

Relay

Stagemedianp99maxn
Fill → IOC confirmed · The relay receives the fill → Kalshi confirms the IOC (“relay reacts” + “Kalshi confirms the IOC”).————

Read from Ohio’s logs every few seconds and kept 7 days. Percentiles are nearest-rank over histograms whose bins keep every value within 0.4%; min, max, mean and counts are exact; std and skew are estimated from the same bins. Lines join consecutive buckets: a stretch without trading is a straight segment, not zero.