Skip to content

Conversation

@michalconsensys
Copy link
Contributor

@michalconsensys michalconsensys commented Nov 6, 2025

Description

Adds a small-fee threshold to show "< $0.01" for fees below $0.01, improving readability and avoiding misleading precision.

Changelog

CHANGELOG entry: Display < $0.01 for small fees in Perps

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1970

Manual testing steps

Feature: Perps position transaction view fee display

  Scenario: user views transaction with small fee
    Given a user has a closed position transaction with a fee less than $0.01 (e.g., $0.005)
    When user views the transaction details screen
    Then the fee should display as "< $0.01" instead of the exact amount

Screenshots/Recordings

Before

IMG_EB5F710DB10B-1

After

Simulator Screenshot - iPhone 16e - 2025-11-07 at 11 04 09

Pre-merge author checklist

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.

Note

Introduces formatFee to show "< $0.01" for fees below $0.01 and updates Perps transaction views and tests to use it.

  • Utilities:
    • Add formatFee in app/components/UI/Perps/utils/formatUtils.ts to return "$0", "< $0.01", or formatted fiat; add comprehensive unit tests.
  • Views:
    • Replace ad-hoc fee formatting with formatFee in PerpsOrderTransactionView.tsx and PerpsPositionTransactionView.tsx; ensure unfilled orders show $0.
  • Tests:
    • Update and expand tests in transaction view specs to assert "< $0.01" behavior and edge cases; keep existing explorer navigation tests intact.

Written by Cursor Bugbot for commit cf07474. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

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.

@github-actions github-actions bot added the size-M label Nov 6, 2025
@michalconsensys michalconsensys added the team-perps Perps team label Nov 7, 2025
@michalconsensys michalconsensys marked this pull request as ready for review November 7, 2025 10:25
@michalconsensys michalconsensys requested a review from a team as a code owner November 7, 2025 10:25
@sonarqubecloud
Copy link

@nickewansmith nickewansmith added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit f0e76d0 Nov 10, 2025
82 of 84 checks passed
@nickewansmith nickewansmith deleted the fix/perps/fee-rounding branch November 10, 2025 22:01
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-M team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants