getSupply

Learn getSupply use cases, code examples, request parameters, response structure, and tips.

The getSupply RPC method in CoinVera returns detailed information about the current total and circulating supply of SOL on the Solana network. This includes both the total minted supply and the amount not held in any reserve or inactive accounts, giving insight into the actively circulating supply.


✅ Common Use Cases

  • Displaying SOL Supply Metrics Show total and circulating SOL on dashboards, explorers, or analytics platforms.

  • Tokenomics Tracking Monitor supply growth and how much SOL is locked or inactive.

  • Validator or Stake Program Integration Understand the context of staking and issuance when building financial tooling.


🧾 Request Parameters

Optional configuration object:

  • commitment (string, optional): The state commitment to query against—options are processed, confirmed, or finalized.

  • minContextSlot (number, optional): Ensures the node is caught up to at least a certain slot before responding.


📦 Response Structure

The result object includes supply and context information:

{
  "context": {
    "slot": 221446650
  },
  "value": {
    "total": 573264567999876000,
    "circulating": 487366912349870000,
    "nonCirculating": 85897655650006000,
    "nonCirculatingAccounts": [
      "11111111111111111111111111111111",
      "Stake11111111111111111111111111111111111111"
    ]
  }
}
  • total: Total supply of SOL in lamports (1 SOL = 1e9 lamports).

  • circulating: Estimated actively circulating SOL.

  • nonCirculating: Amount of SOL held in non-circulating accounts.

  • nonCirculatingAccounts: List of account addresses excluded from circulation.


🧪 Example

Get Current SOL Supply (Default Commitment)

Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getSupply"
}

Response:

{
  "result": {
    "context": { "slot": 221446650 },
    "value": {
      "total": 573264567999876000,
      "circulating": 487366912349870000,
      "nonCirculating": 85897655650006000,
      "nonCirculatingAccounts": [ ... ]
    }
  }
}

Code Examples

const fetch = require('node-fetch');

async function getSupply(rpcUrl) {
  try {
    const response = await fetch(rpcUrl, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'getSupply',
       "params": [
        {
            "excludeNonCirculatingAccountsList": true}
        ]
      }),
    });

    const data = await response.json();
    
    // Print the exact full response
    console.log('Full RPC Response:');
    console.log(JSON.stringify(data, null, 2));
    
    return data;
  } catch (error) {
    console.error('Error getting health:', error.message);
    return null;
  }
}

// Example usage
const RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';

getSupply(RPC_URL);

Example Response

{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "2.3.0",
      "slot": 355400253
    },
    "value": {
      "circulating": 538167181851082240,
      "nonCirculating": 67728473743944220,
      "nonCirculatingAccounts": [],
      "total": 605895655595026400
    }
  },
  "id": 1
}

💡 Developer Tips

  • Use Circulating Supply for Market Metrics Circulating supply is often more relevant than total supply for calculating real market cap.

  • Expect Large Numbers All supply-related values are returned in lamports, not SOL—divide by 1e9 for readability.

  • Non-Circulating Accounts Are Transparent You can track which accounts are excluded from circulating calculations.

  • Add Commitment for Consistency Specify finalized if you require a confirmed view across validators.


The getSupply method is essential for any application needing accurate supply metrics or network economic insights, all delivered with speed and transparency through CoinVera.

Last updated