This endpoint requires a Growth or Enterprise plan. Learn more.
Returns
BalancesResponse!
See BalancesResponse
Arguments
BalancesInput!
required
See BalancesInput
Example
Test this query in the Explorer →Native balances (ETH, BNB, and so on) are returned on EVM networks alongside token balances. Codex reads a wallet’s native balance from the chain each time the wallet appears in a transaction. Native tokens a wallet receives from a contract, with no transaction of its own (for example a refund or an unwrap), can show up only after the wallet’s next transaction. Check
updatedAtBlock to see when a balance was last read.Balances are unavailable on Sui (Network 101).Usage Guidelines
- Use
walletAddresswith the wallet address (ENS names are not supported) - Specify
networksarray to filter balances to specific chains (e.g.,[1]for Ethereum) - Use
tokensarray to request specific token balances (max 200 tokens) - Use
removeScams: trueto remove tokens we’ve manually labelled as scams (isScam: true). Unlabelled tokens are always kept, so it won’t remove most junk airdrops. See the troubleshooting note below. - Use
filters(BalanceFilters) to keep only holdings in abalanceUsdorliquidityUsdrange, or with or without a price (hasPrice). For example,filters: { liquidityUsd: { gt: 1000 } }drops tokens with almost no liquidity.balanceUsdrequiressortBy: USD_VALUEunless you passtokens.- A filtered page reads at most 600 of the wallet’s holdings, so it can return fewer than
limitresults, or none, whilecursoris still set. Keep paging untilcursoris null, and reuse a cursor only with the samefilters. - Unpriced tokens often have
balanceUsdof"0"rather than null, sobalanceUsd: { gte: 0 }keeps them. Usegt: 0orhasPrice: trueto drop them. - Native balances always match a
liquidityUsdrange. - Filters are not a scam filter: junk tokens with real-looking liquidity still pass.
- Read
liquidityUsdfor the token’s route-backed liquidity in USD — the real liquidity supporting its price, summed across the token’s pairs with valid routing liquidity (null when not yet computed). This replaces the older reserves-times-price measure, so it reflects liquidity a holder could actually trade against. Combine it withtokenLastTradedTimestampto value a portfolio accurately: discount or exclude holdings with negligible liquidity or no recent trades so illiquid or dead tokens don’t inflate a wallet’s total. - Use
updatedAtBlockto see the block at which a balance was last updated (null when the block is unknown), for balance-freshness provenance. - Rebasing tokens change holder balances without a
Transferevent, so their balances here can drift from the token’s ownbalanceOf. limitdefaults to 200 and cannot exceed 200. Use thecursorparameter to page through larger token holdings.- Balances are current-state only — Codex does not store historical balances, so there is no way to query a wallet’s holdings as of a past block or timestamp. See the FAQ for the recommended approach to reconstructing historical portfolio value
Troubleshooting Tips
Why is a native balance out of date?
Why is a native balance out of date?
Codex reads the native balance from the chain each time the wallet appears in a transaction. Native tokens received from a contract without a transaction by the wallet (for example a refund or an unwrap) are picked up on the wallet’s next transaction. Check
updatedAtBlock, and use the network’s RPC (eth_getBalance) if you need the balance at the latest block.Why is balanceUsd returning null?
Why is balanceUsd returning null?
balanceUsd may be null if we don’t have price data for that token. This can happen with very new or low-liquidity tokens. The raw balance and shiftedBalance fields will still be available.How do I get an accurate portfolio value?
How do I get an accurate portfolio value?
balanceUsd values each holding at the current token price, but a price alone can make illiquid or dead tokens look valuable. Use liquidityUsd — the token’s route-backed liquidity in USD, i.e. the real liquidity supporting its price across pairs with valid routing — together with tokenLastTradedTimestamp to filter or discount holdings that couldn’t actually be sold at their quoted price. A common approach is to drop or down-weight tokens below a liquidity threshold, or with no trades in the last day, before summing balanceUsd into a portfolio total, so a handful of worthless tokens don’t make a wallet look far richer than it is.How do I get balances for specific tokens only?
How do I get balances for specific tokens only?
Use the
tokens parameter with an array of token IDs (address:networkId) or addresses. When using addresses only, you must also provide the networks parameter. Max 200 tokens per request.Can I query multiple wallets at once?
Can I query multiple wallets at once?
No,
balances queries a single wallet. To get balances for multiple wallets, make separate requests for each wallet address.Why am I seeing scam or unrecognized tokens?
Why am I seeing scam or unrecognized tokens?
Wallets accumulate scam and junk tokens over time, often as unsolicited airdrops. Setting
removeScams: true removes only tokens we’ve manually labelled as a scam (isScam: true), which we do sparingly. Unlabelled tokens are always kept, so most junk will still come through. To drop more, add filters, such as a liquidityUsd minimum or hasPrice: true, or filter client-side.We intentionally keep this filtering conservative. Many tokens may look like scams, or may become scams, but can still be sellable by a user. If we hid them too aggressively, a user could lose the ability to see and sell a token that was flagged in error. For stricter filtering, use filters or filter client-side on metrics such as liquidity.How quickly are balances updated after a transaction?
How quickly are balances updated after a transaction?
Under normal conditions, balances typically reflect a new transaction within a second or two after it finalizes. This is a general expectation rather than a guaranteed number, and we don’t currently publish a formal standard or SLA for it.Timing varies by network. Solana is the most common network for this query, where updates generally land within about 2 seconds of confirmation. Other networks may take longer. Response times can also be slower during periods of heavy balances indexing.Our team is alerted to balance delays and addresses them promptly. If you consistently see delays beyond a few seconds (for example, more than 5 seconds on Solana), reach out to support.
Related Recipes
- Wallets: Analyze wallet performance, discover top traders, and build portfolio views