Skip to content

fix(collector): accept observed insurance-fund zero-price sentinel - #818

Merged
proerror77 merged 1 commit into
mainfrom
codex/raw-trade-insurance-fund-sentinel
Aug 11, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/raw-trade-insurance-fund-sentinel

Conversation

@proerror77

@proerror77 proerror77 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Issue relationship

Refs #817

Summary

  • Accept the two observed USD-M zero-price sentinel execution types: NA and INSURANCE_FUND.
  • Keep the trust boundary strict: p=0, q=0, st=1, and the existing event/stream/symbol/id/clock/maker validation remain mandatory; negative prices, non-zero quantities, wrong status, missing fields, MARKET, and unknown execution types remain rejected.
  • Replay the complete captured CYSUSDT window t=110193461..467 through frame parsing, event processing, manifest generation, strict verification, and FakeOss upload-only readback. The zero frame is retained as raw_trade_zero_price; six positive trades remain raw_trade and continuity has no gap.

Out of scope

Runtime, ECS, OSS, deployment, Gate, and Live changes.

Dependencies and merge order

None.

Focused validation

  • TDD red: old parser fails the exact CYSUSDT t=110193464 frame with raw trade zero-price field X is not NA.
  • Green: hft-data 78/78; collector upload-only E2E passes with strict verifier, three-object FakeOss readback, and local cleanup (macOS temporary RUSAGE_THREAD shim only).
  • Linux target: collector cargo check --tests, hft-data and hft-collector scoped Clippy with -D warnings, and git diff --check pass.

Rollout and rollback

None; this PR only changes parser/test behavior and is not a production cutover.

Scope exception

None.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change accepts INSURANCE_FUND zero-price raw trades and adds rejection tests for unsupported execution types. The USD-M upload-only contract fixture now uses CYSUSDT data with updated stream frames, timestamps, raw trades, and manifest counts.

Changes

Binance zero-price USD-M trade handling

Layer / File(s) Summary
Zero-price execution validation
rust_hft/data-pipelines/core/src/binance_market_tape.rs
Zero-price raw trades now accept NA and INSURANCE_FUND. Tests cover unsupported execution types and successful insurance-fund parsing.
CYSUSDT upload-only contract fixtures
rust_hft/tools/collector/src/bin/binance-lob-archiver.rs
The contract fixture now uses CYSUSDT frames, six sequential raw trades, one zero-price insurance-fund event, updated timestamps, and revised manifest counts.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: accepting observed insurance-fund zero-price sentinels in the collector.
Description check ✅ Passed The description covers the change, issue, scope, dependencies, validation, rollout, and scope exception; the summary provides the change contract content.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/raw-trade-insurance-fund-sentinel

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.

@proerror77
proerror77 merged commit fb61891 into main Aug 11, 2026
45 of 49 checks passed
@proerror77
proerror77 deleted the codex/raw-trade-insurance-fund-sentinel branch August 11, 2026 09:09
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.

1 participant