Skip to content

Comments

Add price impact warning to swap confirmation#5952

Merged
j0ntz merged 2 commits intodevelopfrom
jon/swap-price-impact-warning
Feb 21, 2026
Merged

Add price impact warning to swap confirmation#5952
j0ntz merged 2 commits intodevelopfrom
jon/swap-price-impact-warning

Conversation

@j0ntz
Copy link
Contributor

@j0ntz j0ntz commented Feb 18, 2026

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes

Dependencies

None

Description

Context

Asana: "Swap - Price Impact Warning" (P1). When users confirm a swap, the effective rate can differ significantly from the market rate due to liquidity depth, spread, and network fees. Without visibility into this, users may unknowingly accept unfavorable rates.

Changes

image image image
  • Calculate price impact by comparing the fiat value of the quote's from/to amounts against market exchange rates, using biggystring for precision
  • Display the price impact percentage inline next to the fiat price in the TO card, color-coded by severity:
    • Grey (deactivatedText): < 5%
    • Orange (warningText): 5–15%
    • Red (dangerText): > 15%
  • Show a warning card when price impact exceeds 5%:
    • Price impact only: Dedicated warning about unfavorable market rate
    • Price impact + high fee: Combined card explaining that high network fees contribute to the poor effective rate
    • High fee only: Existing fee warning behavior preserved
  • Price impact warning takes precedence over the "Estimated Quote" warning when both apply (since "Estimated Quote" is rendered at the bottom, this prevents showing two warnings, and this warning trumps in severity, anyway)
  • Fix pre-existing lint warnings in SwapConfirmationScene and ExchangeQuoteComponent (render function return types, deprecated currencyCode usage)
  • Graduate CurrencyRow.tsx from eslint warning-override list

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@j0ntz j0ntz force-pushed the jon/swap-price-impact-warning branch 2 times, most recently from e5a4fcc to 88b683a Compare February 18, 2026 23:47
@j0ntz j0ntz force-pushed the jon/swap-price-impact-warning branch 4 times, most recently from 7685652 to a41f4d6 Compare February 19, 2026 02:17
@j0ntz j0ntz changed the title Implement Price Impact Warning in Swap Confirmation Add price impact warning to swap confirmation Feb 19, 2026
Calculate price impact by comparing quote fiat values against market
rates. Display the percentage inline next to the fiat price in the
TO card, colored by severity (grey <5%, orange 5-15%, red >15%).

Show warning cards based on price impact and fee warning state:
- Price impact only: dedicated warning card
- Both price impact and fee warning: combined card replaces fee warning
- Fee warning only: existing behavior preserved
@j0ntz j0ntz force-pushed the jon/swap-price-impact-warning branch from a41f4d6 to 2d188a4 Compare February 21, 2026 23:03
@j0ntz j0ntz merged commit 95851fe into develop Feb 21, 2026
2 of 3 checks passed
@j0ntz j0ntz deleted the jon/swap-price-impact-warning branch February 21, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants