Implement snapshot_delay support in marketdata config - #46
Merged
Conversation
cryptomeria-ingest v0.0.22 added snapshot_delay to DataSourceConfig (ADR-026) to support Bitstamp delta-buffering snapshot merge (CCXT Pro pattern). This field was missing from to_data_source(), causing an E0063 compile error. Add snapshot_delay: usize to InstrumentConfig with a serde default of 6 (mirroring the ingest library's default_snapshot_delay). Set to 0 to disable delta buffering. Forward the field in to_data_source(). - src/config.rs: add default_snapshot_delay() helper, snapshot_delay field, manual Default impl, forwarding, and 3 TDD unit tests - config.toml.example: document snapshot_delay in OKX/Kraken/Bitstamp sections - AGENTS.md: update per-instrument fields list - README.md: add snapshot_delay to config example - docs/adr/Integration/ADR-015: document the decision
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.
Implement snapshot_delay support in marketdata config
cryptomeria-ingestv0.0.22 added asnapshot_delayfield to itsDataSourceConfig(per ADR-026— Bitstamp delta-buffering with snapshot merge, CCXT Pro pattern). This field
controls how many diff-order-book deltas to buffer before fetching a REST
snapshot (default 6; set to 0 to disable).
The marketdata project's
to_data_source()was constructing aDataSourceConfigliteral without this field, causing a hard compile error (E0063). This PR adds
snapshot_delayas an instrument-level config field onInstrumentConfig,forwards it in
to_data_source(), and includes full TDD test coverage.Changes
src/config.rs: Addeddefault_snapshot_delay() -> usize { 6 }helper;added
snapshot_delay: usizefield toInstrumentConfigwith#[serde(default = "default_snapshot_delay")]; replaced derivedDefaultwith a manual impl to keep the serde and Rust defaults consistent (both 6);
forwarded the field in
to_data_source(); added 3 unit tests.config.toml.example: Documentedsnapshot_delayin the OKX, Kraken, andcommented-out Bitstamp instrument sections.
AGENTS.md: Updated the per-instrument fields list to includesnapshot_delay.README.md: Addedsnapshot_delayto the config example.docs/adr/Integration/ADR-015: New ADR documenting the decision.Verification
cargo check— OKcargo test— 79 passed, 0 failed (77 lib + 2 binary, including 3 newsnapshot_delaytests)cargo clippy --all-targets -- -W warnings— cleancargo fmt --check— cleanFixes #45