Skip to content

fix: preserve canonical market timestamp provenance - #443

Merged
proerror77 merged 6 commits into
mainfrom
codex/timestamp-provenance-395
Jul 29, 2026
Merged

proerror77 merged 6 commits into
mainfrom
codex/timestamp-provenance-395

Conversation

@proerror77

Copy link
Copy Markdown
Owner

Change contract

Preserve Binance exchange event time E, trade time T, and local userspace receive time as distinct provenance-bearing canonical values, while retaining the legacy timestamp field only as an ordering and staleness projection.

Closes #395.

Out of scope

Kernel receive timestamps, clock-discipline readiness policy, percentile aggregation and alerting, execution transport, rate admission, live enablement, deployment, and runtime cutover.

Dependency or merge order

Stacked on #438. Merge #438 first, then this PR. Independent of #440. The 26-file canonical schema migration is an atomic exception approved by reviewer Arendt because schema, dual-clock receive capture, constructors, consumers, and legacy API test migration must compile and roll back together.

Focused validation

  • cargo check --workspace
  • cargo test -p hft-integration -p hft-core -p hft-ports -p hft-data-adapter-binance -p hft-engine
  • cargo test -p hft-data-adapter-binance --features json-simd tracked_timestamps_keep_depth_e_trade_e_t_and_local_receive_distinct
  • cargo clippy -p hft-core -p hft-integration -p hft-ports -p hft-data-adapter-binance -p hft-engine -- -D warnings
  • rustfmt --check on all 26 changed Rust files
  • git diff --check
  • compile-fail counterexample proves Trade T cannot be passed to local-E calculation
  • dual read-only fixed-point review: no P0-P3 blocking findings

Rollout and rollback impact

No deployment or live-state change. Canonical serialized events gain serde-defaulted provenance fields. Other venues explicitly retain unknown provenance. Roll back this PR as one unit if a downstream compatibility issue appears; live remains disabled.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@proerror77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fe1dcffa-8123-476d-bd56-fab128126e41

📥 Commits

Reviewing files that changed from the base of the PR and between 51811a5 and 504e84e.

📒 Files selected for processing (39)
  • rust_hft/apps/live/src/runtime_attribution.rs
  • rust_hft/apps/live/tests/deployment_envelope.rs
  • rust_hft/benches/hotpath_latency_p99.rs
  • rust_hft/benches/ultra_components.rs
  • rust_hft/data-pipelines/adapters/adapter-asterdex/src/converter.rs
  • rust_hft/data-pipelines/adapters/adapter-backpack/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-binance-prediction/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-binance/src/converter.rs
  • rust_hft/data-pipelines/adapters/adapter-binance/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-binance/src/message_types.rs
  • rust_hft/data-pipelines/adapters/adapter-bitget/src/bitget_stream.rs
  • rust_hft/data-pipelines/adapters/adapter-bitget/src/zero_copy_stream.rs
  • rust_hft/data-pipelines/adapters/adapter-bybit/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-grvt/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-hyperliquid/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-lighter/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-mock/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-ondo-perps/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-polymarket/src/lib.rs
  • rust_hft/data-pipelines/adapters/adapter-replay/src/lib.rs
  • rust_hft/market-core/core/src/lib.rs
  • rust_hft/market-core/core/src/unified_timestamp.rs
  • rust_hft/market-core/engine/benches/engine_hotpath.rs
  • rust_hft/market-core/engine/benches/hotpath_latency_p99.rs
  • rust_hft/market-core/engine/examples/ultra_performance_demo.rs
  • rust_hft/market-core/engine/src/aggregation.rs
  • rust_hft/market-core/engine/src/dataflow/ingestion.rs
  • rust_hft/market-core/engine/src/dataflow/ingestion_ultra.rs
  • rust_hft/market-core/engine/src/lib.rs
  • rust_hft/market-core/engine/tests/live_hotpath_contract.rs
  • rust_hft/market-core/integration/src/latency.rs
  • rust_hft/market-core/ports/src/events.rs
  • rust_hft/strategy-framework/strategies/arbitrage/src/lib.rs
  • rust_hft/strategy-framework/strategies/formula/src/lib.rs
  • rust_hft/strategy-framework/strategies/imbalance/src/lib.rs
  • rust_hft/strategy-framework/strategies/lob_flow_grid/src/lib.rs
  • rust_hft/strategy-framework/strategy-dl/src/onnx_lob_strategy.rs
  • rust_hft/tests/integration/precision_semantic_test.rs
  • rust_hft/tools/hyperliquid-demo/src/complete_demo.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94b20fa339

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rust_hft/market-core/engine/src/dataflow/ingestion_ultra.rs
Comment thread rust_hft/market-core/ports/src/events.rs
Comment thread rust_hft/data-pipelines/adapters/adapter-binance/src/lib.rs Outdated
Base automatically changed from codex/cex-latency-guideline to main July 29, 2026 11:13
@proerror77
proerror77 merged commit 7aee974 into main Jul 29, 2026
38 checks passed
@proerror77
proerror77 deleted the codex/timestamp-provenance-395 branch July 29, 2026 11:58
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.

CEX market data: make exchange and local timestamp semantics type-safe

1 participant