You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change pre-fills the correct source token when attempting to swap into Ondo assets from the Rewards campaign.
Changelog
CHANGELOG entry: made it easier to get started swapping Ondo GM assets from Rewards
Related issues
Fixes: n/a
Manual testing steps
Feature: my feature nameScenario: user [verb for user action]Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
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
Medium Risk
Changes the token preselection logic passed into goToSwaps for Rewards-driven Ondo swaps, which can impact swap routing and user balances if chain/token mapping is wrong. Scope is contained to the Ondo RWA selector and covered by updated unit tests.
Overview
Improves Rewards → Ondo open position flow by choosing an appropriate prefilled swap source token based on the selected destination asset’s chain: prefer USDY on Ethereum when the user holds a balance, otherwise fall back to a per-chain default (USDC on eip155:1, USDT on eip155:56).
Updates the selector and after-hours confirmation paths to pass this computed source into goToSwaps, and revises tests/mocks to validate chain-aware defaults and remove the previous “undefined source” expectations.
Reviewed by Cursor Bugbot for commit b1019e7. Bugbot is set up for automated code reviews on this repo. Configure here.
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.
Montoya
changed the title
feat: Use correct source tokens for Ondo swaps when coming from Rewards
feat(Rewards): Use correct source tokens for Ondo swaps when coming from Rewards
May 20, 2026
Selected Performance tags: None (no tests recommended)
Risk Level: low
AI Confidence: 90%
click to see 🤖 AI reasoning details
E2E Test Selection:
The changes are confined to two files within the Rewards/Ondo RWA campaign feature:
OndoCampaignRwaSelectorView.tsx: Expands the source token preselection logic for open_position mode. Previously only USDY on Ethereum mainnet was used as a source token; now a chain-specific fallback map (ONDO_OPEN_POSITION_SOURCE_TOKENS) provides USDC on Ethereum mainnet and USDT on BNB Chain when the user doesn't hold USDY. The goToSwaps call is updated in both the direct token selection path and the after-hours pending token flow.
OndoCampaignRwaSelectorView.test.tsx: Unit test updates to match the new behavior — updated mocks to properly parse CAIP-19 asset IDs and revised test cases to validate chain-specific source token fallback logic.
Why no E2E tags are selected:
No E2E tests exist in the codebase for the Rewards/Ondo RWA campaign feature (confirmed via grep searches)
The changes are self-contained within the Rewards module with no impact on shared infrastructure (TabBar, navigation, modals, confirmations)
The component is only imported by RewardsNavigator.tsx — a specialized navigator not part of core wallet flows
The logic change is purely about which source token is pre-populated when navigating to swaps — it doesn't change the swap flow itself
Comprehensive unit test coverage is provided for the new behavior
Risk is low: feature-specific UI change with no shared component impact
Performance Test Selection:
The changes are limited to source token preselection logic in a specialized Rewards/Ondo campaign UI component. There are no rendering performance concerns, no list rendering changes, no state management changes, and no impact on critical user flows like login, balance loading, or app startup. No performance tests are warranted.
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
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.
Description
This change pre-fills the correct source token when attempting to swap into Ondo assets from the Rewards campaign.
Changelog
CHANGELOG entry: made it easier to get started swapping Ondo GM assets from Rewards
Related issues
Fixes: n/a
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 the token preselection logic passed into
goToSwapsfor Rewards-driven Ondo swaps, which can impact swap routing and user balances if chain/token mapping is wrong. Scope is contained to the Ondo RWA selector and covered by updated unit tests.Overview
Improves Rewards → Ondo open position flow by choosing an appropriate prefilled swap source token based on the selected destination asset’s chain: prefer USDY on Ethereum when the user holds a balance, otherwise fall back to a per-chain default (
USDConeip155:1,USDToneip155:56).Updates the selector and after-hours confirmation paths to pass this computed source into
goToSwaps, and revises tests/mocks to validate chain-aware defaults and remove the previous “undefined source” expectations.Reviewed by Cursor Bugbot for commit b1019e7. Bugbot is set up for automated code reviews on this repo. Configure here.