feat(perps): sync mobile perps code to core#8291
Merged
abretonc7s merged 3 commits intomainfrom Mar 25, 2026
Merged
Conversation
Syncs perps-controller from mobile branch feat/perps/core-resolver (68a90b5) to core. Key changes: - Add geolocation-controller dependency for eligibility checks - Add MYXWalletService and PerpsController-method-action-types - Exclude MYXWalletService from published package files - MYX provider: enhanced error handling, wallet service integration - HyperLiquid provider: subscription reliability, order book processing - Eligibility service: geolocation-based region blocking 30 files changed, 3 ESLint suppressions.
4 tasks
Synced from mobile eea8376b35. require() defeats webpack code splitting; import() enables true tree-shaking so MYX is excluded from the extension bundle when not enabled. Removes stale no-restricted-globals suppression.
41060c4 to
269b88d
Compare
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.
- Add missing trailing newline to eslint-suppressions.json (Prettier) - Add PR #8291 links to all changelog entries (changelog validator)
aganglada
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
Mobile (
feat/perps/core-resolver, PR MetaMask/metamask-mobile#27899) is the source of truth for perps code. The last sync to core was Feb 26 — 27 days stale. Since then, 4 commits went directly to core (#7941, #8197, #8214, #8234), all of which have been backported into the mobile branch.This PR syncs the latest mobile perps code to core using
validate-core-sync.sh. Key changes:@metamask/geolocation-controlleras a devDependency + tsconfig reference —messenger.tsnow importsGeolocationControllerGetGeolocationActionfor eligibility geolocation checks.MYXWalletService.ts(MYX wallet integration) andPerpsController-method-action-types.ts(typed action map).!dist/services/MYXWalletService*tofilesinpackage.jsonto keep MYX code out of published package.error.codecheck), wallet service integration, expanded config constants.no-restricted-globalsforrequire()in MYX dynamic load, 2@typescript-eslint/no-base-to-stringin myxAdapter).Supersedes stale PR #8207 (
feat/perps/newsync, 139 commits behind main).References
Checklist
Note
Medium Risk
Touches core Perps controller/provider logic (provider init, caching, eligibility geo-checks) and adds MYX wallet/authenticated reads, which could affect data freshness and provider availability across networks.
Overview
Syncs Perps code from mobile into core, including new MYX wallet/auth plumbing and broader provider/config updates.
PerpsControllernow (a) defers messenger handler registration untilinit(), (b) resolves MYX enablement via credentials/flags and dynamically imports/registers MYX with explicit auth config resolution, and (c) replaces single cached preload fields with per-provider/per-network market+user caches (with reinit guards and preload retriggering).Adds geolocation-based eligibility checking via
GeolocationController:getGeolocation, expands analytics/event constants, and refactors exports to explicit named exports. HyperLiquid reliability is improved with better multi-DEX failure handling, asset-id repair/backfill, stale market-data fallback, configurable builder addresses, and a newfetchHistoricalCandles; MYX config/endpoints are updated andMYXProvidergains authenticated read support (positions/orders/fills/funding/history) plus candle subscription (REST + WS updates).Written by Cursor Bugbot for commit d8a453d. This will update automatically on new commits. Configure here.