fix(perps): Mobile decimals on open orders #29770
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. |
Open-order trigger and limit prices need to match the decimal precision used for market prices, so compact rows and order details now use the universal Perps price ranges while notional values stay on fiat formatting. Constraint: Order value and fee rows remain USD fiat values and should not use market-price precision Rejected: Change formatPerpsFiat defaults globally | broader display risk outside open-order prices Confidence: high Scope-risk: narrow Tested: yarn lint && NODE_OPTIONS='--max-old-space-size=8192' yarn lint:tsc && yarn format:check Tested: yarn jest app/components/UI/Perps/Views/PerpsOrderDetailsView/PerpsOrderDetailsView.test.tsx app/components/UI/Perps/components/PerpsCompactOrderRow/PerpsCompactOrderRow.test.tsx --no-coverage Tested: bash scripts/perps/agentic/validate-recipe.sh .task/fix/tat-3094-0506-073600/artifacts/ --skip-manual Not-tested: Android device run
Worker reportTAT-3094 ReportSummaryOpen order trigger and limit prices were using compact/default fiat precision, so low-priced markets such as CHIP rounded to two decimals in compact rows and order details. The fix routes open-order price fields through the same universal price ranges used by market prices while leaving notional value and fee formatting unchanged. Root CauseMarket prices are transformed with
Order value continues to use default fiat formatting because it is a USD notional value, not a market trigger/limit price. Changes
Test PlanAutomated:
Evidence
TicketTAT-3094: https://consensyssoftware.atlassian.net/browse/TAT-3094 Recipe workflow diagramflowchart TD
%% Mobile decimals on open orders
__entry__(["ENTRY"]) --> node_ac1_open_chip_order_details
node_ac1_open_chip_order_details["ac1-open-chip-order-details<br/>navigate"]
node_ac1_wait_order_details["ac1-wait-order-details<br/>wait_for"]
node_ac1_assert_chip_limit_price["ac1-assert-chip-limit-price<br/>eval_sync"]
node_ac1_screenshot_chip_order_details["ac1-screenshot-chip-order-details<br/>screenshot"]
node_ac1_done(["ac1-done<br/>PASS"])
node_ac1_open_chip_order_details --> node_ac1_wait_order_details
node_ac1_wait_order_details --> node_ac1_assert_chip_limit_price
node_ac1_assert_chip_limit_price --> node_ac1_screenshot_chip_order_details
node_ac1_screenshot_chip_order_details --> node_ac1_done
|
The prior branch included unrelated typecheck workarounds in controller and rewards files. Typecheck passes without them, so this removes those changes from the PR and leaves only the open-order decimal fix plus targeted tests. Constraint: PR should address TAT-3094 without unrelated controller or rewards churn Rejected: Keep ambient typecheck cleanups in this PR | they are not required for the decimal bug and make review harder Confidence: high Scope-risk: narrow Directive: Keep future TAT-3094 edits limited to Perps open-order price formatting unless validation proves broader changes are necessary Tested: NODE_OPTIONS='--max-old-space-size=8192' npx tsc --noEmit --incremental false --project ./tsconfig.json Not-tested: Full unit test suite after scope-only cleanup
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These are purely UI formatting changes within the Perps feature area - no controller changes, no navigation changes, no shared component changes. The risk is low. Tag selection rationale:
Tags NOT selected:
Performance Test Selection: |
|



written, 10221 bytes, replacements=1
r and limit prices now use the same market-price precision rules as Perps market prices. This fixes low-priced markets such as CHIP showing rounded two-decimal prices in compact open-order rows and order details, while leaving USD notional values and fees on fiat formatting.
Self-review follow-up added explicit trigger-condition interpolation coverage for the
$0.001234formatting path and clarified the executable recipe scope.Changelog
CHANGELOG entry: Fixed open order trigger and limit prices to display the correct market decimal precision.
Related issues
Fixes: TAT-3094
Manual testing steps
Additional automated coverage:
PerpsOrderDetailsView.test.tsxasserts the trigger-condition translation receivesprice: '$0.001234'.PerpsCompactOrderRow.test.tsxasserts compact order rows pass universal price ranges to the formatter.Screenshots/Recordings
CHIP open order details display the six-decimal trigger/limit price using market precision.
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
Validation Recipe
recipe.json
{ "pr": "29770", "title": "Mobile decimals on open orders", "jira": "TAT-3094", "acceptance_criteria": [ "Open orders (limit, TP, SL) on wallet home, perps home and perp market detail screens display the same number of decimals for trigger/limit price as the displayed market price (examples: 0 for BTC, 2 for CL, 6 for CHIP)." ], "coverage_notes": { "recipe_scope": "Executable recipe proves the low-priced CHIP limit-order details surface only, using the concrete value that failed before the fix.", "not_recipe_covered": [ "Wallet home compact open-order row", "Perps home compact open-order row", "Market detail compact open-order row", "Take-profit trigger condition in order details", "Stop-loss trigger condition in order details" ], "non_recipe_evidence": [ "PerpsCompactOrderRow.test.tsx asserts compact open-order price formatting passes PRICE_RANGES_UNIVERSAL.", "PerpsOrderDetailsView.test.tsx asserts limit, trigger-condition, take-profit, and stop-loss prices use universal-range formatted output." ] }, "validate": { "workflow": { "pre_conditions": ["wallet.unlocked", "perps.feature_enabled"], "entry": "ac1-open-chip-order-details", "nodes": { "ac1-open-chip-order-details": { "action": "navigate", "target": "PerpsOrderDetailsView", "params": { "order": { "orderId": "recipe-chip-limit", "symbol": "CHIP", "side": "buy", "orderType": "limit", "size": "100", "originalSize": "100", "price": "0.001234", "filledSize": "0", "remainingSize": "100", "status": "open", "timestamp": 1777982726658, "detailedOrderType": "Limit", "isTrigger": false, "reduceOnly": false, "isPositionTpsl": false, "triggerPrice": "0" } }, "next": "ac1-wait-order-details" }, "ac1-wait-order-details": { "action": "wait_for", "route": "PerpsOrderDetailsView", "next": "ac1-assert-chip-limit-price" }, "ac1-assert-chip-limit-price": { "action": "eval_sync", "expression": "(function(){var hook=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;var out=[];function add(x){if(x===null||x===undefined)return;if(typeof x==='string'||typeof x==='number')out.push(String(x));else if(Array.isArray(x)){for(var i=0;i<x.length;i++)add(x[i]);}}function walk(f){if(!f)return;var p=f.memoizedProps;if(p)add(p.children);walk(f.child);walk(f.sibling);}if(!hook||!hook.getFiberRoots)return JSON.stringify({found:false,text:''});hook.renderers.forEach(function(v,id){var roots=hook.getFiberRoots(id);if(roots)roots.forEach(function(root){walk(root.current);});});var text=out.join('|');return JSON.stringify({found:text.indexOf('$0.001234')>=0,text:text});})()", "assert": { "operator": "eq", "field": "found", "value": true }, "next": "ac1-screenshot-chip-order-details" }, "ac1-screenshot-chip-order-details": { "action": "screenshot", "filename": "evidence-ac1-chip-order-details.png", "note": "AC1: CHIP order details renders six-decimal limit price $0.001234", "next": "ac1-done" }, "ac1-done": { "action": "end", "status": "pass" } } } } }Recipe Workflow
workflow.mmd
Note
Low Risk
Low risk UI-formatting change that only affects how perps open-order prices (limit/trigger/TP/SL) are displayed; no changes to order logic, execution, or fee/notional calculations.
Overview
Updates perps open-order displays to format limit and trigger-derived prices using
PRICE_RANGES_UNIVERSAL, matching market price precision for low-priced markets (e.g., CHIP) in bothPerpsOrderDetailsViewandPerpsCompactOrderRow.Extends tests to cover the new precision path, including explicit assertions for six-decimal limit prices and correct trigger-condition string interpolation with the universally-formatted price, plus updated expectations for TP/SL rows.
Reviewed by Cursor Bugbot for commit 1802b06. Bugbot is set up for automated code reviews on this repo. Configure here.