getTokenLargestAccounts
Returns the 20 largest accounts for a specific SPL Token mint, showing who holds the most of a given token. This is invaluable for token analytics, checking token distribution and concentration, identifying major holders (whales), and conducting due diligence on token projects. The results include both raw amounts and human-readable values with decimal formatting.
Parameters
| # | Type | Required | Description |
|---|---|---|---|
| 1 | string | Yes | Base-58 encoded public key of the token mint |
| 2 | object | No | Configuration object |
Configuration object fields:
| Field | Type | Description |
|---|---|---|
commitment | string | Commitment level: processed, confirmed, or finalized |
Response
Returns an RpcResponse with an array of token account objects:
| Field | Type | Description |
|---|---|---|
context.slot | u64 | The slot at which the value was read |
value[].address | string | Token account address (base-58) |
value[].amount | string | Raw token amount as a string |
value[].decimals | u8 | Number of decimals for the token |
value[].uiAmount | `f64 | null` |
value[].uiAmountString | string | Token amount as a string with decimal formatting |
Code Examples
cURL
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenLargestAccounts",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{ "commitment": "confirmed" }
]
}'TypeScript
const response = await fetch("http://88.216.36.108:7999", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getTokenLargestAccounts",
params: [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{ commitment: "confirmed" }
]
}),
});
const { result } = await response.json();
result.value.forEach(a => console.log(a.address, a.uiAmountString));Python
import requests
response = requests.post("http://88.216.36.108:7999", json={
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenLargestAccounts",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{"commitment": "confirmed"}
]
})
result = response.json()["result"]
for a in result['value']: print(f"{a['address']}: {a['uiAmountString']}")Rust
use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client.post("http://88.216.36.108:7999")
.json(&json!({
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenLargestAccounts",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{"commitment": "confirmed"}
]
}))
.send().await?
.text().await?;
println!("{}", res);
Ok(())
}Example Response
{
"jsonrpc": "2.0",
"result": {
"context": { "slot": 166974442 },
"value": [
{
"address": "7kMFogLKhMscgaFQ3AFPoXt9iRnSCCfC4ZCSX4Aq4XWu",
"amount": "5000000000000",
"decimals": 6,
"uiAmount": 5000000.0,
"uiAmountString": "5000000"
}
]
},
"id": 1
}