Skip to content

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Oct 28, 2025

Description

Fix percentage buttons in Perps deposit, by converting balance to USD if required.

Partial cherry-pick of #21529 for 7.58.0.

Changelog

CHANGELOG entry: null

Related issues

Fixes: #21751

Manual testing steps

Screenshots/Recordings

Before

After

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

Percentage buttons now compute amounts from fiat-converted balance (handles USD override for perps deposits) with supporting tests.

  • Hooks:
    • useTransactionCustomAmount: use useTransactionPayFiat.convertFiat to derive payTokenBalance in useTokenBalance, ensuring percentage calculations use the selected fiat (e.g., USD override for perps deposits).
  • Tests:
    • useTransactionCustomAmount.test.ts: add CurrencyRateController mock data and a test verifying percentage calculation converts to USD for TransactionType.perpsDeposit.

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

@matthewwalsh0 matthewwalsh0 added team-confirmations Push issues to confirmations team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Oct 28, 2025
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review October 28, 2025 14:28
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner October 28, 2025 14:28
@matthewwalsh0 matthewwalsh0 changed the title fix: (cp-7.58.0) percentage buttons in perps deposit fix: cp-7.58.0 percentage buttons in perps deposit Oct 28, 2025
@github-actions
Copy link
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.

@matthewwalsh0 matthewwalsh0 force-pushed the fix/perps-deposit-percentage-alternate-currency branch from 62cd8ed to 9561b32 Compare October 29, 2025 17:20
@sonarqubecloud
Copy link

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cal-L Cal-L merged commit f7d0f56 into release/7.58.0 Oct 29, 2025
135 of 142 checks passed
@Cal-L Cal-L deleted the fix/perps-deposit-percentage-alternate-currency branch October 29, 2025 20:55
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants