getLargestAccounts
Returns the 20 largest accounts by lamport balance. You can optionally filter to show only circulating or non-circulating accounts. This method is useful for network analytics, understanding wealth distribution on the network, identifying major stakeholders, and tracking treasury or foundation accounts. The results are cached and may not reflect real-time balances.
Parameters
| # | Type | Required | Description |
|---|---|---|---|
| 1 | object | No | Configuration object |
Configuration object fields:
| Field | Type | Description |
|---|---|---|
commitment | string | Commitment level: processed, confirmed, or finalized |
filter | string | Filter: circulating or nonCirculating |
Response
Returns an RpcResponse with an array of account objects:
| Field | Type | Description |
|---|---|---|
context.slot | u64 | The slot at which the value was read |
value[].address | string | Base-58 encoded address of the account |
value[].lamports | u64 | Number of lamports in the account |
Code Examples
cURL
1curl http://[IP_ADDRESS]:[PORT] -X POST -H "Content-Type: application/json" -d '{
2 "jsonrpc": "2.0",
3 "id": 1,
4 "method": "getLargestAccounts",
5 "params": [
6 { "filter": "circulating" }
7 ]
8}'TypeScript
1const response = await fetch("http://[IP_ADDRESS]:[PORT]", {
2 method: "POST",
3 headers: { "Content-Type": "application/json" },
4 body: JSON.stringify({
5 jsonrpc: "2.0",
6 id: 1,
7 method: "getLargestAccounts",
8 params: [
9 { filter: "circulating" }
10 ]
11 }),
12});
13const { result } = await response.json();
14result.value.forEach(a => console.log(a.address, a.lamports / 1e9, "SOL"));Python
1import requests
2
3response = requests.post("http://[IP_ADDRESS]:[PORT]", json={
4 "jsonrpc": "2.0",
5 "id": 1,
6 "method": "getLargestAccounts",
7 "params": [
8 {"filter": "circulating"}
9 ]
10})
11result = response.json()["result"]
12for a in result['value']: print(f"{a['address']}: {a['lamports']/1e9} SOL")Rust
1use reqwest::Client;
2use serde_json::json;
3
4#[tokio::main]
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6 let client = Client::new();
7 let res = client.post("http://[IP_ADDRESS]:[PORT]")
8 .json(&json!({
9 "jsonrpc": "2.0",
10 "id": 1,
11 "method": "getLargestAccounts",
12 "params": [
13 {"filter": "circulating"}
14 ]
15 }))
16 .send().await?
17 .text().await?;
18 println!("{}", res);
19 Ok(())
20}Example Response
1{
2 "jsonrpc": "2.0",
3 "result": {
4 "context": { "slot": 166974442 },
5 "value": [
6 { "address": "mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68", "lamports": 500000000000000 }
7 ]
8 },
9 "id": 1
10}