Skip to content

research: project verified Binance tapes - #137

Merged
proerror77 merged 13 commits into
mainfrom
codex/binance-verified-research-projection
Jul 18, 2026
Merged

research: project verified Binance tapes#137
proerror77 merged 13 commits into
mainfrom
codex/binance-verified-research-projection

Conversation

@proerror77

@proerror77 proerror77 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Change contract

Add a research-only projection from the private typed VerifiedBinanceMarketTape into governed research updates, source clocks, and LOB snapshots, with source-time buckets anchored to the requested history start and replay visibility retained at received_at.

Out of scope

  • Polymarket projection or aggregation
  • Snapshot assembly
  • Audit generation
  • CLI or harness wiring
  • Runtime, execution, or deployment changes

Dependency or merge order

Focused validation

  • Focused Linux proof: https://github.com/proerror77/monday/actions/runs/29651421612
  • Exact-head Prediction Markets CI: https://github.com/proerror77/monday/actions/runs/29652171329
  • Exact-head Security & Quality: https://github.com/proerror77/monday/actions/runs/29652171331
  • Scope: 12 files and 748 non-generated changed lines, below the 750-line split guardrail
  • Counterexamples and trust checks:
    • source-time spot and LOB buckets match the canonical history_start-anchored loader even for unaligned windows
    • AggTrade replays before SpotPrice at equal received_at
    • equal-time book events merge atomically before one sample
    • no LOB sample appears before a verified source clock
    • missing spot, AggTrade, or LOB surfaces fail closed
    • the projection source and every new path dependency manifest are bound into the governed policy identity and freshness graph
  • Review: 0 unresolved threads; prior spec and standards reviews reported no remaining findings

Rollout / rollback impact

Research-only library and policy-identity change. Roll forward by consuming this private typed projection in the next focused audit/snapshot PRs. Roll back by reverting this PR only; collectors, runtime deployment, live execution, and production ECS are unchanged.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a public verified Binance market-tape projection API that validates windows, produces deterministic trade updates and sampled order-book snapshots, preserves source clocks, and exposes result counts. It also updates local dependency wiring, policy snapshots, dependency fingerprints, and research task tracking.

Changes

Verified Binance research projection

Layer / File(s) Summary
Dependency and policy inputs
rust_hft/prediction-markets/crates/ploy-research/Cargo.toml, rust_hft/prediction-markets/crates/ploy-research/prediction-policy-dependencies.*, rust_hft/prediction-markets/config/research_missions/*, rust_hft/prediction-markets/tasks/todo.md
Adds the local data dependency and refreshes policy snapshot, Linux dependency fingerprint, mission examples, and completed task tracking.
Projection API and window validation
rust_hft/prediction-markets/crates/ploy-research/src/lib.rs, rust_hft/prediction-markets/crates/ploy-research/src/verified_binance_projection.rs
Exports the verified Binance projection API, validates inputs and tape coverage, and constructs projection results with source clocks and surface counts.
Trade and order-book projection
rust_hft/prediction-markets/crates/ploy-research/src/verified_binance_projection.rs
Buckets trades into deterministic updates, replays and samples order-book events into depth metrics, preserves applicable source timestamps, and tests ordering, merging, staleness, and coverage failures.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant ProjectionAPI
  participant VerifiedTape
  participant TradeProjector
  participant BookProjector
  Caller->>ProjectionAPI: submit symbol, window, and cadence
  ProjectionAPI->>VerifiedTape: validate verified coverage
  ProjectionAPI->>TradeProjector: project spot and aggregate trades
  ProjectionAPI->>BookProjector: replay and sample LOB events
  TradeProjector-->>ProjectionAPI: market updates and source clocks
  BookProjector-->>ProjectionAPI: sampled LOB snapshots
  ProjectionAPI-->>Caller: return verified research projection
Loading

Possibly related PRs

  • proerror77/monday#104: Introduces the validated Binance market-tape contracts and clock invariants used by this projection.
  • proerror77/monday#131: Exposes replay sequencing and checkpoint events used for LOB projection.
  • proerror77/monday#133: Adds a related end-to-end path for projecting verified Binance artifacts into research outputs.
🚥 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 summarizes the main change: projecting verified Binance tapes into research outputs.
Description check ✅ Passed The description covers the required contract, out-of-scope items, dependencies, validation, and rollback details.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/binance-verified-research-projection

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@rust_hft/prediction-markets/crates/ploy-research/src/verified_binance_projection.rs`:
- Around line 88-99: Update the construction path for
VerifiedBinanceResearchProjection to validate spot_prices, aggregate_trades, and
lob_snapshots before returning Ok; fail closed with an appropriate error
whenever any required surface is empty. Add a regression test covering each
empty-surface case and confirming projection creation is rejected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 65534565-cd79-4d31-82ef-962f17d64c6b

📥 Commits

Reviewing files that changed from the base of the PR and between b1d6a2b and 0e53632.

⛔ Files ignored due to path filters (1)
  • rust_hft/prediction-markets/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • rust_hft/prediction-markets/config/research_missions/polymarket-btc-5m.example.json
  • rust_hft/prediction-markets/config/research_missions/polymarket-sol-5m.example.json
  • rust_hft/prediction-markets/crates/ploy-research/Cargo.toml
  • rust_hft/prediction-markets/crates/ploy-research/prediction-policy-dependencies.linux.sha256
  • rust_hft/prediction-markets/crates/ploy-research/prediction-policy-dependencies.linux.txt
  • rust_hft/prediction-markets/crates/ploy-research/src/lib.rs
  • rust_hft/prediction-markets/crates/ploy-research/src/verified_binance_projection.rs
  • rust_hft/prediction-markets/tasks/todo.md

@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: 0e53632391

ℹ️ 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/prediction-markets/crates/ploy-research/Cargo.toml
Comment thread rust_hft/prediction-markets/crates/ploy-research/src/lib.rs
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