in-solana by Supanode

getTokenLargestAccounts — Solana RPC Method

getTokenLargestAccounts returns the 20 largest holders of a specific SPL Token mint, sorted by balance in descending order.

Parameters

NameTypeRequiredDescription
mintstringYesBase-58 encoded public key of the token mint.
commitmentstringNoprocessed, confirmed, or finalized. Default: finalized.

Request

curl -X POST https://api.mainnet-beta.solana.com \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenLargestAccounts",
    "params": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ]
  }'

TypeScript (@solana/kit)

import { createSolanaRpc, address } from "@solana/kit";

const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const largest = await rpc
  .getTokenLargestAccounts(
    address("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
  )
  .send();

for (const account of largest.value) {
  console.log(`${account.address}: ${account.uiAmountString}`);
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "context": { "slot": 341200000, "apiVersion": "2.2.4" },
    "value": [
      {
        "address": "7kbnvuGBxxj8AG9qp8Scn56muWGaRaFqxg1FsRp3PaFT",
        "amount": "500000000000",
        "decimals": 6,
        "uiAmount": 500000.0,
        "uiAmountString": "500000"
      }
    ]
  },
  "id": 1
}
FieldTypeDescription
addressstringBase-58 encoded token account public key.
amountstringRaw token amount as a string.
decimalsu8Token decimal places.
uiAmountnumber or nullFormatted amount as float (deprecated).
uiAmountStringstringFormatted amount as string.

The array contains up to 20 entries, sorted by balance descending.

Common errors

  • Invalid mint — a non-existent or non-mint account returns an error.

Performance

This method scans all token accounts for the given mint and returns the top 20. For popular tokens with millions of holders, this may take several seconds. Cache the result for analytics use cases.

FAQ

Does this return the wallet address or the token account address? It returns the token account address. To find the wallet that owns it, you need to query the token account with getAccountInfo using jsonParsed encoding.

Does this work with Token-2022 tokens? Yes. Pass the Token-2022 mint address and it works the same way.

Can I get more than 20 results? No. The method always returns at most 20. For a complete holder list, use getProgramAccounts with a memcmp filter on the mint field.

How is this different from getLargestAccounts? getLargestAccounts returns accounts with the most SOL. getTokenLargestAccounts returns accounts with the most of a specific SPL token.

Parameters

ParameterTypeRequiredDescriptionDefault
mintstringYesBase-58 encoded public key of the token mint.—
commitmentstringNoCommitment level: processed, confirmed, or finalized.finalized

Updated: