Skip to content

fix: order book kPEPE price is being cut - #34845

Merged
abretonc7s merged 5 commits into
mainfrom
TAT-3713-fix-fix-mobile-orderbook-price-tru
Aug 15, 2026
Merged

fix: order book kPEPE price is being cut#34845
abretonc7s merged 5 commits into
mainfrom
TAT-3713-fix-fix-mobile-orderbook-price-tru

Conversation

@abretonc7s

@abretonc7s abretonc7s commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

The Pro-mode order-book ladder cut the last digits off every price on low-priced markets: kPEPE
rendered $0.0026… on all ten rows, so no level could be told apart and the book was unusable
(TAT-3713).

The order-book column is a fixed 132px and each row split it into two equal halves, giving the
price 62px — one character short of the nine a sub-cent price needs ($0.002645 at the 1e-6
grouping step). The price string itself was already correct, so nothing about precision changes
here: the value column, which is compacted to K/M/B/T and never needs its full half, now sizes to
its content and the price takes the remainder. The same split applies to the column headers,
which is why Total (US… also reads in full again.

Changelog

CHANGELOG entry: Fixed the Pro order book cutting off the last digits of prices on low-priced
markets

Related issues

Fixes: TAT-3713

Manual testing steps

Feature: Pro order book ladder prices

  Scenario: user reads the order book of a sub-cent market
    Given the user is on the Perps market list with Pro mode enabled

    When user opens the kPEPE (or PUMP) market
    Then every order-book ladder row shows its full price, e.g. "$0.002655", not "$0.0026…"
    And the value column header reads "Total (USD)" instead of "Total (US…"

Screenshots/Recordings

Pro order-book ladder on two sub-cent markets, before and after: prices no longer stop at "$0.0026…".

kPEPE ladder prices readable end to end (and the Total header no longer cut)
Before
before
After
after
PUMP shows the same fix, so it is not kPEPE-specific
Before
before
After
after

Pre-merge author checklist

Performance checks (if applicable)

Validated on the iOS simulator; the change is shared JS (flexbox width allocation) with no
platform-specific branch, and it adds no work to the render path.

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Validation Recipe

missing: 0). Run: mm-harness run recipe.json --adapter mobile.

recipe.json
{
  "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
  "title": "Pro order book shows complete ladder prices (TAT-3713)",
  "description": "Opens the Pro-mode order book for two sub-cent markets (kPEPE, PUMP) and proves each ladder row renders its full price instead of an ellipsised one, while the 6-decimal ladder precision is unchanged.",
  "workflow": {
    "entry": "setup-status",
    "nodes": {
      "setup-status": {
        "action": "app.status",
        "intent": "Confirm the mobile bridge is reachable before touching the trading screens",
        "next": "setup-unlock"
      },
      "setup-unlock": {
        "action": "metamask.wallet.ensure_unlocked",
        "intent": "Reach an unlocked wallet so the Perps market screens can render",
        "next": "ac1-open-kpepe-market"
      },
      "ac1-open-kpepe-market": {
        "action": "ui.navigate",
        "page": "perps-market",
        "market": "kPEPE",
        "mode": "pro",
        "timeout_ms": 45000,
        "intent": "Reach the kPEPE Pro trading screen reported in the ticket",
        "next": "ac1-wait-order-book-visible"
      },
      "ac1-wait-order-book-visible": {
        "action": "ui.wait_for",
        "test_id": "perps-pro-market-order-book-panel",
        "expected": "visible",
        "timeout_ms": 30000,
        "intent": "The kPEPE order-book column occupies its place on the trading screen a trader looks at",
        "next": "ac1-wait-ladder-price"
      },
      "ac1-wait-ladder-price": {
        "action": "ui.wait_for",
        "test_id": "perps-pro-market-order-book-panel-bid-row-0-price",
        "expected": "present",
        "timeout_ms": 30000,
        "intent": "The kPEPE ladder has a first bid row with a price for the reader to compare against the screenshot",
        "next": "ac1-screenshot-kpepe-ladder"
      },
      "ac1-screenshot-kpepe-ladder": {
        "action": "ui.screenshot",

        "label": "AC1: kPEPE ladder prices readable end to end",
        "intent": "A trader reading the kPEPE order book sees every digit of each ladder price",
        "next": "ac2-open-pump-market"
      },
      "ac2-open-pump-market": {
        "action": "ui.navigate",
        "page": "perps-market",
        "market": "PUMP",
        "mode": "pro",
        "timeout_ms": 45000,
        "intent": "Reach a second sub-cent market to show the ticket is not kPEPE-specific",
        "next": "ac2-wait-order-book-visible"
      },
      "ac2-wait-order-book-visible": {
        "action": "ui.wait_for",
        "test_id": "perps-pro-market-order-book-panel",
        "expected": "visible",
        "timeout_ms": 30000,
        "intent": "The PUMP order-book column occupies its place on the trading screen a trader looks at",
        "next": "ac2-wait-ladder-price"
      },
      "ac2-wait-ladder-price": {
        "action": "ui.wait_for",
        "test_id": "perps-pro-market-order-book-panel-bid-row-0-price",
        "expected": "present",
        "timeout_ms": 30000,
        "intent": "The PUMP ladder has a first bid row with a price for the reader to compare against the screenshot",
        "next": "ac2-screenshot-pump-ladder"
      },
      "ac2-screenshot-pump-ladder": {
        "action": "ui.screenshot",

        "label": "AC2: PUMP ladder prices readable end to end",
        "intent": "A trader reading the PUMP order book sees every digit of each ladder price",
        "next": "ac3-run-panel-tests"
      },
      "ac3-run-panel-tests": {
        "action": "command",

        "timeout_ms": 600000,
        "intent": "Exercise the order-book panel unit suite that pins the ladder price text and its column allocation",
        "next": "ac3-assert-panel-tests"
      },
      "ac3-assert-panel-tests": {
        "action": "assert_exit_code",
        "source": "ac3-run-panel-tests",
        "expected": 0,
        "intent": "Prove the ladder still renders full 6-decimal prices and no longer squeezes them into half the column",
        "next": "ac3-index-test-log"
      },
      "ac3-index-test-log": {
        "action": "index_artifacts",
        "artifacts": [
          {

            "type": "log",
            "category": "evidence",
            "label": "AC3: order-book panel unit suite output"
          }
        ],
        "intent": "Register the unit-suite output as the state evidence for the unchanged price text",
        "next": "teardown-done"
      },
      "teardown-done": {
        "action": "end",
        "status": "pass"
      }
    }
  }
}

Recipe Workflow

workflow.mmd
flowchart TD
  setup-status["setup-status<br/>app.status"] --> setup-unlock["setup-unlock<br/>metamask.wallet.ensure_unlocked"]
  setup-unlock --> ac1-open["ac1-open-kpepe-market<br/>ui.navigate kPEPE (pro)"]
  ac1-open --> ac1-panel["ac1-wait-order-book-visible<br/>ui.wait_for visible"]
  ac1-panel --> ac1-price["ac1-wait-ladder-price<br/>ui.wait_for present"]
  ac1-price --> ac1-shot["ac1-screenshot-kpepe-ladder<br/>ui.screenshot"]
  ac1-shot --> ac2-open["ac2-open-pump-market<br/>ui.navigate PUMP (pro)"]
  ac2-open --> ac2-panel["ac2-wait-order-book-visible<br/>ui.wait_for visible"]
  ac2-panel --> ac2-price["ac2-wait-ladder-price<br/>ui.wait_for present"]
  ac2-price --> ac2-shot["ac2-screenshot-pump-ladder<br/>ui.screenshot"]
  ac2-shot --> ac3-tests["ac3-run-panel-tests<br/>command: jest panel suite"]
  ac3-tests --> ac3-assert["ac3-assert-panel-tests<br/>assert_exit_code 0"]
  ac3-assert --> ac3-index["ac3-index-test-log<br/>index_artifacts"]
  ac3-index --> done["teardown-done<br/>end: pass"]
Loading

Note

Cursor Bugbot is generating a summary for commit 1e2c3e1. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamask-ci metamask-ci Bot added the team-perps Perps team label Aug 14, 2026
@abretonc7s abretonc7s changed the title chore: prepare farmslot publication pkg-13a7d4e8-mst69qw1 fix: order book kPEPE price is being cut Aug 14, 2026
@abretonc7s
abretonc7s marked this pull request as ready for review August 14, 2026 23:12
@abretonc7s
abretonc7s requested a review from a team as a code owner August 14, 2026 23:12
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR contains two files:

  1. PerpsProOrderBookPanel.tsx: A targeted UI layout fix (TAT-3713) that changes CSS Tailwind classes for the order book price/value columns. The fix renames COLUMN_CLASS to PRICE_COLUMN_CLASS and changes VALUE_COLUMN_CLASS from flex-1 text-right to shrink-0 text-right so sub-cent prices (like kPEPE at $0.002645) are not ellipsized. Two testID attributes are added to column headers. This is a pure layout/display fix with no behavioral, data, or navigation changes.

  2. PerpsProOrderBookPanel.test.tsx: Unit tests (.test.tsx) verifying the layout fix - not E2E smoke specs.

Why no E2E tags are selected:

  • The SmokePerps E2E tests cover the Add Funds flow, balance verification, and multi-account setups — not the order book panel display or layout.
  • The change is isolated to a sub-component of PerpsProMarketView with no impact on navigation, controllers, shared infrastructure, or transaction flows.
  • The fix is a CSS class rename with no behavioral change that could break existing E2E test assertions.
  • SmokeWalletPlatform (Trending/Perps section) is not affected since this is a deep sub-component layout change that doesn't affect the Trending tab entry point or navigation.
  • No shared components (TabBar, modals, confirmations, browser) are touched.

The unit tests added in the test file adequately cover the layout fix at the component level.

Performance Test Selection:
The changes are purely CSS layout class modifications in a UI sub-component (PerpsProOrderBookPanel). No data fetching, rendering loops, controller logic, or performance-sensitive code paths were modified. The @PerformancePreps tag covers perps market loading and position management, but this layout fix has no measurable impact on those performance metrics.

View GitHub Actions results

@github-actions github-actions Bot added the risk:low AI analysis: low risk label Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Flaky unit test detection

Run history flaky detection

View recent run history

Historical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow.

Failures / runs sampled per window:

File 7d 15d 30d
app/components/UI/Perps/Views/PerpsProMarketView/components/PerpsProOrderBookPanel.test.tsx 0/136 0/178 0/374

AI-detected flaky patterns

app/components/UI/Perps/Views/PerpsProMarketView/components/PerpsProOrderBookPanel.test.tsx

  • J7 — Non-deterministic data: Date.now(), Math.random(), unstubbed network (medium)

This check is informational only and does not block merging.

@abretonc7s

Copy link
Copy Markdown
Contributor Author

Flaky-test detection triage:

  • J7 — Non-deterministic data (PerpsProOrderBookPanel.test.tsx:1): FALSE POSITIVE. The quoted snippet const id = Math.random().toString(); does not exist in the file. At the analyzed SHA (1e2c3e1a9e97ba8384fa71f8d3bc5aa1f9a9040f), grep -nE "Math\.random|Date\.now|new Date\(|setTimeout|fetch\(" over the file returns no match, and no added line in origin/main...HEAD introduces any of them. The only time value in the suite is the pinned lastUpdated: 1700000000000 fixture constant, which predates this PR.
  • No change made. Run history agrees: 0/136 (7d), 0/178 (15d), 0/374 (30d).

@sonarqubecloud

Copy link
Copy Markdown

@abretonc7s
abretonc7s added this pull request to the merge queue Aug 15, 2026
Merged via the queue into main with commit c0a4be3 Aug 15, 2026
111 checks passed
@abretonc7s
abretonc7s deleted the TAT-3713-fix-fix-mobile-orderbook-price-tru branch August 15, 2026 05:12
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 15, 2026
@metamask-ci metamask-ci Bot added the release-8.9.0 Issue or pull request that will be included in release 8.9.0 label Aug 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.9.0 Issue or pull request that will be included in release 8.9.0 risk:low AI analysis: low risk size-M team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants