feat: migrate to QuoteResponseV2 - #33621
Conversation
682fe0f to
3485679
Compare
ec7e5ba to
7438c82
Compare
3485679 to
cc9559b
Compare
cc9559b to
600499b
Compare
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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 7f22c1e. Configure here.
a99cfda
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #33621 +/- ##
=======================================
Coverage 85.12% 85.12%
=======================================
Files 6350 6350
Lines 173080 173057 -23
Branches 42804 42783 -21
=======================================
- Hits 147333 147314 -19
+ Misses 15708 15705 -3
+ Partials 10039 10038 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Quality gates exceeded | 📹 Watch |
Seedless Onboarding: Telegram Login New User
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Quality gates exceeded | 📹 Watch |
🔬 App profiling check · Current run 31452794467 · Baseline (last run on main (scenario also failing)) run 30897750395 @ 67486d2
⚠️ No green baseline onmain— comparing against the latest usable profiling.
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 13.9% | 5.63% | -8.27 (-59.5%) |
| CPU max | 19.26% | 22.91% | +3.65 (+19%) |
| Memory avg | 441.69 MB | 609.93 MB | +168.24 (+38.1%) |
| Memory max | 592.47 MB | 851.66 MB | +259.19 (+43.8%) |
| Slow frames | 5.56% | 9.47% | +3.91 (+70.3%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 1 | 2 | +1 (+100%) |
| Critical issues | 1 | 2 | +1 (+100%) |
| App size | 328.67 MB | 329.17 MB | +0.5 (+0.2%) |
✅ Passed Tests (18)
| Test | Platform | Device | Duration | Team | Recording |
|---|---|---|---|---|---|
| Asset View, SRP 1 + SRP 2 + SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 3.43s | @assets-dev-team | 📹 Watch |
| Cross-chain swap flow - ETH to SOL - 50+ accounts, SRP 1 + SRP 2 + SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 5.72s | @swap-bridge-dev-team | 📹 Watch |
| Aggregated Balance Loading Time, SRP 1 + SRP 2 + SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 8.30s | @assets-dev-team | 📹 Watch |
| Swap flow - ETH to LINK, SRP 1 + SRP 2 + SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 2.32s | @swap-bridge-dev-team | 📹 Watch |
| Import SRP with +50 accounts, SRP 1, SRP 2, SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 5.72s | @Accounts-team | 📹 Watch |
| Cold Start: Measure ColdStart To Login Screen | Android | Google Pixel 8 Pro (v14.0) | 4.99s | @metamask-mobile-platform | 📹 Watch |
| Measure Warm Start: Warm Start to Login Screen | Android | Google Pixel 8 Pro (v14.0) | 0.54s | @metamask-mobile-platform | 📹 Watch |
| Measure Warm Start: Login To Wallet Screen | Android | Google Pixel 8 Pro (v14.0) | 1.53s | @metamask-mobile-platform | 📹 Watch |
| Perps add funds | Android | Google Pixel 8 Pro (v14.0) | 9.34s | @mm-perps-engineering-team | 📹 Watch |
| Predict Available Balance - Complete Flow Performance | Android | Google Pixel 8 Pro (v14.0) | 1.15s | @team-predict | 📹 Watch |
| Predict Deposit - Complete Flow Performance | Android | Google Pixel 8 Pro (v14.0) | 11.30s | @team-predict | 📹 Watch |
| Predict Market Details - Complete Flow Performance | Android | Google Pixel 8 Pro (v14.0) | 4.24s | @team-predict | 📹 Watch |
| Measure Cold Start To Onboarding Screen | Android | Google Pixel 8 Pro (v14.0) | 4.02s | @metamask-mobile-platform | 📹 Watch |
| Fresh SRP wallet creation performance | Android | Google Pixel 8 Pro (v14.0) | 11.85s | @metamask-onboarding-team | 📹 Watch |
| Account creation after fresh install | Android | Google Pixel 8 Pro (v14.0) | 3.44s | @metamask-onboarding-team | 📹 Watch |
| Perps open position and close it | Android | Google Pixel 8 Pro (v14.0) | 17.17s | @mm-perps-engineering-team | 📹 Watch |
| Seedless Onboarding: Apple Login New User | Android | Google Pixel 8 Pro (v14.0) | 14.37s | @metamask-onboarding-team | 📹 Watch |
| Seedless Onboarding: Google Login New User | Android | Google Pixel 8 Pro (v14.0) | 10.16s | @metamask-onboarding-team | 📹 Watch |
Branch: swaps-4546-quote-response-v2 · Build: E2E · Commit: bd3bf82 · View full run
fcf5538
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|




Description
This PR migrates QuoteResponseV1 usages in the batch-sell, swaps and quickBuy experiences to QuoteResponse (v2)
Changes
costmetadata withpriceImpactamountreferences withnormalizedAmountChangelog
CHANGELOG entry: feat: migrate to QuoteResponse V2 (phase 1)
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4607
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
High Risk
Large, user-facing change to quote parsing, fee display, gas sufficiency, and confirm/post-trade amounts across swap, bridge, and batch-sell; incorrect field mapping could misstate balances or block submissions.
Overview
Bridge, swap, quick-buy, and batch-sell code now consume
QuoteResponseV2 from the updated bridge controllers instead of V1 quotes plus separateQuoteMetadata.Data shape: Amounts and assets read from
quote.src/quote.dest(e.g.amount,normalizedAmount,minAmountNormalized) and top-levelchainId. Price impact usesquote.priceData.priceImpact.amount(and fiat from the quote). MetaMask fees usefeeData.metabridgeas an array;dest.assetreplaces flatdestAsset. Mocks build V2 quotes viatoQuoteResponseV2andmergeQuoteMetadata.Fees and balances: Network and gas checks aggregate
feeData.networkandfeeData.relayerwithsumAmounts(replacinggasFee.total/totalNetworkFeeon metadata). Gasless quote rows usefeeData.txFeefor included costs. Quote selector totals and batch-sell rollups use the same V2 paths.useBridgeConfirmand rewards estimation pass V2 src/dest amounts and fee assets.Matching and submission: Source/dest token matching compares CAIP
assetId/formatAddressToCaipReference. Batch-sell submission drops the old bridge-status type cast. Tests and fixtures are updated across Bridge views, modals, and hooks for the new shapes.Reviewed by Cursor Bugbot for commit fcf5538. Bugbot is set up for automated code reviews on this repo. Configure here.