feat(market): persist user token preference in Market Detail Buy/Sell#10355
Open
haicongliao wants to merge 6 commits intoOneKeyHQ:xfrom
Open
feat(market): persist user token preference in Market Detail Buy/Sell#10355haicongliao wants to merge 6 commits intoOneKeyHQ:xfrom
haicongliao wants to merge 6 commits intoOneKeyHQ:xfrom
Conversation
Remember the user's selected payment token (e.g. USDT/USDC) per network in Market Detail's Instant Mode swap panel. The preference is stored locally via a persistent Jotai atom and restored on next app launch. Closes OK-50555
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
Author
Pro Mode BUY/SELL now share the same persisted token preference with Instant Mode. Changing the counterparty token in either direction cross-syncs the other direction's atom so both stay in sync.
Move stale preference clearing from findPreferredToken into the useEffect to avoid a dependency cycle where tokenPreference changes trigger callback recreation and effect re-runs.
originalix
reviewed
Feb 26, 2026
Migrate per-network token preference storage from globalAtom (persist) to simpledb for better performance and memory usage. Add revalidateOnFocus to enable bidirectional sync between Market and Pro Mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
marketTokenPreferencePersistAtom) to remember user's selected payment token (e.g. USDT/USDC) per network in Market Detail's Instant Mode swap panelJira
OK-50555
Test plan