feat: read swap cost priceData from bridge-api response - #10012
Merged
Conversation
micaelae
force-pushed
the
swap-cost-metadata
branch
from
August 31, 2026 18:21
2904447 to
abc8c12
Compare
micaelae
marked this pull request as ready for review
August 31, 2026 18:52
micaelae
enabled auto-merge
August 31, 2026 18:55
micaelae
disabled auto-merge
August 31, 2026 18:58
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 639e999. Configure here.
micaelae
force-pushed
the
swap-cost-metadata
branch
from
August 31, 2026 19:04
639e999 to
d6091c6
Compare
micaelae
enabled auto-merge
August 31, 2026 19:07
infiniteflower
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
This change reads the
costmetadata provided by the backend and uses it to sort quotes:Other changes
priceImpactis no longer used as the quotecostReferences
Checklist
Note
Medium Risk
Changes recommended-quote selection and displayed cost metadata in swap/bridge flows; incorrect backend cost data could surface the wrong quote, but scope is limited to quote presentation and sorting.
Overview
Bridge quotes now consume
priceData.costfrom the bridge API instead of treatingpriceImpactas cost. Quote validation, fiat conversion (toCurrencyValues), and V1/V2 metadata mappers were updated socostis a distinct field onpriceDataand on merged quote metadata.Default quote ordering prefers ascending
priceData.cost.valueInCurrencywhen every quote has it; otherwise it keeps the existing fallbacks (priceImpact.amount, thenpriceImpact.valueInCurrency, then destination amount). That changes which quote is recommended when the API sendscost.Tests and snapshots were extended for the new sort priority, Phase 1.5 fallbacks, and related selector edge cases.
Reviewed by Cursor Bugbot for commit d6091c6. Bugbot is set up for automated code reviews on this repo. Configure here.