For the complete documentation index, see llms.txt. This page is also available as Markdown.

getSupply - Solana

Example code for the getSupply JSON-RPC method. Complete guide on how to use the getSupply JSON-RPC method in the GetBlock Web3 documentation.

This method returns total, circulating, and non-circulating SOL supply in lamports. The list of non-circulating accounts can be omitted to reduce response size.

Parameters

Parameter
Type
Required
Description

config

object

No

Configuration object controlling commitment and account listing

Config Object

Field
Type
Required
Description

commitment

string

No

Commitment level: processed, confirmed, or finalized. Defaults to finalized

excludeNonCirculatingAccountsList

boolean

No

Omit the array of non-circulating account addresses from the response

Request

curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getSupply",
    "params": [{"commitment": "finalized", "excludeNonCirculatingAccountsList": true}],
    "id": "getblock.io"
}'
example.js
const { Connection } = require('@solana/web3.js');

const connection = new Connection('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', 'finalized');

const { value } = await connection.getSupply({
  excludeNonCirculatingAccountsList: true
});

console.log(value.circulating, value.total);
example.py
import requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'getSupply',
        'params': [{"commitment": "finalized", "excludeNonCirculatingAccountsList": true}],
        'id': 'getblock.io'
    }
)

print(response.json()['result'])

Response

Response Parameters

Parameter
Type
Description

jsonrpc

string

JSON-RPC protocol version ("2.0")

id

string

Request identifier matching the request

result

object

RPC response object where value holds the supply breakdown in lamports

Value Object

Field
Type
Description

total

number

Total SOL supply in lamports

circulating

number

Circulating supply in lamports

nonCirculating

number

Non-circulating supply in lamports

nonCirculatingAccounts

array

Addresses holding non-circulating supply, empty when excluded

Use Cases

  • Market Cap: Multiply circulating supply by SOL price for market capitalization

  • Staking Ratio: Compare total active stake against circulating supply

  • Vesting Analysis: Track how non-circulating balances unlock over time

  • Network Reports: Publish verified supply figures rather than third-party estimates

Error Handling

Error Code
Message
Description

-32602

Invalid params

Unrecognized commitment level in the config object

-32603

Internal error

Node failed to scan non-circulating accounts

-32005

Node is unhealthy

The node has fallen behind the cluster tip

Last updated

Was this helpful?