Skip to content

feat(assets): subscribe candlestick streams on ohlcv.v1 - #38739

Merged
Prithpal-Sooriya merged 9 commits into
mainfrom
feature/use-ohlcv-namespace-ddf
Nov 6, 2026
Merged

Prithpal-Sooriya merged 9 commits into
mainfrom
feature/use-ohlcv-namespace-ddf

Conversation

@Prithpal-Sooriya

@Prithpal-Sooriya Prithpal-Sooriya commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Production now serves candlestick updates on ohlcv.v1. Charts, bridge live rates, and social spot prices were still matching market-data.v1.<assetId>.<interval>.<currency>, so those client channel names now use ohlcv.v1.

This PR also switches the OHLCVService subscription namespace to ohlcv.v1. It removes the subscriptionNamespace: 'market-data.v1' pin added in #38819, so ohlcv-service-init.ts passes no namespace override and the service uses core-backend 14's default of ohlcv.v1. The service subscription and the client channel matching now both use ohlcv.v1. The isLoading test fixture that came in from main was updated the same way.

Adverse review: SHIP-WITH-CAVEATS (3/3 ship). Its two warnings (share one namespace constant across modules, and add a test that ties the service namespace to the client channel names) were declined for now: they are refactors outside this PR's scope, and every literal already matches.

Changelog

CHANGELOG entry: Switched live candlestick prices to the ohlcv.v1 stream

Related issues

Refs: https://consensyssoftware.atlassian.net/browse/ASSETS-4174

Manual testing steps

Feature: live candlestick namespace

  Scenario: a chart accepts an ohlcv.v1 bar
    Given the advanced chart is subscribed to an asset
    When a bar arrives on ohlcv.v1.<assetId>.<interval>.<currency>
    Then the chart shows that bar

  Scenario: a social spot card accepts an ohlcv.v1 bar
    Given a spot card is on screen
    When a bar arrives on ohlcv.v1.<assetId>.1m.usd
    Then the card price updates to that bar's close

Screenshots/Recordings

N/A. The channel prefix is not visible in the UI.

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Not applicable. This only renames the channel prefix the client matches.
  • I've tested with a power user scenario
    • Not applicable. No account, token, or list behavior changed.
  • I've instrumented key operations with Sentry traces for production performance metrics
    • Not applicable. No new operation was added.

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Live chart, Bridge, and social spot pricing depend on matching the production stream namespace; a client/backend mismatch would stop real-time candles until aligned.

Overview
Production candlestick WebSocket traffic now uses ohlcv.v1 instead of market-data.v1. This PR aligns the mobile client with that namespace end to end.

useOHLCVRealtime builds and matches channels as ohlcv.v1.<assetId>.<interval>.<currency>, which feeds advanced charts and Bridge live fiat rates. Social live spot prices use the same prefix when subscribing and when filtering barUpdated events. Related JSDoc and test channel strings were updated to match.

OHLCVService initialization drops the explicit subscriptionNamespace: 'market-data.v1' pin so the service uses core-backend’s default ohlcv.v1, keeping subscriptions and UI channel matching in sync. The init test that asserted the old override was removed.

Reviewed by Cursor Bugbot for commit 9120fbb. Bugbot is set up for automated code reviews on this repo. Configure here.

Production now serves the ohlcv.v1 candlestick namespace, and mobile was still matching market-data.v1.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Prithpal-Sooriya
Prithpal-Sooriya requested review from a team as code owners November 3, 2026 11:25
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the size-M label Nov 3, 2026
@metamask-ci metamask-ci Bot added team-assets INVALID-PR-TEMPLATE PR's body doesn't match template labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags

SmokeSwap
SmokeConfirmations
SmokeWalletPlatform
SmokePerps
SmokePredictions

AI Confidence: 82

E2E reasoning

Expand to read

This PR switches the OHLCV subscription namespace from market-data.v1 to ohlcv.v1 across the Engine init, Bridge live rate hook, AdvancedChart hook, and SocialFeed live prices provider. The test file asserting the old namespace is deleted.

Functional impact areas:

  1. Bridge/Swap live token fiat rates (useLiveTokenFiatRate → useOHLCVRealtime): The channel string changes from market-data.v1.{assetId}... to ohlcv.v1.{assetId}.... This affects real-time pricing in Bridge/Swap flows → SmokeSwap + SmokeConfirmations (per tag dependency rules).

  2. Social feed live prices (SocialLivePricesProvider): The ohlcvChannel() function now produces ohlcv.v1.{assetId}... channels. This provider is used in SocialV1View and SocialPostComposerView, which are part of the Trending/Social feed → SmokeWalletPlatform.

  3. Perps and Predictions use SocialLivePricesProvider for spot price streaming → SmokePerps + SmokePredictions (both are sections inside Trending, per tag descriptions).

Risk level: medium — The change is a single focused namespace string switch, but it affects live data streaming across multiple product areas. If the ohlcv.v1 channel is not properly served or the subscription fails, Bridge pricing, social feed prices, and chart data would all break silently. The deletion of the test asserting the old namespace is expected and correct.

Comment/doc-only changes (types.ts files, JSDoc in index.ts) are cosmetic and don't add additional test scope.

Tag dependency rules applied:

  • SmokeSwap → also SmokeConfirmations (per SmokeSwap description)
  • SmokePerps → also SmokeWalletPlatform (per SmokePerps description)
  • SmokePredictions → also SmokeWalletPlatform (per SmokePredictions description)

View run

The published core-backend package stays as-is. Mobile charts and social prices match ohlcv.v1 themselves.

Co-authored-by: Cursor <cursoragent@cursor.com>
sahar-fehri
sahar-fehri previously approved these changes Nov 3, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.73%. Comparing base (2e2a11d) to head (7271ef4).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #38739   +/-   ##
=======================================
  Coverage   87.73%   87.73%           
=======================================
  Files        8030     8030           
  Lines      233873   233873           
  Branches    59287    59287           
=======================================
+ Hits       205186   205195    +9     
+ Misses      16265    16262    -3     
+ Partials    12422    12416    -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dawnseeker8
dawnseeker8 previously approved these changes Nov 5, 2026

@dawnseeker8 dawnseeker8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

zone-live
zone-live previously approved these changes Nov 5, 2026
sahar-fehri
sahar-fehri previously approved these changes Nov 5, 2026
GeorgeGkas
GeorgeGkas previously approved these changes Nov 5, 2026
@Prithpal-Sooriya
Prithpal-Sooriya added this pull request to the merge queue Nov 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 5, 2026
@Prithpal-Sooriya
Prithpal-Sooriya added this pull request to the merge queue Nov 5, 2026
@Prithpal-Sooriya
Prithpal-Sooriya removed this pull request from the merge queue due to a manual request Nov 5, 2026
@Prithpal-Sooriya
Prithpal-Sooriya added this pull request to the merge queue Nov 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 5, 2026
…espace-ddf-1

# Conflicts:
#	app/components/UI/Bridge/hooks/useLiveTokenFiatRate/index.ts
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@Prithpal-Sooriya Prithpal-Sooriya changed the title feat(assets): subscribe candlestick streams on ohlcv.v1 feat(assets): subscribe candlestick streams on ohlcv.v1 cp-8.20.0 Nov 6, 2026
@Prithpal-Sooriya Prithpal-Sooriya changed the title feat(assets): subscribe candlestick streams on ohlcv.v1 cp-8.20.0 feat(assets): subscribe candlestick streams on ohlcv.v1 Nov 6, 2026
@Prithpal-Sooriya
Prithpal-Sooriya added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 20d9972 Nov 6, 2026
124 checks passed
@Prithpal-Sooriya
Prithpal-Sooriya deleted the feature/use-ohlcv-namespace-ddf branch November 6, 2026 11:49
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
@metamask-ci metamask-ci Bot added the release-8.21.0 Issue or pull request that will be included in release 8.21.0 label Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.21.0 Issue or pull request that will be included in release 8.21.0 size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants