feat(perps): introduce perps charts tracking#9221
Merged
Merged
Conversation
568f36c to
9de9aa4
Compare
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
9de9aa4 to
c141272
Compare
93d74b9 to
26fc963
Compare
gambinish
approved these changes
Jun 24, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
9a4d21f to
4aa3b67
Compare
4 tasks
pull Bot
pushed a commit
to Reality2byte/core
that referenced
this pull request
Jun 24, 2026
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> This PR moves the Perps Advanced Chart analytics changelog entry for MetaMask#9221 from the released 9.0.0 section back into Unreleased. The original PR introduced user-facing/API-facing analytics constants in @metamask/perps-controller, so the changelog entry needs to remain under Unreleased until it is picked up by the next package release. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only changelog reordering with no runtime or API code changes in this PR. > > **Overview** > **Changelog-only fix** for `@metamask/perps-controller`: the **Perps Advanced Chart analytics** note ([MetaMask#9221](MetaMask#9221)) is moved out of **`[9.0.0]`** and into **`[Unreleased]` → Added**. > > The entry text is unchanged (new `PERPS_EVENT_PROPERTY` keys `CHART_LIBRARY` / `ASSET_TYPE` and matching `PERPS_EVENT_VALUE` groups). **`[9.0.0]`** now only documents the watchlist/AUS breaking changes ([MetaMask#9010](MetaMask#9010)). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit fe9d324. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
References
This PR adds the chart analytics property and value constants to the Perps controller analytics exports:
PERPS_EVENT_PROPERTY.CHART_LIBRARYPERPS_EVENT_PROPERTY.ASSET_TYPEPERPS_EVENT_VALUE.CHART_LIBRARY.ADVANCEDPERPS_EVENT_VALUE.CHART_LIBRARY.LIGHTWEIGHTPERPS_EVENT_VALUE.ASSET_TYPE.PERPThe new constants are used by the Perps Advanced Charts migration to distinguish analytics emitted from the existing lightweight chart experience versus the new advanced chart experience.
asset_type: perpis included as a global analytics dimension for these chart events so Segment receives the same standardized value across Perps clients.The related mobile changes replace local chart analytics constants with these controller exports. The related segment-schema changes ensure the emitted properties are accepted by the analytics schema.
The downstream mobile PR needs to consume the updated
@metamask/perps-controllerpackage so it can use these canonical analytics constants instead of local string literals.Checklist
Note
Low Risk
Additive analytics constants and an optional trade event property; no trading, auth, or persistence behavior changes.
Overview
Adds canonical Perps advanced chart analytics keys to
@metamask/perps-controllerso mobile can stop duplicating string literals:PERPS_EVENT_PROPERTY.CHART_LIBRARY/ASSET_TYPEandPERPS_EVENT_VALUEgroups for chart library (lightweight,advanced) and asset type (spot,perp). Changelog documents the export for the Advanced Charts migration (#9221).Trade path:
TrackingDatagains optionalchartLibrary, andTradingServiceforwards it on Perp Trade Transaction events aschart_librarywhen callers set it on ordertrackingData(e.g. trades initiated from the advanced chart). Unit tests cover the new constants and the trade analytics property.Reviewed by Cursor Bugbot for commit 4aa3b67. Bugbot is set up for automated code reviews on this repo. Configure here.