v0.2.0 — 2026-08-17
common.h grew into the vocabulary a live exchange feed needs. Every record
changed layout, so consumers must be rebuilt together.
- Event and receive time are separate.
orderandtradecarryevent_ns(exchange event time) and a trailingrecv_nsstamped on receipt;book'stime_nsis renamedevent_nsand gainsrecv_ns. Feed latency is now measurable end to end.recv_nsis appended last, so every earlier offset is unchanged. - Quantities are fixed point in
1/qty_scale(1e-8) units — crypto quantities are fractional — andprice_scalegrows to 1e10. The pair covers Kraken's maximum 10 price and 8 lot decimals. order_actiongainsmodifyandclear.modifysets a new remaining quantity and keeps queue priority while the price is unchanged;cleardrops an instrument's resting orders ahead of a snapshot replay.cancelnow means the order leaves the book outright — a partial cancel arrives asmodify.nlib::metrics, a 120-byte sample of a book pipeline's health: cumulative feed, book, and writer counters, the timed-apply latency accumulators, and instantaneous book gauges. Published unframed on a monitoring socket;nqbook's metrics thread is the producer.- Wire sizes are asserted (
order72,trade64,book344,metrics120), so a layout change fails the build rather than the peer. map::capacity()exposes the allocated slot count, letting a consumer account the table's memory — onevalue_typeplus one control byte per slot — without reaching into the layout.
Comments
Sign in to join the discussion.
No comments yet. Be the first.