v0.4.0 — 2026-08-23
common.h became the whole vocabulary of the feed path: L2 records, the
framing, the variants, and the book node. metrics grows from 120 to 136
bytes, so every consumer must be rebuilt together.
nlib::level, the L2 record, 48 bytes.qtyis the total resting quantity atprice, absolute rather than a delta, so a repeated record changes nothing andqty <= 0removes the level. A feed that publishes aggregated depth needs no order flow to drive a book.- The framing moved into the header.
order_tag(0),trade_tag(1), andlevel_tag(2) are declared here, so a publisher and a receiver read the same constants instead of each writing their own. feed_eventandrecord.feed_eventis the variant overorder,trade, andlevel— one record as a feed delivers it.recordaddsbook, for a pipeline that stores its own snapshots.overloadedbuilds thestd::visitoverload set over either, so a consumer passes one lambda per alternative.nlib::price_level, the node a book builds from these records: the total quantity at one price plus the head and tail of its FIFO order queue. An order-backed (L3) level links its orders through theirprev/nexthooks and sums their quantities; an aggregate (L2) level keepshead == nullptrand takesqtystraight from the feed. Every book in the stack was writing this struct itself.metricscounts levels.feed_levelsandwriter_levelsjoin the feed and writer counters, which moves every later offset and takes the record from 120 to 136 bytes. Thesizeofassert catches a stale consumer at compile time.common_test.cppcovers the tags, both variants,overloaded, and theprice_leveldefaults, socommon.hnow has a test binary like every container.
v0.3.0 — 2026-08-22
order carries the quantity an action means in its own field. order grows
from 72 to 88 bytes, so every consumer must be rebuilt together.
cancel_qtyandnew_qty. Acancelputs the quantity leaving the book incancel_qty, amodifyputs the new remaining quantity innew_qty(<= 0removes the order); both are 0 for the actions that do not use them.qtykeeps one meaning — the resting quantity on anadd— so a consumer no longer reads one field againstactionto learn what it holds.cancelis no longer all-or-nothing. It shrinks the resting order bycancel_qtyand the order leaves only when nothing remains, which is what a feed reporting one quantity per event actually sends. A full cancel is the case wherecancel_qtyis the whole remainder.- Both fields are inserted before
event_ns, not appended, so every offset fromevent_nson has moved. Thesizeofasserts catch a stale consumer at compile time.
Comments
Sign in to join the discussion.
No comments yet. Be the first.