fix(perps): incorrect decimals on limit price for open orders#30615
Conversation
Switch order price formatting from PRICE_RANGES_MINIMAL_VIEW to PRICE_RANGES_UNIVERSAL in PerpsCard and PerpsOrderDetailsView so low-price assets display the actual price (e.g. $0.001) instead of the threshold fallback (<$0.01).
|
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. |
Worker reportTAT-3178: Incorrect decimals on limit price for open ordersSummaryLimit order prices on the Perps home order card, order detail screen, and wallet home used Root Cause
The correct implementation was already visible in Reproduction CommitSHA: Metro log excerpt: Changes
Test PlanAutomated:
Manual Gherkin:
Evidence
Ticket |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These are purely UI formatting changes within the Perps feature. No controllers, navigation, shared infrastructure, or cross-cutting components are affected. Tag rationale:
Performance Test Selection: |
|



Description
Fix limit order price formatting on Perps home order card, order detail screen, and wallet home. These screens used
PRICE_RANGES_MINIMAL_VIEW(threshold-based, max 2 decimals) instead ofPRICE_RANGES_UNIVERSAL(adaptive significant digits), causing low-price assets like PUMP to display<$0.01instead of the actual price$0.001.Changelog
CHANGELOG entry: Fixed limit order price displaying
<$0.01instead of actual price on order cards and detail screensRelated issues
Fixes: TAT-3178
Manual testing steps
Screenshots/Recordings
Limit order price now shows adaptive sig-dig ($0.001) instead of threshold (<$0.01) on all 3 screens.
Video evidence — drag-and-drop into PR if needed:
.task/fix/tat-3178-0526-095542/artifacts/before.mp4.task/fix/tat-3178-0526-095542/artifacts/after.mp4Pre-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
{ "title": "Verify limit order price uses adaptive sig-dig on all screens", "jira": "TAT-3178", "acceptance_criteria": [ "AC1: Perps home order card displays limit price with adaptive sig-dig (not <$0.01)", "AC2: Order detail screen displays limit price with adaptive sig-dig", "AC3: Wallet home displays limit order price with adaptive sig-dig" ], "initial_conditions": { "testnet": false }, "validate": { "workflow": { "pre_conditions": ["wallet.unlocked", "perps.ready_to_trade"], "entry": "setup-place-order", "nodes": { "setup-place-order": { "action": "call", "ref": "perps/order-limit-place", "params": { "symbol": "PUMP", "side": "long", "usdAmount": "11", "limitPrice": "0.001" }, "next": "setup-wait" }, "setup-wait": { "action": "wait", "ms": 4000, "next": "ac1-nav-perps-home" }, "ac1-nav-perps-home": { "action": "navigate", "target": "PerpsMarketListView", "next": "ac1-wait-orders-loaded" }, "ac1-wait-orders-loaded": { "action": "wait_for", "expression": "...wait for '11000' in fiber tree...", "timeout_ms": 20000, "next": "ac1-scroll-to-orders" }, "ac1-scroll-to-orders": { "action": "eval_sync", "expression": "...scrollTo({y:350})...", "next": "ac1-scroll-settle" }, "ac1-scroll-settle": { "action": "wait", "ms": 500, "next": "ac1-eval-no-bug" }, "ac1-eval-no-bug": { "action": "eval_sync", "expression": "...assert <$0.01 absent...", "assert": { "operator": "eq", "field": "buggy", "value": false }, "next": "ac1-screenshot" }, "ac1-screenshot": { "action": "screenshot", "filename": "evidence-ac1-perps-home-order-card.png", "next": "ac2-nav-market" }, "ac2-nav-market": { "action": "navigate", "target": "PerpsMarketDetails", "next": "ac2-wait-market" }, "ac2-wait-market": { "action": "wait_for", "test_id": "perps-compact-order-row-first", "next": "ac2-press-order" }, "ac2-press-order": { "action": "press", "test_id": "perps-compact-order-row-first", "next": "ac2-wait-details" }, "ac2-wait-details": { "action": "wait_for", "route": "PerpsOrderDetailsView", "next": "ac2-eval-no-bug" }, "ac2-eval-no-bug": { "action": "eval_sync", "expression": "...assert <$0.01 absent...", "assert": { "operator": "eq", "field": "buggy", "value": false }, "next": "ac2-screenshot" }, "ac2-screenshot": { "action": "screenshot", "filename": "evidence-ac2-order-details-price.png", "next": "ac3-nav-wallet" }, "ac3-nav-wallet": { "action": "navigate", "target": "WalletView", "next": "ac3-wait-orders-loaded" }, "ac3-wait-orders-loaded": { "action": "wait_for", "expression": "...wait for '11000' in fiber tree...", "timeout_ms": 20000, "next": "ac3-scroll-to-orders" }, "ac3-scroll-to-orders": { "action": "eval_sync", "expression": "...scrollTo({y:600})...", "next": "ac3-scroll-settle" }, "ac3-scroll-settle": { "action": "wait", "ms": 500, "next": "ac3-eval-no-bug" }, "ac3-eval-no-bug": { "action": "eval_sync", "expression": "...assert <$0.01 absent...", "assert": { "operator": "eq", "field": "buggy", "value": false }, "next": "ac3-screenshot" }, "ac3-screenshot": { "action": "screenshot", "filename": "evidence-ac3-wallet-home-order-price.png", "next": "teardown-cancel-order" }, "teardown-cancel-order": { "action": "call", "ref": "perps/order-limit-cancel", "params": { "symbol": "PUMP" }, "next": "teardown-done" }, "teardown-done": { "action": "end", "status": "pass" } } } } }Recipe Workflow
workflow.mmd
Note
Low Risk
Display-only formatting change in Perps UI with targeted tests; no trading, auth, or data-path changes.
Overview
Limit order prices on Perps order cards and the order details screen now use
PRICE_RANGES_UNIVERSAL(adaptive significant digits) instead ofPRICE_RANGES_MINIMAL_VIEW, so low-priced assets (e.g. PUMP at$0.001) show the real price instead of a threshold like<$0.01.PerpsOrderDetailsViewpasses universal ranges toformatPerpsFiatfor limit price, trigger price, take profit, and stop loss.PerpsCarddoes the same for the order card’s displayed price. Tests assert the new formatting behavior.Reviewed by Cursor Bugbot for commit b32f0bb. Bugbot is set up for automated code reviews on this repo. Configure here.