Repository navigation
fix(perps): preserve Terminal categories on snapshot fallback - #35379
abretonc7s wants to merge 1 commit into
Conversation
|
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. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #35379 +/- ##
==========================================
+ Coverage 85.56% 85.57% +0.01%
==========================================
Files 6669 6673 +4
Lines 183853 184244 +391
Branches 45423 45556 +133
==========================================
+ Hits 157308 157674 +366
- Misses 16118 16129 +11
- Partials 10427 10441 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Closing because this reintroduced the deprecated Terminal v1 metadata path. The intended fallback remains Terminal v2 to Hyperliquid, with local controller mappings for degraded categories. We will replace this with a smaller local-mapping-only change. |



Description
@metamask/perps-controller@13.0.0drops Terminal v1categorywhenmarketTypeis absent. It also skips v1 metadata when the configured v2 snapshot fails. The fallback then keeps live provider prices but can lose Terminal's category mapping.This temporary Yarn patch backports the controller fix while the next package release is prepared:
pre_ipotopre-ipoandstockstostock;isNewMarketwhen Terminal supplies a category;Validated on a Pixel 6 with a forced v2 failure. Unitree, CXMT, and SKHY resolved to Pre-IPO; CBRS and SPCX resolved to Stocks. All five retained prices and none used the v2 snapshot data source.
This supersedes Mobile #35313, whose patch targets controller v12. Remove this patch after a controller release contains Core #9987, which combines the category mapping and snapshot-fallback fix.
Changelog
CHANGELOG entry: Fixed Perps market categories when Terminal snapshot fallback is used
Related issues
Refs: MetaMask/core#9987
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
Changes Perps market-data fallback and category labeling for real markets; wrong metadata could mis-filter or mis-label markets, though pricing still comes from the provider.
Overview
Adds a temporary Yarn patch on
@metamask/perps-controller@13.0.0(wired throughpackage.json/yarn.lock) until an upstream release includes the Core fix.The patch changes how Perps loads Terminal market metadata when the v2 global snapshot is tried but cannot supply prices: it now still calls the legacy Terminal markets API so categories and related fields stay aligned while live provider prices are used. It also derives
marketTypefrom Terminal’scategorywhenmarketTypeis missing, and clears staleisNewMarketwhen Terminal metadata applies a type.Static HIP-3 fallbacks reclassify
xyz:CBRSandxyz:SPCXfrom Pre-IPO to Stock (IPOPstays Pre-IPO).Reviewed by Cursor Bugbot for commit 484a064. Bugbot is set up for automated code reviews on this repo. Configure here.