Skip to content

fix: adds 'auto' button for solana dynamic slippage, persists choice across sessions #33254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ghgoodreau
Copy link
Contributor

@ghgoodreau ghgoodreau commented May 28, 2025

Description

  • Sets Solana slippage to 'Auto' in the UI to match with the dynamic slippage that is set by default.
  • Adds last selected Solana swaps slippage to preferences, so slippage is retained in history instead of resetting to dynamic each time. This is kept separate from EVM slippage.
  • Adds selectors to make setting and fetching this straightforward

Open in GitHub Codespaces

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.

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 metamaskbot added the team-swaps-and-bridge For issues with Swaps or Bridging label May 28, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented May 28, 2025

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (3 files, +143 -26)
  • 📁 ui/
    • 📁 ducks/
      • 📁 bridge/
        • 📄 selectors.ts +38 -0
    • 📁 pages/
      • 📁 bridge/
        • 📁 prepare/
          • 📄 bridge-transaction-settings-modal.tsx +90 -23
          • 📄 prepare-bridge-page.tsx +15 -3

@metamaskbot
Copy link
Collaborator

Builds ready [f3900fd]
UI Startup Metrics (1235 ± 72 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1235109613897212931336
load107394311916811291169
domContentLoaded106593511817011241162
domInteractive16133641628
firstPaint80598118941111271169
backgroundConnect94336825
firstReactRender20154752032
getState1453162026
initialActions001001
loadScripts82569993668887915
setupStore75192811
WebpackHomeuiStartup21541709265521723122531
load16681329204016617841928
domContentLoaded16581325202916317781918
domInteractive161259101347
firstPaint1716534960208305
backgroundConnect2910339452742
firstReactRender15343339106297328
getState244331601544
initialActions612712735
loadScripts16551323201816117761908
setupStore276316552030
FirefoxBrowserifyHomeuiStartup13121147176012613651601
load11631009160211912141428
domContentLoaded11631008160211912141427
domInteractive963736643100176
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2213234222039
firstReactRender24206172450
getState74344810
initialActions001001
loadScripts1144995158511611981382
setupStore74345615
WebpackHomeuiStartup15531371204514116441881
load13441185178613514201671
domContentLoaded13431185178613514201670
domInteractive82592392485132
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect22154452434
firstReactRender41275144347
getState84304911
initialActions102111
loadScripts13251168176813514041657
setupStore85364815
Benchmark value 1236 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1074 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1066 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 805 exceeds gate value 800 for chrome browserify home mean firstPaint
Benchmark value 26 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 2531 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 1671 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1670 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 1657 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 19ms | Sum of p95 exceeds: 133ms
Sum of all benchmark exceeds: 152ms

Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 838 Bytes (0.01%)
  • common: 0 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [d7e8387]
UI Startup Metrics (1239 ± 94 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1239111518869412911383
load106994216568911081200
domContentLoaded106193416499011021188
domInteractive1814104101631
firstPaint777165165741310951177
backgroundConnect94285926
firstReactRender20163232125
getState1564882128
initialActions001001
loadScripts819681140889861936
setupStore85182812
WebpackHomeuiStartup21621729259021723162549
load16761331213316617761956
domContentLoaded16671328200215917691942
domInteractive161168121352
firstPaint1646531956191276
backgroundConnect269252282648
firstReactRender14744374108292332
getState1243771430
initialActions318135
loadScripts16631326200015817641932
setupStore4173198121304
FirefoxBrowserifyHomeuiStartup13081105184613813551625
load1161984169313012171458
domContentLoaded1161984169213012171458
domInteractive92422793199133
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect20127992240
firstReactRender23205662226
getState9419119815
initialActions001001
loadScripts1143972166712811891437
setupStore84588732
WebpackHomeuiStartup14631305187111815431707
load12741137165310913481493
domContentLoaded12741136165310913471492
domInteractive73342863174112
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect20155062034
firstReactRender38255354147
getState10417817820
initialActions101011
loadScripts12561120163810813311468
setupStore7531389
Benchmark value 1239 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1383 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1201 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1188 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 26 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 42 exceeds gate value 32 for chrome webpack home mean setupStore
Benchmark value 2549 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 304 exceeds gate value 65 for chrome webpack home p95 setupStore
Benchmark value 32 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 39 exceeds gate value 38 for firefox webpack home mean firstReactRender
Sum of mean exceeds: 16ms | Sum of p95 exceeds: 384ms
Sum of all benchmark exceeds: 400ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 791 Bytes (0.01%)
  • ui: 7.4 KiB (0.1%)
  • common: 39.5 KiB (0.49%)

@metamaskbot
Copy link
Collaborator

Builds ready [e1b2561]
UI Startup Metrics (1232 ± 77 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1232108914107712871374
load106993612317411211205
domContentLoaded106293112227411131195
domInteractive171399101631
firstPaint789163121240610891174
backgroundConnect94325821
firstReactRender20154542126
getState1453471828
initialActions001000
loadScripts82369297872868953
setupStore75142811
WebpackHomeuiStartup21051690249722822562472
load16371296192817017621889
domContentLoaded16311293192016917551879
domInteractive151163101343
firstPaint1706735658204281
backgroundConnect22105372634
firstReactRender1214334794127328
getState1144171227
initialActions512422434
loadScripts16281291190816817521868
setupStore3873087818300
FirefoxBrowserifyHomeuiStartup13501150182512714131630
load11971020152011212781429
domContentLoaded11971019152011212781429
domInteractive1013644248108142
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2214196202042
firstReactRender25206582452
getState84657812
initialActions001001
loadScripts11761009150410912421376
setupStore9419020618
WebpackHomeuiStartup15111331186212215801763
load13081157164710613831510
domContentLoaded13081157164710613821510
domInteractive79443353182121
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect221585102234
firstReactRender40274944247
getState11522823830
initialActions001011
loadScripts12891142162710613661492
setupStore85314811
Benchmark value 1062 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 1375 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1206 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1196 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 21 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 953 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 39 exceeds gate value 32 for chrome webpack home mean setupStore
Benchmark value 2472 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 300 exceeds gate value 65 for chrome webpack home p95 setupStore
Benchmark value 40 exceeds gate value 38 for firefox webpack home mean firstReactRender
Sum of mean exceeds: 10ms | Sum of p95 exceeds: 311ms
Sum of all benchmark exceeds: 321ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 791 Bytes (0.01%)
  • ui: 7.4 KiB (0.1%)
  • common: 39.5 KiB (0.49%)

@ghgoodreau ghgoodreau marked this pull request as ready for review May 29, 2025 23:12
@ghgoodreau ghgoodreau requested a review from a team as a code owner May 29, 2025 23:12
@ghgoodreau ghgoodreau changed the title fix: auto button for solana swaps slippage fix: adds 'auto' button for solana dynamic slippage, persists choice across sessions May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-swaps-and-bridge For issues with Swaps or Bridging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants