getTokenLargestAccounts
Learn getTokenLargestAccounts use cases, code examples, request parameters, response structure, and tips.
The getTokenLargestAccounts RPC method in CoinVera returns the top 20 largest SPL token accounts for a given token mint. It’s primarily used to analyze token distribution, identify major holders, and power top-holder dashboards.
✅ Common Use Cases
Token Distribution Analysis Understand how a token’s supply is distributed across wallets.
Identifying Whales Spot addresses holding large portions of a token supply.
Market Research & Risk Assessment Measure decentralization or the potential influence of top holders.
Explorer & Dashboard Integration Display the top token holders in user interfaces.
🧾 Request Parameters
[
mintAddress: string, // Required – base-58 address of the SPL token mint
options?: {
commitment?: string // Optional – "processed", "confirmed", or "finalized"
}
]mintAddress: The SPL token mint for which to retrieve largest token accounts.
commitment: Optional commitment level to specify the network state snapshot.
📦 Response Structure
The result is an array of up to 20 token account objects:
Each entry includes:
address: Base-58 public key of the token account.
amount: Raw token balance (as a string).
decimals: Token mint’s decimal precision.
uiAmount: Balance as a float (optional, may be deprecated).
uiAmountString: Balance as a string (preferred for display).
🧪 Example
Fetch Top 20 Largest Accounts for a Token
Code Examples
Example Response
💡 Developer Tips
Fixed Result Size Always returns up to 20 largest accounts—no support for pagination.
Token-Specific Query Only shows holders for the mint you provide. Use a valid SPL token mint.
uiAmountStringIs Recommended It’s safer and more consistent for displaying token balances thanuiAmount.Avoid Excessive Polling While efficient, repeated queries in short intervals may add unnecessary load.
Commitment Level Matters Use
finalizedfor the most stable snapshot of top token holders.
The getTokenLargestAccounts method is a simple yet powerful way to understand SPL token distribution and visualize key holders within the Solana ecosystem. It's ideal for dashboards, analytics tools, and smart contract tooling built on CoinVera.
Last updated