---
title: getTokenLargestAccounts
description: >-
  Returns the 20 largest token accounts for an SPL Token mint.
url: /docs/rpc/http/gettokenlargestaccounts
type: reference
hideTableOfContents: true
---

Returns the 20 largest token accounts for an SPL Token mint.

<Callout type="info" title="Source">
  [`get_token_largest_accounts`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L2022)
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenLargestAccounts",
  "params": [
    // !hover pubkey
    "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
    // !hover(1:3) config
    {
      // !hover commitment
      "commitment": "finalized"
    }
  ]
}
```

```ts !!request title="Kit"
import { address, createSolanaRpc } from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

// !hover pubkey
let mint = address("Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr");

let largestHolders = await rpc.getTokenLargestAccounts(mint).send();

console.log(largestHolders);
```

```ts !!request title="web3.js"
import { Connection, PublicKey, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

// !hover pubkey
let mint = new PublicKey("Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr");

let largestHolders = await connection.getTokenLargestAccounts(mint);

console.log(largestHolders);
```

```rs !!request title="Rust"
use anyhow::Result;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;
use solana_sdk::pubkey;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://api.devnet.solana.com"),
        CommitmentConfig::confirmed(),
    );

    // !hover pubkey
    let mint = pubkey!("Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr");

    let largest_holders = client.get_token_largest_accounts(&mint).await?;

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

    Ok(())
}
```

### !params

#### !! pubkey

!type string  
!required

Pubkey of the token Mint to query, as base-58 encoded string

#### !! config

!type object

Configuration object containing the following fields:

##### !! commitment

!type string  
!values processed confirmed finalized  
!default 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 that at least two-thirds of active stake has directly voted to confirm. This is more stable than `processed`, but it is still a weaker guarantee than `finalized`.                                                                       |
| `finalized` | Return data from the highest slot that the cluster recognizes as finalized. In practice, this means the slot has reached maximum vote lockout in validators' vote towers and is recognized by at least two-thirds of active stake. This is the strongest commitment level. |

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover(1:19) result
  "result": {
    // !hover context
    "context": { "apiVersion": "3.1.8", "slot": 1114 },
    // !hover(1:16) value
    "value": [
      {
        "address": "FYjHNoFtSQ5uijKrZFyYAxvEr87hsKXkXcxkcmkBAf4r",
        "amount": "771",
        "decimals": 2,
        "uiAmount": 7.71,
        "uiAmountString": "7.71"
      },
      {
        "address": "BnsywxTcaYeNUtzrPxQUvzAWxfzZe3ZLUJ4wMMuLESnu",
        "amount": "229",
        "decimals": 2,
        "uiAmount": 2.29,
        "uiAmountString": "2.29"
      }
    ]
  },
  "id": 1
}
```

!type object

RpcResponse object containing:

#### !! context

!type 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

!type array

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

Each element combines a token-account address with the same amount fields
documented for `uiTokenAmount` in
[Token Balances](/docs/rpc/json-structures#token-balances).

| Field            | Type             | Description                                                                                       |
| ---------------- | ---------------- | ------------------------------------------------------------------------------------------------- |
| `address`        | `string`         | Token-account address, as a base-58 encoded string.                                               |
| `amount`         | `string`         | Raw token balance, as a base-10 integer string with no decimal point.                             |
| `decimals`       | `u8`             | Number of decimal places configured on the mint.                                                  |
| `uiAmount`       | `number \| null` | Decimal-scaled token balance as a floating-point number. Deprecated in favor of `uiAmountString`. |
| `uiAmountString` | `string`         | Decimal-scaled token balance as a string.                                                         |

</APIMethod>
