Skip to content

Fix DBN v3 instrument definition layout#22

Merged
tbeason merged 1 commit into
tbeason:mainfrom
dawsh2:fix-v3-instrument-def-symbol-lengths
Jun 1, 2026
Merged

Fix DBN v3 instrument definition layout#22
tbeason merged 1 commit into
tbeason:mainfrom
dawsh2:fix-v3-instrument-def-symbol-lengths

Conversation

@dawsh2

@dawsh2 dawsh2 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Decode and encode DBN v3 InstrumentDefMsg using the fixed binary field layout instead of text encode_order.
  • Use 71-byte DBN v2/v3 symbol fields for raw_symbol and leg_raw_symbol.
  • Align InstrumentClass enum values with Databento DBN values (CALL = 'C', PUT = 'P', STOCK = 'K', etc.).
  • Model v3 leg ratio fields as signed Int32.
  • Add a byte-offset regression test for v3 InstrumentDefMsg layout so round-trip tests do not hide a shared reader/writer layout bug.

Validation

  • julia --project=/Users/daws/repos/DatabentoBinaryEncoding.jl -e 'using Pkg; Pkg.test()' => 3520/3520 passed.
  • Decoded real DBN v3 definition files successfully:
    • option definitions: 5290 records, first raw symbol SPY260618C00390000, class CALL.
    • spot definitions: 1 record, raw symbol SPY, class STOCK.
  • Local record-body parity check against the Databento-maintained DBN implementation: Rust and Julia emitted identical 520-byte v3 InstrumentDefMsg record bytes.

@tbeason
tbeason merged commit d2e6001 into tbeason:main Jun 1, 2026
7 checks passed
@tbeason

tbeason commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants