Skip to content

feat: new assets controller aggregated balance#40239

Merged
salimtb merged 9 commits intomainfrom
feat/use-new-state-for-aggregated-balance
Feb 24, 2026
Merged

feat: new assets controller aggregated balance#40239
salimtb merged 9 commits intomainfrom
feat/use-new-state-for-aggregated-balance

Conversation

@salimtb
Copy link
Contributor

@salimtb salimtb commented Feb 19, 2026

Description

use new state for aggregated balance

Open in GitHub Codespaces

Changelog

CHANGELOG entry: use new state for aggregated balance

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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

Medium Risk
Changes balance computation/display paths and introduces new state-derived selectors, which could affect shown totals across networks/accounts if inputs or aggregation assumptions differ from the legacy path.

Overview
Updates the account group balance display to prefer the new AssetsController aggregated fiat total (selectAggregatedBalanceForSelectedAccount) when available, falling back to the legacy account-group total and keeping native/testnet display behavior unchanged.

Adds new assets-state selectors (getAssetsInfo, getAssetsBalance, getAssetsPrice, getAssetPreferences, getCustomAssets) plus a memoized aggregated-balance selector that calls getAggregatedBalanceForAccount, and expands unit tests to cover the new selector and additional UI states (privacy masking, cached-balance styling, skeleton behavior, and aggregated-balance rendering).

Updates LavaMoat MV3 policies to allow the new @metamask/assets-controller package (and its bignumber.js dependency) across main, beta, flask, and experimental builds.

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

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

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 19, 2026

✨ Files requiring CODEOWNER review ✨

💎 @MetaMask/metamask-assets (2 files, +100 -4)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 assets/
          • 📁 account-group-balance/
            • 📄 account-group-balance.test.tsx +78 -3
            • 📄 account-group-balance.tsx +22 -1

📜 @MetaMask/policy-reviewers (4 files, +48 -0)
  • 📁 lavamoat/
    • 📁 webpack/
      • 📁 mv3/
        • 📁 beta/
          • 📄 policy.json +12 -0
        • 📁 experimental/
          • 📄 policy.json +12 -0
        • 📁 flask/
          • 📄 policy.json +12 -0
        • 📁 main/
          • 📄 policy.json +12 -0

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.

@salimtb salimtb force-pushed the feat/use-new-state-for-aggregated-balance branch from 8e9b42a to 08174b1 Compare February 23, 2026 01:29
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

Builds ready [08174b1]
⚡ Performance Benchmarks (1375 ± 101 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account3025301311
total3025301311
Confirm Txconfirm_tx60461760596063
total60461760596063
Bridge User Actionsbridge_load_page21522222256
bridge_load_asset_picker23625240274
bridge_search_token72820747753
total11653511911203
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13751178167910114151565
load116998213858912171349
domContentLoaded116297613648812141330
domInteractive271696192381
firstPaint1416538277204277
backgroundConnect20519225713206234
firstReactRender19144251925
initialActions106113
loadScripts97278611738810191143
setupStore1373351623
numNetworkReqs322292202586
Chrome Browserify Startup Power User HomeuiStartup16621342235216217211985
load11251019176413311161486
domContentLoaded11091012172912311061408
domInteractive3018126173155
firstPaint187621417151237326
backgroundConnect27524939423280323
firstReactRender23145182640
initialActions104113
loadScripts90981714941209041211
setupStore1585671627
numNetworkReqs59351532458128
Chrome Webpack Startup Standard HomeuiStartup------
load------
domContentLoaded------
domInteractive------
firstPaint------
backgroundConnect------
firstReactRender------
initialActions------
loadScripts------
setupStore------
numNetworkReqs------
Chrome Webpack Startup Power User HomeuiStartup------
load------
domContentLoaded------
domInteractive------
firstPaint------
backgroundConnect------
firstReactRender------
initialActions------
loadScripts------
setupStore------
numNetworkReqs------
Firefox Browserify Startup Standard HomeuiStartup16641461256817216611981
load14001204206413014161606
domContentLoaded13991198206413114151606
domInteractive863425544118147
firstPaint------
backgroundConnect6126382405790
firstReactRender13111711416
initialActions103112
loadScripts13721179203212013921569
setupStore2171593015117
numNetworkReqs3322102212792
Firefox Browserify Startup Power User HomeuiStartup27912196449642929283655
load16281355242430717542323
domContentLoaded16281355242430717542323
domInteractive13435762136115440
firstPaint------
backgroundConnect264110938222235876
firstReactRender201570111827
initialActions203122
loadScripts15911336236229517082281
setupStore1388775191118588
numNetworkReqs62301623690137
Firefox Webpack Startup Standard HomeuiStartup17101393355632017082040
load14391202277824414451633
domContentLoaded14381202277724414421632
domInteractive112281497148130180
firstPaint------
backgroundConnect7125161315766112
firstReactRender15123241525
initialActions102012
loadScripts14131182275324214221598
setupStore236374441463
numNetworkReqs322080162976
Firefox Webpack Startup Power User HomeuiStartup26491976389444327853668
load15611269261529216642122
domContentLoaded15601268261529216642122
domInteractive11633763123109368
firstPaint------
backgroundConnect2671191419218250870
firstReactRender20143242228
initialActions204123
loadScripts15271246255528116282097
setupStore1468734199161648
numNetworkReqs62252064389143
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2171218219
srpButtonToSrpForm9219293
confirmSrpToPwForm2202222
pwFormToMetricsScreen40234380
metricsToWalletReadyScreen1601617
doneButtonToHomeScreen59427584639
openAccountMenuToAccountListLoaded744850978547900
total846845188438848
Onboarding New WalletcreateWalletToSocialScreen2181218218
srpButtonToPwForm1031105105
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3413535
agreeButtonToOnboardingSuccess1501616
doneButtonToAssetList59912613613
total97512990990
Asset DetailsassetClickToPriceChart3603737
total3603737
Solana Asset DetailsassetClickToPriceChart3133036
total3133036
Import Srp HomeloginToHomeScreen215310022652285
openAccountMenuAfterLogin3933943
homeAfterImportWithNewWallet217016523422379
total44453744794486
Send TransactionsopenSendPageFromHome30113940
selectTokenToSendFormLoaded1912021
reviewTransactionToConfirmationPage9997310601083
total10516910941141
SwapopenSwapPageFromHome1266130133
fetchAndDisplaySwapQuotes46286046104728
total47646247674861
🌐 Dapp Page Load Benchmarks

Current Commit: 08174b1 | Date: 2/23/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±40ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±37ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±14ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 40ms 1.03s 1.34s 1.09s 1.34s
domContentLoaded 734ms 37ms 711ms 1.00s 760ms 1.00s
firstPaint 79ms 14ms 64ms 204ms 88ms 204ms
firstContentfulPaint 79ms 14ms 64ms 204ms 88ms 204ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -279.76 KiB (-6.35%)
  • ui: 153.34 KiB (1.87%)
  • common: 439.75 KiB (4.02%)

@salimtb
Copy link
Contributor Author

salimtb commented Feb 23, 2026

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

👀 lavamoat/browserify/beta/policy.json changes differ from main/policy.json policy changes
👀 lavamoat/browserify/experimental/policy.json changes differ from main/policy.json policy changes
👀 lavamoat/browserify/flask/policy.json changes differ from main/policy.json policy changes
👀 lavamoat/webpack/mv2/beta/policy.json changes differ from mv2/main/policy.json policy changes
👀 lavamoat/webpack/mv2/experimental/policy.json changes differ from mv2/main/policy.json policy changes
👀 lavamoat/webpack/mv2/flask/policy.json changes differ from mv2/main/policy.json policy changes
👀 lavamoat/webpack/mv3/beta/policy.json changes differ from mv3/main/policy.json policy changes
👀 lavamoat/webpack/mv3/experimental/policy.json changes differ from mv3/main/policy.json policy changes
👀 lavamoat/webpack/mv3/flask/policy.json changes differ from mv3/main/policy.json policy changes

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

Builds ready [193a955]
⚡ Performance Benchmarks (1353 ± 98 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account32015331336
total32015331336
Confirm Txconfirm_tx60542060646087
total60542060646087
Bridge User Actionsbridge_load_page23335257283
bridge_load_asset_picker2077208217
bridge_search_token72418739740
total11766212351240
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup1353116215809813851532
load114196013658711761302
domContentLoaded113595813578711731297
domInteractive2615103192384
firstPaint1356736369195261
backgroundConnect20118633417200229
firstReactRender18122831924
initialActions107113
loadScripts9507681172889881108
setupStore1263651419
numNetworkReqs3122101202287
Chrome Browserify Startup Power User HomeuiStartup16581376246515217151918
load1093953167413510811426
domContentLoaded1078945166913210641409
domInteractive3017139193172
firstPaint1806439274234292
backgroundConnect28925541021302323
firstReactRender23164472639
initialActions106113
loadScripts87075714531318601197
setupStore1576391537
numNetworkReqs56351502354119
Chrome Webpack Startup Standard HomeuiStartup81966511641058601047
load69858798790757858
domContentLoaded69358298289751853
domInteractive2716134232379
firstPaint1195775785145233
backgroundConnect25165372839
firstReactRender18114262033
initialActions104112
loadScripts69058098089749846
setupStore1154151121
numNetworkReqs3122110232597
Chrome Webpack Startup Power User HomeuiStartup1224846212616613161482
load7186451265109705989
domContentLoaded7096381248108696984
domInteractive34181432535101
firstPaint1356644874162266
backgroundConnect17413036248166285
firstReactRender23163532528
initialActions102011
loadScripts7066361238106694973
setupStore1454571532
numNetworkReqs1003425751135209
Firefox Browserify Startup Standard HomeuiStartup17901509279326318032270
load15211266255324115601873
domContentLoaded15201266255224115601872
domInteractive131381164183142238
firstPaint------
backgroundConnect6133187236290
firstReactRender14121811416
initialActions103122
loadScripts14921238252523915281839
setupStore198158241645
numNetworkReqs311993192784
Firefox Browserify Startup Power User HomeuiStartup26592083376332027623323
load15791345223723116212080
domContentLoaded15791339223723116212075
domInteractive12337728119117330
firstPaint------
backgroundConnect21199903172187784
firstReactRender1814129111820
initialActions2145422
loadScripts15391328218722015652043
setupStore1306731174124545
numNetworkReqs59251513678137
Firefox Webpack Startup Standard HomeuiStartup17521450326132117642192
load14641230277625014881722
domContentLoaded14631230277625014881722
domInteractive100291455143128141
firstPaint------
backgroundConnect7828146914470174
firstReactRender16122831624
initialActions103122
loadScripts14391208274624914691670
setupStore187151231449
numNetworkReqs311997192788
Firefox Webpack Startup Power User HomeuiStartup28421997823084829383806
load16971270690775417382438
domContentLoaded16971270690675417362438
domInteractive131331131158117525
firstPaint------
backgroundConnect274113922206257859
firstReactRender22157472531
initialActions203122
loadScripts16561248687075017112125
setupStore1248746165124515
numNetworkReqs57261473587125
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212222225
srpButtonToSrpForm9719899
confirmSrpToPwForm2312424
pwFormToMetricsScreen1711818
metricsToWalletReadyScreen1701818
doneButtonToHomeScreen88831712011336
openAccountMenuToAccountListLoaded752931678257841
total87871988038803
Onboarding New WalletcreateWalletToSocialScreen2181219220
srpButtonToPwForm1094111117
createPwToRecoveryScreen9089
skipBackupToMetricsScreen3613637
agreeButtonToOnboardingSuccess1701717
doneButtonToAssetList92833013161316
total131933017001707
Asset DetailsassetClickToPriceChart3924141
total3924141
Solana Asset DetailsassetClickToPriceChart4714747
total4714747
Import Srp HomeloginToHomeScreen19174919461977
openAccountMenuAfterLogin4374754
homeAfterImportWithNewWallet25461425642564
total470533349825218
Send TransactionsopenSendPageFromHome4114141
selectTokenToSendFormLoaded2002020
reviewTransactionToConfirmationPage8505853857
total9093911913
SwapopenSwapPageFromHome1225122129
fetchAndDisplaySwapQuotes45872145934619
total47182447344748
🌐 Dapp Page Load Benchmarks

Current Commit: 193a955 | Date: 2/23/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±37ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 729ms (±35ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±12ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 37ms 1.02s 1.33s 1.08s 1.33s
domContentLoaded 729ms 35ms 708ms 989ms 756ms 989ms
firstPaint 79ms 12ms 68ms 192ms 88ms 192ms
firstContentfulPaint 79ms 12ms 68ms 192ms 88ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -213.89 KiB (-4.93%)
  • ui: 1.93 KiB (0.02%)
  • common: 213.97 KiB (1.91%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 24, 2026

Builds ready [ee7fe0f]
⚡ Performance Benchmarks (1401 ± 113 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account30029316335
total30029316335
Confirm Txconfirm_tx60704760856150
total60704760856150
Bridge User Actionsbridge_load_page2311233233
bridge_load_asset_picker23045256283
bridge_search_token75966836844
total121912513231400
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup14011170189711314641581
load1186994161510412441370
domContentLoaded1180990160410212381356
domInteractive2815125212481
firstPaint1436641178202261
backgroundConnect20819031016211236
firstReactRender20124462135
initialActions108114
loadScripts988800139410210471166
setupStore1366371621
numNetworkReqs312293202284
Chrome Browserify Startup Power User HomeuiStartup17031395220614517571934
load11341030175613511281470
domContentLoaded11191019166212611141426
domInteractive3218129173459
firstPaint179731676170233302
backgroundConnect28725642626296319
firstReactRender23155172540
initialActions104112
loadScripts91282314511249091220
setupStore1574671732
numNetworkReqs57291452355119
Chrome Webpack Startup Standard HomeuiStartup83669511371018671057
load71161798985750876
domContentLoaded70561298084743869
domInteractive271591202387
firstPaint1076025548126197
backgroundConnect28195873141
firstReactRender19113562131
initialActions106113
loadScripts70361097883742861
setupStore1263241320
numNetworkReqs3122101212590
Chrome Webpack Startup Power User HomeuiStartup1205932191916612941574
load7166301216109708973
domContentLoaded7066151209109694967
domInteractive37191823035109
firstPaint1326852377140262
backgroundConnect17713234345199275
firstReactRender22163432329
initialActions102011
loadScripts7036121197107692958
setupStore1454771434
numNetworkReqs1013626052135211
Firefox Browserify Startup Standard HomeuiStartup16781376275623616802136
load14221176253821214301877
domContentLoaded14201176253821314271876
domInteractive93341311129113148
firstPaint------
backgroundConnect5828279295991
firstReactRender14112421417
initialActions102112
loadScripts13961160252021014051851
setupStore16657101546
numNetworkReqs321997202589
Firefox Browserify Startup Power User HomeuiStartup27882060382942129703718
load16481278250030918022393
domContentLoaded16471273249530918022393
domInteractive152361116182115556
firstPaint------
backgroundConnect2781111301268217908
firstReactRender201475111824
initialActions102122
loadScripts16091263247529817282351
setupStore1417758209146652
numNetworkReqs59291463682140
Firefox Webpack Startup Standard HomeuiStartup16971401351423217191980
load14401226315619914591623
domContentLoaded14401226315519914591623
domInteractive983131853130194
firstPaint------
backgroundConnect58261882962109
firstReactRender16125151625
initialActions103122
loadScripts14141204309619414341593
setupStore207165231750
numNetworkReqs312094182779
Firefox Webpack Startup Power User HomeuiStartup27972085445748528233961
load16531358305035117102435
domContentLoaded16521357305035117102434
domInteractive13333796147115504
firstPaint------
backgroundConnect238108913160232579
firstReactRender22176662430
initialActions218123
loadScripts16011336264730916662284
setupStore20910828253280764
numNetworkReqs57251823586119
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2180219219
srpButtonToSrpForm9229294
confirmSrpToPwForm2102122
pwFormToMetricsScreen1501516
metricsToWalletReadyScreen1601616
doneButtonToHomeScreen91535012841384
openAccountMenuToAccountListLoaded759921776707835
total87649487798891
Onboarding New WalletcreateWalletToSocialScreen2181218219
srpButtonToPwForm1053108108
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3523637
agreeButtonToOnboardingSuccess1601616
doneButtonToAssetList56185616672
total9448810011057
Asset DetailsassetClickToPriceChart49186277
total49186277
Solana Asset DetailsassetClickToPriceChart6226365
total6226365
Import Srp HomeloginToHomeScreen19105419151993
openAccountMenuAfterLogin4324345
homeAfterImportWithNewWallet24198924412552
total43724143734438
Send TransactionsopenSendPageFromHome1811719
selectTokenToSendFormLoaded2122124
reviewTransactionToConfirmationPage8547860862
total9002902902
SwapopenSwapPageFromHome12418130154
fetchAndDisplaySwapQuotes45862445884624
total47033447184752
🌐 Dapp Page Load Benchmarks

Current Commit: ee7fe0f | Date: 2/24/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±37ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 715ms (±35ms) 🟢 | historical mean value: 729ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±13ms) 🟢 | historical mean value: 82ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 37ms 1.00s 1.32s 1.05s 1.32s
domContentLoaded 715ms 35ms 697ms 983ms 735ms 983ms
firstPaint 76ms 13ms 60ms 188ms 84ms 188ms
firstContentfulPaint 76ms 13ms 60ms 188ms 84ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -266.12 KiB (-6.12%)
  • ui: 1.99 KiB (0.02%)
  • common: 266.19 KiB (2.39%)

@salimtb salimtb marked this pull request as ready for review February 24, 2026 10:27
@salimtb salimtb requested review from a team as code owners February 24, 2026 10:27
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 24, 2026

Builds ready [d683260]
⚡ Performance Benchmarks (1388 ± 118 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28420293318
total28420293318
Confirm Txconfirm_tx60841760926105
total60841760926105
Bridge User Actionsbridge_load_page22132254265
bridge_load_asset_picker21122221239
bridge_search_token72213734741
total11412411591170
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13881150183511814281598
load1180976150510712251366
domContentLoaded1172973150110512201362
domInteractive271794182477
firstPaint167681252165196319
backgroundConnect20518725313208232
firstReactRender18133241925
initialActions105113
loadScripts984781128210310351177
setupStore1273351621
numNetworkReqs312293202286
Chrome Browserify Startup Power User HomeuiStartup2878133810107198637558719
load12081033184914912361533
domContentLoaded11901021183314512201484
domInteractive3619363383291
firstPaint1917846789259307
backgroundConnect10882567861155615293792
firstReactRender25175872838
initialActions106113
loadScripts983819156413710131261
setupStore1563561626
numNetworkReqs79391532393119
Chrome Webpack Startup Standard HomeuiStartup88373612521179301140
load7516181045102792935
domContentLoaded7466131037101783925
domInteractive3016131222579
firstPaint1176139760142217
backgroundConnect28195473144
firstReactRender19123562231
initialActions103112
loadScripts7436111035100781923
setupStore1262841318
numNetworkReqs312298202587
Chrome Webpack Startup Power User HomeuiStartup1209863219422212751585
load724636104895719981
domContentLoaded713631103796708977
domInteractive38191632837119
firstPaint1436548074178278
backgroundConnect1911281139162161304
firstReactRender21163632326
initialActions101011
loadScripts710629102994706967
setupStore1355661422
numNetworkReqs1325324040156211
Firefox Browserify Startup Standard HomeuiStartup16401425219315616531985
load13841196173311314131676
domContentLoaded13841196173311314121675
domInteractive81372173796141
firstPaint------
backgroundConnect61342253157129
firstReactRender13111911315
initialActions102012
loadScripts1352117217089613881531
setupStore2171773015100
numNetworkReqs3219101222796
Firefox Browserify Startup Power User HomeuiStartup29362273864083130263437
load16451319697075615901969
domContentLoaded16441319696975615901969
domInteractive15439666109187371
firstPaint------
backgroundConnect44513113572795781019
firstReactRender18147881822
initialActions103122
loadScripts16041301692975515391918
setupStore16811983213223641
numNetworkReqs85332333894174
Firefox Webpack Startup Standard HomeuiStartup16651402372236716512037
load14221169343234214231603
domContentLoaded14211169343234314231603
domInteractive103312212218127158
firstPaint------
backgroundConnect62242364063164
firstReactRender15112731523
initialActions103122
loadScripts13961156340633914011544
setupStore207163281468
numNetworkReqs311990182783
Firefox Webpack Startup Power User HomeuiStartup27822008593548029453360
load15671278489838916021966
domContentLoaded15671278489738916021966
domInteractive15547860135166449
firstPaint------
backgroundConnect383971082265533943
firstReactRender21155252229
initialActions216123
loadScripts15291257486638615441945
setupStore17315986212182640
numNetworkReqs80302384682218
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182219221
srpButtonToSrpForm8919090
confirmSrpToPwForm2102121
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1501515
doneButtonToHomeScreen67894721809
openAccountMenuToAccountListLoaded754631178227845
total868733889708990
Onboarding New WalletcreateWalletToSocialScreen2171218218
srpButtonToPwForm1020102102
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3503535
agreeButtonToOnboardingSuccess1601616
doneButtonToAssetList60680611720
total986849881108
Asset DetailsassetClickToPriceChart3823842
total3823842
Solana Asset DetailsassetClickToPriceChart5815859
total5815859
Import Srp HomeloginToHomeScreen18763018671927
openAccountMenuAfterLogin4134345
homeAfterImportWithNewWallet24778225372564
total44243544434465
Send TransactionsopenSendPageFromHome25103739
selectTokenToSendFormLoaded1811920
reviewTransactionToConfirmationPage8472847850
total8929900901
SwapopenSwapPageFromHome1148118125
fetchAndDisplaySwapQuotes4566245674569
total46881946854719
🌐 Dapp Page Load Benchmarks

Current Commit: d683260 | Date: 2/24/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±40ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 719ms (±38ms) 🟢 | historical mean value: 729ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±9ms) 🟢 | historical mean value: 82ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 40ms 1.00s 1.33s 1.05s 1.33s
domContentLoaded 719ms 38ms 694ms 998ms 735ms 998ms
firstPaint 75ms 9ms 56ms 144ms 84ms 144ms
firstContentfulPaint 75ms 9ms 56ms 144ms 84ms 144ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -266.12 KiB (-6.12%)
  • ui: 1.99 KiB (0.02%)
  • common: 266.19 KiB (2.39%)

@salimtb salimtb added this pull request to the merge queue Feb 24, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

use new state for aggregated balance

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/40239?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: use new state for aggregated balance

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes balance computation/display paths and introduces new
state-derived selectors, which could affect shown totals across
networks/accounts if inputs or aggregation assumptions differ from the
legacy path.
> 
> **Overview**
> Updates the account group balance display to **prefer the new
AssetsController aggregated fiat total**
(`selectAggregatedBalanceForSelectedAccount`) when available, falling
back to the legacy account-group total and keeping native/testnet
display behavior unchanged.
> 
> Adds new assets-state selectors (`getAssetsInfo`, `getAssetsBalance`,
`getAssetsPrice`, `getAssetPreferences`, `getCustomAssets`) plus a
memoized aggregated-balance selector that calls
`getAggregatedBalanceForAccount`, and expands unit tests to cover the
new selector and additional UI states (privacy masking, cached-balance
styling, skeleton behavior, and aggregated-balance rendering).
> 
> Updates LavaMoat MV3 policies to allow the new
`@metamask/assets-controller` package (and its `bignumber.js`
dependency) across `main`, `beta`, `flask`, and `experimental` builds.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d683260. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2026
@salimtb salimtb added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 192f4bd Feb 24, 2026
179 checks passed
@salimtb salimtb deleted the feat/use-new-state-for-aggregated-balance branch February 24, 2026 15:33
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2026
@metamaskbot metamaskbot added the release-13.21.0 Issue or pull request that will be included in release 13.21.0 label Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.21.0 Issue or pull request that will be included in release 13.21.0 size-M team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants