TriportRPC

getTokenLargestAccounts

POSThttps://api.triport.io/v1/sol

Returns the 20 largest accounts holding a particular SPL Token mint.

Solanasol_read_rpcfree+ — 20 / 60 / 200 / 600 RPS (free / basic / pro / business)

getTokenLargestAccounts returns the up-to-20 largest token accounts for a given SPL Token mint, ranked by balance in descending order. Each entry reports the token account address, the raw integer amount, the mint's decimals, and the human-readable uiAmount / uiAmountString already scaled by those decimals. Use it to surface a token's top holders, estimate holder concentration, or locate large liquidity / treasury accounts for a mint.

The mint you pass must be the address of the token mint — not a wallet and not an individual token account. The method returns holdings of that mint across the largest accounts; it does not enumerate the accounts owned by a wallet. To go from a wallet to its token accounts instead, use getTokenAccountsByOwner.

Results are reported relative to a particular slot, returned in the context object. Use the optional commitment config to control how finalized that slot must be, and minContextSlot to require the node has reached at least a given slot before serving the request. The list is capped at 20 entries and cannot be paginated — it always reflects the largest accounts at the queried slot.

Parameters

JSON-RPC params is a positional array: [mint, config?].

mintstring (base-58)required
The SPL Token mint address to query. Must match ^[1-9A-HJ-NP-Za-km-z]{32,44}$.
configobjectoptional
Optional configuration object (see below).
commitmentstringoptional
Commitment level: processed, confirmed, or finalized.
minContextSlotintegeroptional
Minimum slot the request must be evaluated at.

Response

The value array contains up to 20 entries; two are shown here for brevity.

resultobject
TokenLargestAccountsResponse envelope.
result.contextobject
The context the response was evaluated against.
result.context.slotinteger
The slot at which the accounts were read.
result.context.apiVersionstring
The node software version that served the request.
result.valuearray
Up to 20 token accounts, largest first.
result.value[].addressstring (base-58)
The token account address holding this balance.
result.value[].amountstring
The raw balance in base units, without decimals applied. Returned as a string to preserve u64 precision.
result.value[].decimalsinteger
Number of base-10 digits to the right of the decimal place for this mint.
result.value[].uiAmountnumber
The balance scaled by decimals, as a JSON number. May lose precision for very large balances — prefer uiAmountString.
result.value[].uiAmountStringstring
The balance scaled by decimals, as a string. The precision-safe field to display.

Errors

Errors are returned in the standard JSON-RPC error envelope. See the shared errors reference for the full envelope shape and shared codes.

CodeMeaningWhen it happens
-32602Invalid paramsmint is missing, not valid base-58, or is not an SPL Token mint, or config is malformed.
401UnauthorizedMissing or invalid Authorization: Bearer key.
429Rate limitedMore than your tier's RPS for sol_read_rpc (20 / 60 / 200 / 600).

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/v1/sol", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getTokenLargestAccounts",
    params: ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],
  }),
});


const { result } = await res.json();
for (const holder of result.value) {
  console.log(`${holder.address}: ${holder.uiAmountString}`);
}

TypeScript SDK (@triport/sdk)

import { TriportClient } from "@triport/sdk";


const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY });


const { context, value } = await client.solana.getTokenLargestAccounts(
  "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  { commitment: "finalized" }
);


console.log(`Top ${value.length} holders at slot ${context.slot}:`);
for (const holder of value) {
  console.log(`${holder.address}: ${holder.uiAmountString}`);
}

Python (triport-sdk)

import os
from triport import TriportClient


client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])


result = client.solana.get_token_largest_accounts(
    "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    commitment="finalized",
)


for holder in result["value"]:
    print(f"{holder['address']}: {holder['uiAmountString']}")

Notes

  • Mint, not wallet or token account: pass the token mint address. To list the token accounts owned by a wallet, use getTokenAccountsByOwner; to read a single account's balance, use getTokenAccountBalance.
  • Capped at 20, no pagination: the response always returns at most the 20 largest accounts at the queried slot. There is no cursor or offset — this is the complete top-of-list view, not a page of a larger set.
  • Use amount for math, uiAmountString for display: amount is the exact u64 base-unit count (string to avoid precision loss); uiAmountString applies decimals safely. Avoid the floating-point uiAmount for accounting.
  • Holder concentration is approximate: the largest token accounts are not necessarily distinct holders — one entity may control several accounts, and a single account (e.g. an exchange or AMM pool) may custody many users' funds.
  • Commitment defaults: when commitment is omitted, the node's default commitment applies. Pass finalized for the strongest consistency guarantee.
  • Related methods: getTokenAccountBalance reads one account; getTokenAccounts and getSupply cover account enumeration and total supply.