feat: add IoTeX Mainnet to Price API supported chains#8930
Open
Jevin-F wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 28e29bd. Configure here.
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.

Explanation
Native IOTX (and IoTeX ERC20s) show no price in MetaMask today.
eip155:4689(IoTeX Mainnet) is absent from the Price API's/v2/supportedNetworksallowlist (fullSupport,spotPricesV2,spotPricesV3), soCodefiTokenPricesServiceV2.fetchTokenPricesfilters IoTeX assets out before any price request is made — the wallet UI shows no conversion rate for IOTX or any IoTeX token.This PR adds the client-side mapping for IoTeX, following the exact pattern used for the Stable network in #8185. Native IOTX has no direct CoinGecko native-coin mapping via slip44, but its canonical price equals wrapped IOTX (WIOTX), so we route native IOTX through the WIOTX ERC20 contract:
SPOT_PRICES_SUPPORT_INFO['0x1251'] = 'eip155:4689/erc20:0xa00744882684c3e4747faefd68d283ea44099d03'chainIdToNativeTokenAddress['0x1251'] = '0xa00744882684c3e4747faefd68d283ea44099d03'MULTICALL_CONTRACT_BY_CHAINID['0x1251'] = '0xcA11bde05977b3631167028862bE2a173976CA11'(canonical Multicall3, verified deployed on IoTeX)The Price API backend already resolves the WIOTX contract price today:
CoinGecko also already indexes IoTeX as an asset platform (
{ id: "iotex", chain_identifier: 4689, native_coin_id: "iotex" }).The
it.each(SUPPORTED_CHAIN_IDS)parameterized test incodefi-v2.test.tsautomatically covers the new entry.Companion backend request (required for prices to surface)
Since #7716, the supported-chain filter uses the live
/v2/supportedNetworkslist, not the hardcodedSPOT_PRICES_SUPPORT_INFO. For native IOTX prices to actually show,eip155:4689must be added tosupportedNetworks.partialSupport.spotPricesV2andspotPricesV3in the Price API (va-mmcx-price-api). The evidence above shows the price path already works end-to-end via the WIOTX contract — this is a zero-risk allowlist entry, not new plumbing. Same companion-PR workflow as #8487 (Injective) and #8524 (Forma).References
SPOT_PRICES_SUPPORT_INFO#8627 (ZetaChain)Checklist
Note
Low Risk
Small additive config entries in existing maps; no auth, transaction, or business-logic changes. Full pricing still gated by backend allowlist.
Overview
Adds IoTeX Mainnet (
0x1251/ chain 4689) to the Codefi v2 token price mappings incodefi-v2.tsso native IOTX and IoTeX assets can be priced like other supported networks.Native IOTX is routed through the WIOTX ERC-20 contract (
0xa007…9d03) in bothSPOT_PRICES_SUPPORT_INFOandchainIdToNativeTokenAddress, matching the Stable/USDT0 pattern when slip44 native pricing is unavailable. The assets-controllers changelog records the new chain support.End-user spot prices still depend on the Price API allowing
eip155:4689on/v2/supportedNetworks(companion backend change, as noted in the PR).Reviewed by Cursor Bugbot for commit 408fdf5. Bugbot is set up for automated code reviews on this repo. Configure here.