# getTokenSupply

> Returns the total supply of an SPL Token or Token-2022 mint.

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

`getTokenSupply` returns a mint's total supply as a raw integer and pre-divided by its decimals.

It reflects on-chain mint state at the requested commitment level, updating immediately as tokens are minted or burned.

- 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: All plans
- Rate limits: Free 5/s · Operator 50/s · Blade Runner 200/s · Nexus 500/s

## Parameters

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

- `mint` (string, required): Address of the mint account to check, base-58 encoded.
- `config` (object, optional): Commitment configuration.
  - `commitment` (string, optional, one of `finalized`, `confirmed`, `processed`, default `"finalized"`): Bank state to read the supply from.

## Result

- `result` (object, optional): The token supply, wrapped with context.
  - `context` (object, required)
    - `slot` (integer, optional)
    - `apiVersion` (string, optional)
  - `value` (object, required)
    - `amount` (string, required): Raw total supply in the mint's smallest unit, as a string.
    - `decimals` (integer, required): Number of decimal places the mint uses.
    - `uiAmount` (number | null, optional): Supply divided by 10^decimals, as a float.
    - `uiAmountString` (string, required): Supply divided by 10^decimals, as an exact decimal string.

## Example: Get total USDC supply

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": "getTokenSupply",
    "params": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]
  }'
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "4.3.0-rc.0",
      "slot": 447947016
    },
    "value": {
      "amount": "7684484927720180",
      "decimals": 6,
      "uiAmount": 7684484927.72018,
      "uiAmountString": "7684484927.72018"
    }
  },
  "id": 1
}
```

## Notes

- `uiAmountString` avoids the precision limits of `uiAmount`, a JSON float, for large-supply tokens.
- Wrapped SOL (`So11111111111111111111111111111111111111112`) always reports supply 0, since it is tracked via each token account's lamport balance, not the mint's supply counter.

