Conversation
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/perps (9 files, +389 -137)
|
Builds ready [41f7815]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [f98c138]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [9bd6800]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Builds ready [fbbde7b]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|



Description
perps order UI was not treating TP/SL correctly for short vs long positions.
Centralized TP/SL–related order logic in orderUtils (with unit tests) and wired the perps order card to use it.
Trimmed duplicate logic out of transactionTransforms.
Changelog
CHANGELOG entry: Classify TP/SL orders
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2905
Manual testing steps
Open a market order. Modify tpsl for that market order. TPSL orders should appear within the market detail page. TPSL orders should not appear within the main perps tab (aligns with mobile experience)
Screenshots/Recordings
Screen.Recording.2026-04-21.at.9.01.41.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes how TP/SL (trigger) orders are labeled, valued, and filtered between the Perps tab and market detail pages; mistakes could hide orders or show incorrect prices. Logic is centralized and covered by new unit/UI tests, reducing regression risk.
Overview
Unifies TP/SL (trigger) order classification and display across the Perps UI. Open Orders on the main Perps tab now explicitly filter out TP/SL rows (
isTriggerandisPositionTpsl), leaving TP/SL visibility to the per-market detail page.Updates order labeling and pricing for trigger-based orders.
OrderCardnow uses a sharedformatOrderLabelutility, shows trigger price (not size×price notional) for TP/SL, adds aTrigger pricesubtitle, and tweaks layout to allow multi-line TP/SL labels.Centralizes order-label logic and adjusts market-detail order visibility.
formatOrderLabelis added toorderUtils(and removed fromtransactionTransforms), and market detail normalization now includes full-position TP/SL orders rather than filtering them out; extensive new tests cover label formatting, TP/SL rendering, and filtering behavior.Reviewed by Cursor Bugbot for commit fbbde7b. Bugbot is set up for automated code reviews on this repo. Configure here.