chore: deprioritize destination token in QuickBuy source preselection#31015
Conversation
|
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. |
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 466e48b. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
There are no dedicated E2E tests for QuickBuy/SocialLeaderboard specifically, so these are the closest relevant test suites. Confidence is moderate because the changes are isolated to QuickBuy components but touch bridge/swap infrastructure. Performance Test Selection: |

Description
QuickBuy was preselecting the same token the user intended to buy (SOL→SOL) because
selectDefaultSourceTokenhad no awareness of the destination token. This PR adds an optionaldestTokenparameter to that function: before running the four priority tiers (native-on-dest → any-on-dest → native-elsewhere → first), the destination token is filtered out of the candidate pool so a more useful holding is picked instead. If the user holds nothing else, the destination token is still returned as a last resort, keeping the picker non-empty while the Buy CTA remains disabled via the existing no-quotes path.Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-06-03.at.14.25.58.mov
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes default pay-with token logic, destination token resolution, and bridge quote token identity—core to trade execution—with broad new test coverage but real user-money impact if matching rules regress.
Overview
QuickBuy Pay with preselection now excludes the asset you are buying:
selectDefaultSourceTokentakes an optional destination token (address/chain, with a non-EVM symbol fallback only), waits until setup finishes so addresses match normalized CAIP/bare forms, and respects manual picker choices.Setup & stability:
useQuickBuySetupdecodes CAIP-19 positions (natives viagetNativeSourceToken, EVM bare hex for quotes).usePositionTokenBalanceno longer crashes on BTC/Tron. Buy-mode rate pills use a local dest token copy with market rate so quote/redux tokens stay stable.UI: Amount entry is slider-only (hidden keyboard path removed but props kept). Slider shows quarter marks at 25/50/75; exchange rates use locale-aware Intl formatting.
Reviewed by Cursor Bugbot for commit b4370c8. Bugbot is set up for automated code reviews on this repo. Configure here.