Skip to content

[READY] Change token selection list sort. 1. Balance 2. Hardcoded tokens 3. Alphabetically#1058

Merged
ebma merged 19 commits into
stagingfrom
chore/change-token-selection-sort
Feb 6, 2026
Merged

[READY] Change token selection list sort. 1. Balance 2. Hardcoded tokens 3. Alphabetically#1058
ebma merged 19 commits into
stagingfrom
chore/change-token-selection-sort

Conversation

@Sharqiewicz
Copy link
Copy Markdown
Member

@Sharqiewicz Sharqiewicz commented Feb 5, 2026

Optimize token selection and balances

Summary

  • Add dynamic EVM token list from Squid Router API with intelligent merging against static config
    (static takes priority for contract addresses)
  • Improve token selection UX: sort tokens by USD balance, then by static config priority
    (isFromStaticConfig), then alphabetically
  • Remove dead networkAssetIcon property from all token types and configs
  • Rename axlUSDC asset symbol to USDC.axl in static config for consistency with Squid Router
    naming

Test plan

  • Verify token selection list displays tokens sorted by balance (highest first), with
    static-config tokens above dynamic-only tokens when balances are equal
  • Verify token icons load correctly for EVM tokens, AssetHub tokens, and fiat tokens; confirm
    fallback chain works when primary icon URL fails
  • Verify Onramp and Offramp flows display correct token icons and symbols after networkAssetIcon
    removal
  • Verify dynamic tokens from Squid Router appear in the selection list alongside static config
    tokens
  • Verify AssetHub token USD prices are fetched and displayed

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 5, 2026

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 1560fa1
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/698633d9b8e5990008e19937
😎 Deploy Preview https://deploy-preview-1058--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 5, 2026

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 1560fa1
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/698633d90afdc500088c2ce5
😎 Deploy Preview https://deploy-preview-1058--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates token metadata and UI behavior to improve token selection UX: bringing in a dynamic EVM token list from Squid Router, merging it with static config, and sorting tokens primarily by balances (USD/raw) and then by priority/alphabetical order. It also removes the networkAssetIcon property across token types/configs and aligns the axlUSDC display symbol with Squid Router naming.

Changes:

  • Add/adjust dynamic EVM token ingestion + merging with static config (and mark static tokens via isFromStaticConfig for sorting priority).
  • Update token selection list sorting to prioritize USD balance, then raw balance, then static-config tokens, then alphabetical.
  • Remove networkAssetIcon from token types/configs and update frontend icon plumbing accordingly (plus rename axlUSDC symbol to USDC.axl in static configs).

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/shared/src/tokens/utils/helpers.ts Adds a special-case fallback for AXLUSDC on Ethereum when resolving token details.
packages/shared/src/tokens/types/evm.ts Removes networkAssetIcon; adds isFromStaticConfig to support sort prioritization.
packages/shared/src/tokens/types/assethub.ts Removes networkAssetIcon from AssetHub token details.
packages/shared/src/tokens/moonbeam/config.ts Renames axlUSDC symbol to USDC.axl and removes icon field usage.
packages/shared/src/tokens/evm/dynamicEvmTokens.ts Fetches/filters Squid Router tokens, generates fallback logo URIs, merges with static config, and marks static tokens.
packages/shared/src/tokens/evm/config.ts Removes networkAssetIcon, removes AXLUSDC from Ethereum config, and renames axlUSDC symbol to USDC.axl elsewhere.
packages/shared/src/tokens/assethub/config.ts Removes networkAssetIcon from AssetHub static token config.
packages/shared/src/services/squidrouter/config.ts Refactors imports to use helpers and direct Moonbeam token config export.
bun.lock Removes react-window and upgrades @galacticcouncil/sdk lock entry.
apps/frontend/src/hooks/useTokenIcon.ts Simplifies logo URI extraction (EVM includes fallbackLogoURI).
apps/frontend/src/components/buttons/AssetButton/index.tsx Improves fallback icon source selection when a token has a fallbackLogoURI.
apps/frontend/src/components/TokenSelection/TokenSelectionList/helpers.tsx Adjusts token definition mapping for AssetHub/EVM tokens (asset icon fields now based on symbol).
apps/frontend/src/components/TokenSelection/TokenSelectionList/components/SelectionTokenList.tsx Implements updated token sorting logic (balances → static-config priority → alphabetical).
apps/frontend/src/components/TokenIcon/index.tsx Tweaks image error handling/loading behavior for primary vs fallback icon.
apps/frontend/src/components/Ramp/Onramp/index.tsx Uses assetSymbol instead of removed networkAssetIcon for input components.
apps/frontend/src/components/Ramp/Offramp/index.tsx Uses assetSymbol instead of removed networkAssetIcon for input components.
apps/frontend/src/components/CurrencyExchange/index.tsx Ensures fallback icon props are correctly derived when not explicitly provided.
apps/api/src/api/services/hydration/swap.ts Adds PoolType.Aave to Hydration router pool include list.
apps/api/package.json Upgrades @galacticcouncil/sdk to ^10.6.2.
Comments suppressed due to low confidence (1)

apps/frontend/src/components/buttons/AssetButton/index.tsx:45

  • useTokenIcon is called as useTokenIcon(assetIcon) without passing network, so for on-chain tokens it can only fall back to fiat icons (which resolves to the placeholder). If logoURI isn’t provided (e.g., Squid token fetch fails or a token lacks logoURI), the button will show a placeholder even when on-chain token details for the given network could provide a logoURI/fallbackLogoURI. Consider calling useTokenIcon(tokenSymbol, network) (or useTokenIcon(assetIcon, network)) so the fallback chain can resolve on-chain icons reliably.
        fallbackIconSrc={fallbackLogoURI ?? fallbackIcon.fallbackIconSrc}
        iconSrc={primaryIcon}
        network={network}
        showNetworkOverlay={!!network}
        tokenSymbol={assetIcon}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/shared/src/tokens/evm/dynamicEvmTokens.ts Outdated
Comment thread packages/shared/src/tokens/utils/helpers.ts
@ebma
Copy link
Copy Markdown
Member

ebma commented Feb 6, 2026

@copilot please address your suggested changes from #1058 (review) in a new PR.

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

@ebma I've opened a new pull request, #1061, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 8 commits February 6, 2026 18:06
- Fix mergeWithStaticConfig to preserve static config enum keys (e.g., EvmToken.AXLUSDC)
- Add alias entries under normalized symbols for flexible lookups
- Remove special case for AXLUSDC in getOnChainTokenDetailsOrDefault
- This fixes broken enum-based lookups like getOnChainTokenDetails(..., EvmToken.AXLUSDC)

Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Fix token lookup keying: preserve enum keys in dynamic EVM token merge
@ebma ebma self-requested a review February 6, 2026 18:34
Copy link
Copy Markdown
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

I added some more failsafes, but should be fine overall ✔️

@ebma ebma merged commit 716d456 into staging Feb 6, 2026
4 of 5 checks passed
@ebma ebma deleted the chore/change-token-selection-sort branch February 6, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants