Skip to content

Conversation

@bergarces
Copy link
Contributor

@bergarces bergarces commented Nov 28, 2025

Description

Enable spot prices v3 by removing patch forcing a fallback.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1746

Manual testing steps

  1. Go to wallet page.
  2. Check that popular networks supported by price api use spot-prices v3 endpoint.

Screenshots/Recordings

Before

After

Pre-merge author checklist

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

Switches token price fetching to v3 using CAIP-19 asset IDs, updates all E2E/integration mocks and tests accordingly, adds mon currency, and lowercases account keys when storing token balances.

  • Prices API Migration:
    • Move from v2/chains/{chainId}/spot-prices to v3/spot-prices with assetIds (CAIP-19, e.g., eip155:1/slip44:60, eip155:1/erc20:<addr>).
    • Update all E2E and integration tests/mocks to use v3 endpoints and response shapes (assetIds, vsCurrency, includeMarketData).
  • Tests/Mocks:
    • Refactor helpers (mockSpotPrices, mockEmptyPrices, etc.) to v3.
    • Replace zero-address/native conventions with CAIP-19 IDs across specs.
    • Adjust onboarding, network, swaps, send, metrics, privacy, and settings tests to new API.
  • Controllers:
    • TokenBalancesController: store balances under lowercased account keys.
    • Token prices service: add mon to SUPPORTED_CURRENCIES.
  • Tooling:
    • Update yarn patch references and hashes.

Written by Cursor Bugbot for commit 21bfcd8. This will update automatically on new commits. Configure here.

@bergarces bergarces requested a review from a team as a code owner November 28, 2025 11:06
@github-actions
Copy link
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.

@metamaskbot
Copy link
Collaborator

metamaskbot commented Nov 28, 2025

✨ Files requiring CODEOWNER review ✨

🧪 @MetaMask/qa (1 files, +4 -9)
  • 📁 test/
    • 📁 e2e/
      • 📄 mock-e2e.js +4 -9

@bergarces bergarces changed the title enable spot prices v3 feat: enable spot prices v3 Nov 28, 2025
statusCode: 200,
json: {
'0x0000000000000000000000000000000000000000': {
'eip155:1/slip44:60': {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Hardcoded mainnet asset ID in price API mock

The spot prices mock is hardcoded to only respond to requests for eip155:1/slip44:60 (Ethereum mainnet), but tests run on various networks including localhost with chainId 1337. The chainId parameter passed to setupMocking is ignored, causing price API requests to fail for non-mainnet tests that don't provide a testSpecificMock. The mock should dynamically construct the asset ID based on the provided chainId parameter to support all test networks.

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

Builds ready [b288034]
UI Startup Metrics (1230 ± 100 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12301044166910012791410
load103986914489710871216
domContentLoaded103386314329610821208
domInteractive2616128212385
firstPaint57880125842110361165
backgroundConnect20719324610211229
firstReactRender29206083150
getState341995103947
initialActions105112
loadScripts8326681218948811003
setupStore1173751218
numNetworkReqs161076181071
BrowserifyPower User HomeuiStartup19741582268923820572482
load97384814181379771336
domContentLoaded96083213941379641326
domInteractive32161292629110
firstPaint64910014253889241338
backgroundConnect235186742109207534
firstReactRender6141139166799
getState19814568574210274
initialActions1011113
loadScripts77265312041347691143
setupStore19105592239
numNetworkReqs98602735690266
WebpackStandard HomeuiStartup8387001172878771000
load63556192471657798
domContentLoaded63155891970653788
domInteractive2615116222090
firstPaint23576805187210736
backgroundConnect206123251892
firstReactRender3120145183356
getState261353103345
initialActions103111
loadScripts62855690968650780
setupStore1154061224
numNetworkReqs161076181071
WebpackPower User HomeuiStartup16551332254024518642135
load70060697597711949
domContentLoaded69059696498701942
domInteractive40182584035141
firstPaint29091972210260899
backgroundConnect80955414921523
firstReactRender6347102106982
getState17413071859182231
initialActions104112
loadScripts68759495996699934
setupStore22957122449
numNetworkReqs96602815394251
FirefoxBrowserifyStandard HomeuiStartup14051132183315314781734
load1124963152110311861301
domContentLoaded1123963152110311861300
domInteractive753419533102119
firstPaint------
backgroundConnect60222264182149
firstReactRender25196072638
getState156194261133
initialActions103122
loadScripts108894613888811331263
setupStore177207271278
numNetworkReqs16965161263
BrowserifyPower User HomeuiStartup26621989478156228024195
load1242961281536512662535
domContentLoaded1241961281536512652534
domInteractive12034638117108435
firstPaint------
backgroundConnect130251221153114448
firstReactRender58352062257102
getState24039839176266682
initialActions2126323
loadScripts1193941263131612241823
setupStore1524726170172588
numNetworkReqs94522345382226
WebpackStandard HomeuiStartup17431400297421518362093
load14311188267118215021692
domContentLoaded14301188267118215021692
domInteractive76291853697151
firstPaint------
backgroundConnect67262574186147
firstReactRender29224043138
getState187231331436
initialActions103122
loadScripts13921162265117714461632
setupStore215168281797
numNetworkReqs16967151264
WebpackPower User HomeuiStartup30282313604777231334691
load15311179306648316502761
domContentLoaded15311179306648316502761
domInteractive1112849211096436
firstPaint------
backgroundConnect180231664248150911
firstReactRender62422682665100
getState27737955226327802
initialActions2034327
loadScripts14501152303841415642607
setupStore18061119221236708
numNetworkReqs95562475877233
📊 Page Load Benchmark Results

Current Commit: b288034 | Date: 11/28/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.09s (±116ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 780ms (±113ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.09s 116ms 1.01s 1.32s 1.31s 1.32s
domContentLoaded 780ms 113ms 700ms 1.01s 992ms 1.01s
firstPaint 77ms 10ms 56ms 148ms 88ms 148ms
firstContentfulPaint 77ms 10ms 56ms 148ms 88ms 148ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 1.11 KiB (0.01%)

@bergarces bergarces changed the title feat: enable spot prices v3 feat: enable spot-prices v3 Nov 28, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [21bfcd8]
UI Startup Metrics (1206 ± 86 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1206104014258612611350
load103086412118110841175
domContentLoaded102485911958010791169
domInteractive2515104202186
firstPaint5229112244019891164
backgroundConnect21219724610215236
firstReactRender30197093349
getState33158093847
initialActions106113
loadScripts81865798981872962
setupStore1161931217
numNetworkReqs161076181070
BrowserifyPower User HomeuiStartup19981596292927621352587
load980844154614310211371
domContentLoaded96683415161429981350
domInteractive33161712928108
firstPaint66812815563989301378
backgroundConnect246182784127213557
firstReactRender6039105146492
getState19114267660198276
initialActions104112
loadScripts77965813111388051159
setupStore1763872034
numNetworkReqs97602915690272
WebpackStandard HomeuiStartup855698101472900987
load65156783674718797
domContentLoaded64756282973708791
domInteractive2615139232284
firstPaint20984809154188725
backgroundConnect205135251696
firstReactRender36201592831127
getState271461123551
initialActions105112
loadScripts64456081972706789
setupStore1154051220
numNetworkReqs161077191073
WebpackPower User HomeuiStartup15941241227423918272039
load67058892081680890
domContentLoaded66057791282673883
domInteractive33161572729112
firstPaint28496905209318718
backgroundConnect89761016928564
firstReactRender6044101106480
getState16712922320177208
initialActions103112
loadScripts65757590480671874
setupStore21856122445
numNetworkReqs1046134960102266
FirefoxBrowserifyStandard HomeuiStartup12861047165213313691524
load1043892142010511001231
domContentLoaded1043891141910511001231
domInteractive67311643393135
firstPaint------
backgroundConnect54222463981118
firstReactRender23175552435
getState11614314924
initialActions102122
loadScripts101087313348710661149
setupStore1053761127
numNetworkReqs16864151263
BrowserifyPower User HomeuiStartup26911933495764327444202
load1222974293033512052095
domContentLoaded1222974293033512052095
domInteractive11933564119107470
firstPaint------
backgroundConnect148291605252128343
firstReactRender60371352063123
getState26068952192306740
initialActions213123
loadScripts1151958274725211361587
setupStore1765794199219661
numNetworkReqs94542485485223
WebpackStandard HomeuiStartup16421371227616716891935
load13341118169510113901529
domContentLoaded13341117169510113901529
domInteractive842833349104137
firstPaint------
backgroundConnect58182334162178
firstReactRender312279103247
getState206168301586
initialActions103122
loadScripts1302110016679313561463
setupStore2472143617101
numNetworkReqs16869161264
WebpackPower User HomeuiStartup31102084934796031854961
load15621208728572215152893
domContentLoaded15621207728572315152892
domInteractive11632619115106415
firstPaint------
backgroundConnect176291330233148935
firstReactRender67421301771107
getState298751081242404832
initialActions3067734
loadScripts14831184726066414422368
setupStore14111697160173581
numNetworkReqs95582395975226
📊 Page Load Benchmark Results

Current Commit: 21bfcd8 | Date: 11/28/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±66ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±63ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±14ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 66ms 1.01s 1.34s 1.29s 1.34s
domContentLoaded 733ms 63ms 699ms 1.02s 964ms 1.02s
firstPaint 78ms 14ms 64ms 196ms 92ms 196ms
firstContentfulPaint 78ms 14ms 64ms 196ms 92ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 1.11 KiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants