Skip to main content

getTokenLargestAccounts

Returns the 20 largest accounts of a particular SPL Token type.

Common use cases
Identify Top Token Holders for Risk AssessmentFetch the 20 largest SPL token accounts to analyze holder concentration risk. Common in rug-pull detection tools and trading bots to assess token centralization before investing. Returns address, balance with decimals, and uiAmountString for precise calculations.
Find NFT Owner When Supply Equals 1Query NFT mint address with supply=1 to get the single largest holder, effectively revealing current owner. Used by NFT explorers and domain name services (like SNS) as faster alternative to getProgramAccounts for single-owner lookups.
Monitor Liquidity Pool Reserve BalancesTrack largest holders of pool token accounts to monitor reserve changes in automated market makers. Trading algorithms use this to detect liquidity shifts without parsing full pool state, though requires finding reserve account addresses first.
Display Whale Wallet Holdings in Portfolio UIShow top holders with their percentage of total supply for popular tokens in analytics dashboards. Combine with getTokenSupply to calculate holder percentages and with price APIs for USD value rankings of major stakeholders.
Validate Token Distribution Before AirdropCheck holder concentration to ensure fair token distribution or identify team wallets for exclusion from airdrop snapshots. Returns top 20 accounts which typically represent majority of supply for new tokens with centralized holdings.

Parameters

pubkey (string, required)

Pubkey of the token Mint to query, as base-58 encoded string

config (object, optional)

Configuration object containing the following fields:

Fields:

Request

curl https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenLargestAccounts",
"params": [
"3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
{
"commitment": "finalized"
}
]
}'
Network Selection

Replace mainnet with devnet in the URL to query devnet instead.

Response

{
"jsonrpc": "2.0",
"result": {
"context": { "slot": 1114 },
"value": [
{
"address": "FYjHNoFtSQ5uijKrZFyYAxvEr87hsKXkXcxkcmkBAf4r",
"amount": "771",
"decimals": 2,
"uiAmount": 7.71,
"uiAmountString": "7.71"
},
{
"address": "BnsywxTcaYeNUtzrPxQUvzAWxfzZe3ZLUJ4wMMuLESnu",
"amount": "229",
"decimals": 2,
"uiAmount": 2.29,
"uiAmountString": "2.29"
}
]
},
"id": 1
}

Response Fields

Return value: array

An array of JSON objects containing:

FAQ and Troubleshooting

Why do I get error -32010 'excluded from account secondary indexes'?

Your RPC node lacks --account-index spl-token-mint configuration. The SPL Token program must be in secondary indexes for this method to work. Switch to an RPC provider with account indexing enabled or configure your own validator.

How do I get ALL token holders instead of just the top 20?

Use getProgramAccounts with a memcmp filter on the mint field instead. getTokenLargestAccounts is capped at 20 accounts (hard limit). getProgramAccounts returns complete holder list but is slower and may hit rate limits on large tokens.

Can this method handle large tokens like USDC without timeouts?

Performance varies by RPC provider. Large tokens (USDC, USDT) can timeout or hit rate limits on some nodes due to scan overhead. Use providers with optimized indexing or consider caching results since largest holders rarely change rapidly.

Which commitment level should I use for holder analysis?

Use "finalized" (default) for holder rankings and whale tracking since holder distributions change slowly. Only use "confirmed" if monitoring for immediate large transfers where 1-2 second freshness matters and you can tolerate rare rollbacks.

What's the difference between this and getTokenAccountsByOwner?

getTokenLargestAccounts returns top 20 accounts by balance for ANY token mint. getTokenAccountsByOwner returns ALL token accounts (any mint) owned by a specific wallet. Use this for holder rankings; use getTokenAccountsByOwner for wallet portfolio lookups.

getProgramAccounts
Returns all accounts owned by a program with filtering. Use when you need complete token holder list beyond the top 20 cap. Filter by SPL Token program with memcmp on mint field, but expect slower response times for popular tokens.

getTokenSupply
Returns total supply for a token mint. Pair with getTokenLargestAccounts to calculate top holder percentages: (holder amount / total supply) × 100. Essential for concentration analysis and whale identification metrics.

getTokenAccountsByOwner
Fetches all token accounts for a wallet, optionally filtered by mint or program. Use this for individual wallet portfolio views; use getTokenLargestAccounts when analyzing token-wide holder distribution instead of per-wallet holdings.

getTokenAccountBalance
Returns balance for a specific token account with decimals. After using getTokenLargestAccounts to identify top holders, call this to refresh individual balances or validate data. Both require same --account-index configuration.

getAccountInfo
Returns raw account data including owner and lamports. Use when you need to verify account type or access additional fields beyond token balance data returned by getTokenLargestAccounts.

External Resources

  • Solana Official Documentation
  • SPL Token Program Documentation - Comprehensive guide to SPL Token Program including account structure and token account relationships. Essential for understanding what getTokenLargestAccounts returns and how token accounts relate to mints and owners.
  • Setup an RPC Node: Account Indexing - Official validator operator guide explaining --account-index parameter including spl-token-mint flag required for getTokenLargestAccounts. Documents why error -32010 occurs and how to enable proper secondary indexes for token queries.