getSupply - Solana

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

ParameterTypeRequiredDescription
configobjectNoConfiguration object controlling commitment and account listing

Config Object

FieldTypeRequiredDescription
commitmentstringNoCommitment level: processed, confirmed, or finalized. Defaults to finalized
excludeNonCirculatingAccountsListbooleanNoOmit the array of non-circulating account addresses from the response

Request

bashcurl --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

javascriptconst { 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

pythonimport 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'])

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "getSupply",
            "params": [{"commitment": "finalized", "excludeNonCirculatingAccountsList": true}],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;

    println!("Result: {}", response["result"]);
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "context": {
            "slot": 397234561
        },
        "value": {
            "circulating": 542837291043872913,
            "nonCirculating": 18402937182937,
            "nonCirculatingAccounts": [],
            "total": 542855693981055850
        }
    }
}

Response Parameters

ParameterTypeDescription
jsonrpcstringJSON-RPC protocol version ("2.0")
idstringRequest identifier matching the request
resultobjectRPC response object where value holds the supply breakdown in lamports

Value Object

FieldTypeDescription
totalnumberTotal SOL supply in lamports
circulatingnumberCirculating supply in lamports
nonCirculatingnumberNon-circulating supply in lamports
nonCirculatingAccountsarrayAddresses 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 CodeMessageDescription
-32602Invalid paramsUnrecognized commitment level in the config object
-32603Internal errorNode failed to scan non-circulating accounts
-32005Node is unhealthyThe node has fallen behind the cluster tip