> For the complete documentation index, see [llms.txt](https://docs.triton.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.triton.one/solana/rpc-methods/readme/getlargestaccounts.md).

# getLargestAccounts

Returns the 20 largest accounts by lamport balance, optionally filtered to circulating or nonCirculating; disabled on Triton mainnet endpoints (HTTP 410).

{% hint style="warning" %}
`getLargestAccounts` is disabled on Triton's mainnet endpoints. Calls return HTTP `410` with the message "The RPC call or parameters have been disabled".
{% endhint %}

## Request

{% tabs %}
{% tab title="cURL" %}

```bash
curl "https://<your-endpoint>.mainnet.rpcpool.com/<your-token>" -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getLargestAccounts",
  "params": [
    {
      "commitment": "finalized",
      "sortResults": true
    }
  ]
}'
```

{% endtab %}

{% tab title="Kit" %}

```typescript
import { createSolanaRpc } from "@solana/kit";

const rpc_url = "https://<your-endpoint>.mainnet.rpcpool.com/<your-token>";
const rpc = createSolanaRpc(rpc_url);

let largestAccounts = await rpc.getLargestAccounts().send();

console.log(largestAccounts);
```

{% endtab %}

{% tab title="web3.js" %}

```typescript
import {
  Connection,
  type GetLargestAccountsConfig
} from "@solana/web3.js";

const connection = new Connection("https://<your-endpoint>.mainnet.rpcpool.com/<your-token>", "confirmed");

let config: GetLargestAccountsConfig = {
  commitment: "finalized",
  filter: "circulating"
};

let largestAccounts = await connection.getLargestAccounts(config);

console.log(largestAccounts);
```

{% endtab %}

{% tab title="Rust" %}

```rust
// Cargo.toml: anyhow = "1", solana-client = "~4.4", solana-commitment-config = "3",
// tokio = { version = "1", features = ["full"] }.
// Requires Rust 1.98.1 or newer (solana-client 4.4).
use anyhow::Result;
use solana_client::{
    nonblocking::rpc_client::RpcClient,
    rpc_config::{RpcLargestAccountsConfig, RpcLargestAccountsFilter},
};
use solana_commitment_config::CommitmentConfig;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://<your-endpoint>.mainnet.rpcpool.com/<your-token>"),
        CommitmentConfig::confirmed(),
    );

    let config = RpcLargestAccountsConfig {
        commitment: CommitmentConfig::finalized().into(),
        filter: RpcLargestAccountsFilter::Circulating.into(),
        sort_results: true.into(),
    };
    let largest_accounts = client.get_largest_accounts_with_config(config).await?;

    println!("{:#?}", largest_accounts);

    Ok(())
}
```

{% endtab %}
{% endtabs %}

## Parameters

**`config`** · object

Configuration object containing the following fields:

**`commitment`** · string · default `finalized`

Values: `processed`, `confirmed`, `finalized`

Solana RPC uses the following commitment levels:

| Value       | Description                                                                                                                                                                        |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `processed` | Return data from the highest slot this node has processed on the fork it currently considers best. This is the newest view, but it can still change if the cluster switches forks. |
| `confirmed` | Return data from the highest slot the cluster has finalized. On Alpenglow, `confirmed` and `finalized` are the same level.                                                         |
| `finalized` | Return data from the highest slot that the cluster has finalized. On Alpenglow there are no vote towers or lockouts: a slot is finalized by certificates of aggregated votes.      |

**`filter`** · string

Values: `circulating`, `nonCirculating`

Filter results by account type. If omitted, the RPC node includes both circulating and non-circulating accounts.

**`sortResults`** · bool

Accepted in the config, but the Agave RPC handler does not read it, so it does not change the result.

## Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "context": { "apiVersion": "4.3.2", "slot": 54 },
    "value": [
      {
        "address": "99P8ZgtJYe1buSK8JXkvpLh8xPsCFuLYhz9hQFNw93WJ",
        "lamports": 999974
      },
      {
        "address": "uPwWLo16MVehpyWqsLkK3Ka8nLowWvAHbBChqv2FZeL",
        "lamports": 42
      }
    ]
  },
  "id": 1
}
```

## Result

RpcResponse object containing:

**`context`** · object

Slot and API version the node used to answer this request.

| Field        | Type     | Description                                                                     |
| ------------ | -------- | ------------------------------------------------------------------------------- |
| `slot`       | `u64`    | Slot at which the node evaluated this request.                                  |
| `apiVersion` | `string` | RPC API version reported by the node. This field may be omitted by older nodes. |

**`value`** · array

Array of up to 20 account-balance objects with the following fields:

| Field      | Type     | Description                                   |
| ---------- | -------- | --------------------------------------------- |
| `address`  | `string` | Account address, as a base-58 encoded string. |
| `lamports` | `u64`    | Number of lamports in the account.            |

***

*Adapted from the* [*Solana `getLargestAccounts` reference*](https://solana.com/docs/rpc/http/getlargestaccounts)*, maintained by the Solana Foundation.*

***

<i class="fa-life-ring">:life-ring:</i> Contact support by clicking the chat icon in your [customer dashboard](https://customers.triton.one)\ <i class="fa-briefcase">:briefcase:</i> Sales questions? [Contact us](https://triton.one/contact)\ <i class="fa-sparkles">:sparkles:</i> AI agent? Read [llms.txt](https://docs.triton.one/llms.txt)\ <i class="fa-rss">:rss:</i> Follow updates: [Blog](https://blog.triton.one) · [X](https://x.com/triton_one) · [YouTube](https://www.youtube.com/@triton_one_ltd) · [Telegram](https://t.me/tritonone) · [GitHub](https://github.com/rpcpool)
