research: project verified Binance tapes - #137
Conversation
📝 WalkthroughWalkthroughAdds 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. ChangesVerified Binance research projection
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
rust_hft/prediction-markets/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (8)
rust_hft/prediction-markets/config/research_missions/polymarket-btc-5m.example.jsonrust_hft/prediction-markets/config/research_missions/polymarket-sol-5m.example.jsonrust_hft/prediction-markets/crates/ploy-research/Cargo.tomlrust_hft/prediction-markets/crates/ploy-research/prediction-policy-dependencies.linux.sha256rust_hft/prediction-markets/crates/ploy-research/prediction-policy-dependencies.linux.txtrust_hft/prediction-markets/crates/ploy-research/src/lib.rsrust_hft/prediction-markets/crates/ploy-research/src/verified_binance_projection.rsrust_hft/prediction-markets/tasks/todo.md
There was a problem hiding this comment.
💡 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".
dc7ca54 to
f587af1
Compare
Change contract
Add a research-only projection from the private typed
VerifiedBinanceMarketTapeinto governed research updates, source clocks, and LOB snapshots, with source-time buckets anchored to the requested history start and replay visibility retained atreceived_at.Out of scope
Dependency or merge order
Focused validation
history_start-anchored loader even for unaligned windowsreceived_atRollout / 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.