feat: auto slippage support for RWA tokens cp-7.76.0#29592
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 74a79f7. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29592 +/- ##
==========================================
- Coverage 82.15% 81.84% -0.32%
==========================================
Files 5178 5245 +67
Lines 137450 138671 +1221
Branches 31079 31456 +377
==========================================
+ Hits 112924 113494 +570
- Misses 16875 17453 +578
- Partials 7651 7724 +73 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag Selection Rationale:
The changes are additive (new RWA feature support) and don't modify existing non-RWA swap logic, so the risk is medium. The changes are well-tested with unit tests. No navigation, Engine, or controller architecture changes are involved. Performance Test Selection: |
|




Description
This PR adds support for auto slippage for RWA tokens
COW swap liquidity is volatile and to address it, cow swap provides dynamic slippage suggestion service in there SDK.
Bridge api is using it. On extension and mobile, we are providing auto option by default when one or both tokens are RWA (same is implemented for solana tokens)
When it is auto, dynamic slippage is applied.
We also want user to have freedom to choose slippage. Hence we have kept existing options to choose along with auto.
Changelog
CHANGELOG entry: Added auto slippage support for RWA tokens
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 slippage behavior for same-chain EVM swaps when a stock-class RWA token is involved, which can affect quote execution outcomes and UX. Risk is mitigated by gating on the RWA remote feature flag and adding targeted unit/integration tests.
Overview
Adds a new
selectIsRwaSwapselector (same-chain EVM + stock RWA token + RWA flag enabled) and uses it to treat those swaps like Solana same-chain swaps for slippage.When
selectIsRwaSwapis true,useInitialSlippagenow initializes slippage toDEFAULT_SLIPPAGE_RWA(undefined → provider dynamic slippage) anduseSlippageConfiginjects anautopreset (['auto','0.5','2']) into the slippage options.Refactors stock-RWA detection into shared
isStockRwaBridgeToken, forwardsrwaDatathrough Token Details swap navigation, and adds/updates tests covering the new selector and slippage behavior (including a BridgeView RWA swap case).Reviewed by Cursor Bugbot for commit 2bec59e. Bugbot is set up for automated code reviews on this repo. Configure here.