feat(predict): add crypto price data plumbing#30004
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
🔄 Fixture update started. Running workflow from branch |
|
❌ E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use |
|
@metamaskbot update-mobile-fixture |
|
🔄 Fixture update started. Running workflow from branch |
|
❌ E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use |
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1d19a68. Configure here.
christopherferreira9
left a comment
There was a problem hiding this comment.
tiny comment
This reverts commit 1603e11.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key changes:
Tag selection rationale:
The WalletView.ts page object fix (scroll direction fallback) directly improves test reliability for Predictions section navigation, making SmokePredictions tests more stable. Performance Test Selection: |
|




Description
This PR adds the data plumbing for Predict crypto up/down markets. It wires crypto price history and target-price queries through the Predict controller/provider layer, adds live crypto price subscription handling, and includes trace and cleanup coverage for WebSocket behavior.
This slice also keeps existing v1 order preview fee behavior intact while adding the v2 CLOB plumbing needed by the crypto up/down flow. Because this slice triggers the Predict smoke suite, it includes the wallet page-object tap stabilization needed for the existing Predictions section E2E path.
TODO
Changelog
CHANGELOG entry: null
Related issues
Fixes: N/A - stacked Predict crypto up/down implementation split from #29436.
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Introduces new crypto price-history API plumbing plus live RTDS websocket tracing/buffering changes, which could impact Predict data-fetch reliability and realtime updates. Adds v2 CLOB endpoint selection for previews, which may affect order preview behavior if misconfigured.
Overview
Adds end-to-end support for crypto up/down price data in Predict: a new
getCryptoPriceHistorypath (types, controller action, provider fetch to a dedicated endpoint, react-querycryptoPriceHistoryquery) plus updated error/trace instrumentation and test coverage.Introduces
useCryptoUpDownChartDatato merge historical price history with live RTDS websocket updates, including market-change resets, end-date “freeze” handling, and target-price fallback seeding when history is missing.Refactors
useLiveCryptoPricesto subscribe per-symbol and push updates via callback (instead of maintaining an internal prices map), and hardens RTDS handling inWebSocketManager(subscribe/unsubscribe semantics, buffered flush tracing, and isolating subscriber errors).Extends Polymarket utils to support v2 CLOB base URLs and a
4hseries recurrence inference, and tightens numeric validation in crypto target price + currency formatting; also stabilizes Predictions section E2E scroll/tap behavior.Reviewed by Cursor Bugbot for commit 9b54990. Bugbot is set up for automated code reviews on this repo. Configure here.