Skip to content
zhou.
NowQuant Book (NQBook)

Book Release Note v0.4.0

zhouzhouzhouzhouNowQuant Book (NQBook)27 Aug 2026

v0.4.0 — 2026-08-23

The service stopped hard-coding its own shape: the tunables moved to a config file, the pipeline split one file per stage, and the book learned to run on an L2 feed.

  • config/config.yaml holds every tunable — both endpoints, the output directory, the two queue capacities, the batch size, the snapshot interval, and the metrics sample interval. nq::Config carries the defaults, so a key left out of the file keeps working and a malformed file stops the process at startup rather than halfway through a run. NQBOOK_CONFIG names another file; the command line and the two endpoint variables still override it. Parsing is fkYAML, one MIT header vendored under third_party/, so the dev image needs no YAML package.
  • --l2 runs the book on aggregated depth. The feed stage accepts nlib::level records and drops order flow, Orderbook::OnLevel() writes a level's absolute quantity into an aggregate nlib::price_level, and a quantity of 0 or less erases the level. Snapshots and Parquet output work the same in either mode. uv run feed_sim.py --l2 in util publishes a matching feed.
  • One file per stage. Pipeline.h and Metrics.h are gone; each stage now owns a header and a source under Threads/, holding its own queue type and contract. src/ mirrors that layout.
  • nq::ParquetWriter is a class, not code inside the writer thread. Every Arrow and Parquet call of the service lives in one file; WriterThread only moves records into it and closes it on shutdown. A fourth file, levels, joins orders, trades, and books.
  • The framing moved to nlib. The tag bytes, the feed_event and record variants, and the price_level node were declared here and are now declared once in <nlib/common.h>, so publisher and receiver read the same constants.
  • The nlib submodule moved to third_party/nlib, next to fkYAML. Existing clones need git submodule sync && git submodule update --init once; until that runs, add_subdirectory(third_party/nlib) fails to configure.
  • nlib bumped to 4fc74f1 for nlib::level, the framing, the variants, and nlib::price_level. nlib::metrics grows from 120 to 136 bytes with feed_levels and writer_levels, so the dashboard and the service must be updated together.
  • The dashboard tracks both new counters, tiling level rates beside the order and trade rates.

Comments

Sign in to join the discussion.

No comments yet. Be the first.