# getTokenLargestAccounts

> Returns the 20 largest token accounts of an SPL Token or Token-2022 mint, by balance.

Source: https://docs.constant-k.com/rpc/http/gettokenlargestaccounts/

`getTokenLargestAccounts` returns the token accounts of one mint that hold the largest balances, at most 20, largest first. Each balance is given as a raw integer string and as an amount adjusted for the mint's decimals.

Each row is a token account, not the wallet or program that owns it. The owner is stored in the token account itself (see Notes).

- Transport: HTTP, JSON-RPC 2.0 `POST` to `https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY` (New York) or `https://rpc-frankfurt.constant-k.com/?api-key=YOUR_API_KEY` (Frankfurt) or `https://rpc-amsterdam.constant-k.com/?api-key=YOUR_API_KEY` (Amsterdam). The key also works as an `x-api-key` header.
- Category: Tokens
- Availability: Blade Runner and above
- Rate limits: Free not available · Operator not available · Blade Runner 2/s · Nexus 30/s

## Parameters

`params` is a positional JSON array, in this order:

- `mint` (string, required): Address of the mint, base-58 encoded. A wallet or token account address returns `-32602`.
- `config` (object, optional): Commitment configuration. When `config` is passed, it must contain `commitment`.
  - `commitment` (string, required, one of `finalized`, `confirmed`, `processed`): Bank state to read the accounts from. Without `config`, `finalized` is used. `processed` is answered at `confirmed`.

## Result

- `result` (object, optional): Up to 20 token accounts, largest balance first, wrapped with context.
  - `context` (object, required)
    - `slot` (integer, optional): Slot the balances were read at.
    - `apiVersion` (string, optional)
  - `value` (object[], required)
    - `address` (string, required): Address of the token account, base-58 encoded. Not the address of the wallet or program that owns it.
    - `amount` (string, required): Raw balance in the mint's smallest unit, as a string.
    - `decimals` (integer, required): Number of decimal places the mint uses.
    - `uiAmount` (number | null, optional): Balance divided by 10^decimals, as a float. On a mint without the Token-2022 interest-bearing or scaled UI amount extension, it is `null` when the mint has 20 or more decimals. See Notes for those extensions.
    - `uiAmountString` (string, required): Balance divided by 10^decimals, as a decimal string without trailing zeros. Exact, except on Token-2022 interest-bearing and scaled UI amount mints, where it is computed with a float (see Notes).

## Example: Get the largest USDC token accounts

Request:

```bash
curl "https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenLargestAccounts",
    "params": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]
  }'
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "4.3.0",
      "slot": 453762067
    },
    "value": [
      {
        "address": "7KJjY7rArbydeLBF7gQ5LdqXRKRYyPArT99NEctsHsgU",
        "amount": "1189530071018777",
        "decimals": 6,
        "uiAmount": 1189530071.018777,
        "uiAmountString": "1189530071.018777"
      },
      {
        "address": "3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa",
        "amount": "677586520850189",
        "decimals": 6,
        "uiAmount": 677586520.850189,
        "uiAmountString": "677586520.850189"
      },
      {
        "address": "FSxJ85FXVsXSr51SeWf9ciJWTcRnqKFSmBgRDeL3KyWw",
        "amount": "131059147785626",
        "decimals": 6,
        "uiAmount": 131059147.785626,
        "uiAmountString": "131059147.785626"
      }
    ]
  },
  "id": 1
}
```

_Long arrays in this example were trimmed._

## Notes

- The example response holds 20 accounts. The example shows the first 3.
- At most 20 accounts are returned. There is no pagination and no parameter that changes the count.
- Available in every region on Blade Runner (2/s per key) and Nexus (30/s per key). Answers come from a dedicated token index, typically in a few milliseconds plus network time, so the call stays fast even for mints with millions of holders such as USDC or wSOL.
- Every returned account is checked against the node's state at `context.slot` before the response is sent, so a closed account or a changed balance is never returned.
- Accounts are sorted by `amount`, largest first. Accounts with equal amounts are ordered by the raw 32 bytes of their address, highest first. This is not the alphabetical order of the base-58 strings.
- Accounts with a zero balance appear only when fewer than 20 accounts hold a balance. They fill the remaining rows. Closed and uninitialized token accounts never appear; frozen accounts do. A mint with no token accounts returns an empty `value` array.
- `address` is the token account. Its owner, a wallet or a program, is a field of the token account: [`getMultipleAccounts`](/rpc/http/getmultipleaccounts/) with `encoding: "jsonParsed"` returns it as `data.parsed.info.owner`, for all 20 addresses in one call.
- Token-2022 mints with the interest-bearing extension: `uiAmount` and `uiAmountString` include the interest accrued up to the block time of `context.slot`. With the scaled UI amount extension, they are the raw balance times the multiplier in effect at that block time, rounded down to a whole raw unit, then divided by 10^decimals. When a mint has both extensions, the interest-bearing calculation applies, and `amount`, which sets the order of the rows, is always the raw on-chain balance.
- `commitment` defaults to `finalized` when `config` is omitted. `processed` is answered at `confirmed`: the accounts and `context.slot` are those of the latest confirmed slot.
- A `config` object must contain `commitment`. Without it, as in `{}` or `{ "minContextSlot": 1 }`, the call returns a `-32602` error that names the missing field. Other keys next to `commitment`, including `minContextSlot`, are ignored.
- Errors with code `-32602` (HTTP `200`): `Invalid param: WrongSize` or `Invalid param: Invalid` when the address is not a valid base-58 public key; `Invalid param: could not find mint` when no account exists at the address; `Invalid param: Token mint could not be unpacked` when the account is not a mint, which includes wallet and token account addresses; `Invalid param: not a Token mint` when the account has the layout of a mint but is not owned by the Token or Token-2022 program.
- Free and Operator keys get HTTP `403` with `getTokenLargestAccounts requires higher tier`. Over the per-second rate, the response is the standard rate-limit `429`. See [Errors](/rpc/errors/#gateway-errors).
- HTTP `429` with code `-32005` and `Node is unhealthy`: too many requests for this method were in progress at once, from your API key or from all keys together, and the request could not start within 5 seconds. Retry after a short pause.
- HTTP `503` with code `-32005` and `getTokenLargestAccounts is temporarily unavailable; retry shortly`: the method cannot be answered at that moment, for example at the requested commitment. The condition is temporary.

