[Bug]: SOL.USDC > SOL.SOL swap simulation fails due to token balance inconsistency
Describe the bug
When attempting to perform a swap from SOL.USDC to SOL.SOL via MetaMask extension, the swap simulation failed due to an apparent discrepancy in the displayed USDC balance. Specifically, the USDC quantity reported in the quote appeared to be doubled (34,349,749 instead of ~17,174,875, which corresponds to ~$34.35 considering 6 decimals). It seems related to token balances not updating promptly, as the issue resolved itself after some delay.
Expected behavior
The token balance displayed should accurately reflect the actual wallet balance immediately, ensuring the swap simulation succeeds when a user initiates the swap.
Screenshots/Recordings
Please see the attached screenshot for initial failure details (user screenshot from original chat notes).
Steps to reproduce
Ensure your MetaMask extension wallet has a balance of approximately $34.35 in SOL.USDC.
Initiate a swap from SOL.USDC to SOL.SOL.
Observe the quote fetched via the simulation.
Notice the incorrect doubled quantity causing a simulation failure.
Error messages or log output
No explicit log error messages captured. Simulation failure due to incorrect displayed token balance.
Detection stage
In production (default)
Version
12.18.3
Build type
None
Browser
Brave
Operating system
MacOS
Hardware wallet
No response
Additional context
Related issue potentially involving slow balance updates, similar to previous issues: https://github.com/MetaMask/metamask-extension/issues/32897
Issue appeared to self-resolve upon balance state update.
Not previously documented as a specific GitHub issue per internal team discussion.
Severity
No response
This seems to be an issue where a user
- Executes a Swap
- After that swap the balance doesn't get updated fast enough
- In the middle of the next swap you get the new balance
- The new swap is in a broken state because you have less of the balance that you had before
Setting this as Sev3 as we are working on Websockets to make this updates faster
Should be fixed in 13.1.0 as balances will update very quickly with websockets could you check @javiergarciavera @chaoticgoodpanda
Checked again and not been able to reproduce in 13.1.2. Closing