feat(perps-controller): add Memecoin category derived from crypto + tag - #10168
Merged
Conversation
Adds a new 'Memecoin' UI-only filter category that overlaps with the
existing 'Crypto' filter by design: a memecoin market is any market
where marketType === 'crypto' and tags includes 'memecoin' (the tag is
defined on the Terminal backend).
- Add MarketCategory.Memecoin ('memecoin')
- Extend MarketTypeFilter and MARKET_CATEGORIES (inserted after 'crypto')
- Extend matchesCategory with a 'memecoin' case; leave 'crypto' untouched
so memecoins appear under both pills
Tests updated for the new enum member (8 total), the ordered pill list,
and the new matchesCategory behaviour.
aganglada
temporarily deployed
to
default-branch
September 10, 2026 13:42 — with
GitHub Actions
Inactive
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 3f2a14e. Configure here.
…with unset marketType Cursor Bugbot flagged that the 'memecoin' branch of matchesCategory required marketType === 'crypto', but the 'crypto' branch treats main-DEX markets as crypto even when marketType is unset (the common provider-sourced shape prior to Terminal enrichment). Tagged main-DEX memecoins therefore matched 'crypto' but not 'memecoin', so the pill could appear empty for the typical case. Align 'memecoin' with 'crypto' semantics: !isHip3Market(market) || marketType === 'crypto', combined with the tag check. Add tests for the unset-marketType shape and for HIP-3 leaks (including marketSource-only HIP-3 markets). Also add the PR link to the changelog entry to satisfy Check Changelog.
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. |
aganglada
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Sep 10, 2026
Point mobile at the perps-controller preview from MetaMask/core#10168 so we can try the new Memecoin category end-to-end before the upstream release lands. - Add a previewBuilds entry (type: breaking) for @metamask-previews/perps-controller@17.0.0-preview-b3db565c8. The preview is a major bump (16.2.0 → 17.0.0), so we override the workspace resolution rather than the version range. - The 17.x line ships ESM-only under dist/*.js instead of the 16.x dual CJS/ESM build, so: - jest.config.js resolves the entry to .cjs when it exists (16.x) and falls back to .js (17.x), and allow-lists perps-controller and its ESM-only peers (@metamask/base-controller, @metamask/controller-utils, @metamask/abi-utils, @metamask/messenger, @metamask/superstruct, @metamask/utils, lodash-es) in transformIgnorePatterns so babel-jest can transform them. - babel.config.js adds a matching override that runs @babel/plugin-transform-modules-commonjs on the perps-controller subtree and lodash-es. Existing memecoin unit tests (33 in marketCategoryMapping.test.ts, plus usePerpsCategories/usePerpsMarketListView) pass unchanged against the preview build.
michalconsensys
approved these changes
Sep 11, 2026
pull Bot
pushed a commit
to Reality2byte/core
that referenced
this pull request
Sep 11, 2026
## Explanation - Update `@metamask/perps-controller` from `v17.0.0` to `v17.1.0`. - This is a perps-controller-only release so clients can pick up `MarketCategory.Memecoin` (`'memecoin'`) without waiting on a broader monorepo cut. - Minor bump: new UI-only filter category on `MARKET_CATEGORIES` / `MarketTypeFilter`. No breaking API changes. The `uuid` `^8.3.2` → `^9.0.1` bump is included because it was already sitting in Unreleased. ## References - Ships [MetaMask#10168](MetaMask#10168) - Consumer: [MetaMask/metamask-mobile#36047](MetaMask/metamask-mobile#36047) ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] 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 Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
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
Adds a new UI-only
Memecoinproduct category to@metamask/perps-controller. Because a market only has onemarketTypeat a time, memecoins can't be expressed as a distinctmarketType— instead, theMemecoincategory is derived from the combinationmarketType === 'crypto' && tags.includes('memecoin'). The'memecoin'tag is defined on the Terminal backend (companion PR: consensys-vertical-apps/terminal-backend#66) and enriched ontoPerpsMarketDatavia the existingTerminalMarketService.Per product decision, the existing
'crypto'filter is not modified — memecoins remain in the Crypto pill and also appear under the new Memecoin pill (overlapping by design).Changes
packages/perps-controller/src/types/index.tsMemecoin = 'memecoin'toMarketCategory| 'memecoin'toMarketTypeFilter'memecoin'intoMARKET_CATEGORIESright after'crypto'(controls default pill order)packages/perps-controller/src/utils/marketUtils.ts'memecoin'case inmatchesCategory:'crypto'case untouched.References
CHANGELOG.mdentry under[Unreleased] > Added.Checklist
describe("'memecoin' filter")block inmarketUtils.test.ts, and updated the enum/MARKET_CATEGORIEScount (7 → 8) assertions inhyperLiquidConfig.test.tsandPerpsController.market-filtering.test.ts.Made with Cursor