getTokenLargestAccounts
https://api.triport.io/v1/solReturns the 20 largest accounts holding a particular SPL Token mint.
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^[1-9A-HJ-NP-Za-km-z]{32,44}$.configobjectoptionalcommitmentstringoptionalprocessed, confirmed, or finalized.minContextSlotintegeroptionalResponse
The
valuearray contains up to 20 entries; two are shown here for brevity.
resultobjectTokenLargestAccountsResponse envelope.result.contextobjectresult.context.slotintegerresult.context.apiVersionstringresult.valuearrayresult.value[].addressstring (base-58)result.value[].amountstringu64 precision.result.value[].decimalsintegerresult.value[].uiAmountnumberdecimals, as a JSON number. May lose precision for very large balances — prefer uiAmountString.result.value[].uiAmountStringstringdecimals, 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.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | mint is missing, not valid base-58, or is not an SPL Token mint, or config is malformed. |
401 | Unauthorized | Missing or invalid Authorization: Bearer key. |
429 | Rate limited | More 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, usegetTokenAccountBalance. - 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
amountfor math,uiAmountStringfor display:amountis the exactu64base-unit count (string to avoid precision loss);uiAmountStringappliesdecimalssafely. Avoid the floating-pointuiAmountfor 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
commitmentis omitted, the node's default commitment applies. Passfinalizedfor the strongest consistency guarantee. - Related methods:
getTokenAccountBalancereads one account;getTokenAccountsandgetSupplycover account enumeration and total supply.