Skip to content

feat(Rewards): Use correct source tokens for Ondo swaps when coming from Rewards#30419

Merged
VGR-GIT merged 1 commit into
mainfrom
rwds-ondo-swap-routing
May 20, 2026
Merged

feat(Rewards): Use correct source tokens for Ondo swaps when coming from Rewards#30419
VGR-GIT merged 1 commit into
mainfrom
rwds-ondo-swap-routing

Conversation

@Montoya

@Montoya Montoya commented May 20, 2026

Copy link
Copy Markdown
Contributor

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

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

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.

@Montoya Montoya requested a review from a team as a code owner May 20, 2026 03:58
@github-actions

Copy link
Copy Markdown
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.

@Montoya 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
@github-actions github-actions Bot added size-M and removed size-S labels May 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • 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:

  1. 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.

  2. 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.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@VGR-GIT VGR-GIT added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit d719f63 May 20, 2026
182 of 185 checks passed
@VGR-GIT VGR-GIT deleted the rwds-ondo-swap-routing branch May 20, 2026 09:56
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-M team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants