v0.23.0 — the multi-symbol gateway
The reference gateway catches up with the core. cmd/obgw was the last thing
standing between the multi-symbol design and a venue anyone can run, and converting
it found the bug that refactor was most likely to hide: buildOrder validated the
incoming symbol and then stamped the configured one onto the order, so at a
two-book venue every order silently landed on the first book. A refactor that
compiles is not a refactor that works.
Added
-
cmd/obgwserves a set of instruments.Config.SymbolsandConfig.DataDir;
one book per symbol — matching goroutine, command log, market-data feed, rate gate
— under a venue-wide account layer: oneRegistry, one publisher, one stream per
account. A client holds one session and sees one ordered conversation whatever mix
it trades, which is what makes a client id enough to name an order without also
naming a symbol.A one-book venue is unchanged: same config fields, same
WALPathand
SnapshotPath, same small dense ids, and the entire existing test suite passes
untouched. -
Mass cancel and
Queryfan across every book and aggregate — an account's orders
are its orders. Readiness takes the worst book, since a venue with one wedged
matcher is not ready however healthy the others are.
Fixed
- Routing a cancel needed the session to remember, not the registry to be asked.
wire.Cancelnames an order byClOrdIDalone, so the gateway must pick a book
without being told which. Resolving the engine order id up front to read its shard
field is the obvious move and it is wrong: the naming index is written by the
matching goroutine, so a cancel arriving while its own Enter is still queued
resolves to nothing and is refused for an order that is about to exist — the
orphaned-order defect SOAK.md measured at 12,843 orders in thirty
seconds. The session already knows: it read the Enter, and the Enter carried the
symbol.
Known limits
- Price gauges do not aggregate across books and report the first one. A last
trade price averaged over two instruments is not a number; the right answer is one
series per symbol, which needs label supportpkg/observabilitydoes not have.
Upgrading: nothing to do for a one-book venue — Config.Symbol, WALPath and SnapshotPath behave exactly as before, and ids are unchanged. For more than one instrument, set Config.Symbols and Config.DataDir.
Full changelog: v0.22.0...v0.23.0