Open
Conversation
Introduces the edge feed parser package with a pluggable Parser interface, a registry for wiring parsers by name, and the first implementation: a decoder for the DoubleZero Top-of-Book feed v0.1.0 wire format. The parser is stateful: it holds instrument definitions from refdata messages and uses them to decode quote/trade messages in marketdata messages. Marketdata messages arriving before their instrument definition are held in a bounded per-instrument buffer (maxBufferedInstruments = 1000, most-recent-wins) and flushed the moment the definition lands, so a cold-start reader still produces meaningful output at the first refdata cycle. The wire decoder in topofbook_wire.go is a straightforward positional reader over the fixed-layout little-endian format: header validates magic bytes and frame length; each app message dispatches on msg_type to one of seven body decoders; unknown types are skipped rather than erroring. A sticky-error wireReader helper keeps the decoder free of intermediate error checks. The parser is intentionally decoupled from output — it emits generic Record values that a separate sink layer (landed in a follow-up PR) consumes.
This was referenced Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
edgepackage with a pluggableParserinterface, a parser registry, and the first implementation: a decoder for the DoubleZero Top-of-Book feed v0.1.0 wire format.Part 1 of 4 — edge feed parser stack
Each PR compiles and tests standalone. Feature is off-by-default until PR 3 lands; early PRs are dormant code.
Testing Verification
Size note
~1000 lines of production code, above doublezero's ~500-line guideline. The stack already splits the feature into 4 PRs; the parser itself doesn't subdivide further without creating non-functional intermediate states. Bulk of the diff is the wire decoder (~340 LOC, straight-line positional reads) and the parser state machine (~600 LOC), both of which benefit from being reviewed together.