RPC Guides
How to Use getSupply
Learn getSupply use cases, code examples, request parameters, response structure, and tips.
The getSupply
RPC method provides information about the current supply of SOL on the Solana network. It details the total supply, circulating supply, non-circulating supply, and can optionally list non-circulating accounts.
Common Use Cases
- Understanding SOL Tokenomics: Get a snapshot of the current distribution of SOL.
- Economic Analysis: Track changes in supply metrics over time.
- Displaying Network Statistics: Provide users with up-to-date information on SOL supply in dashboards or explorers.
- Inflation Monitoring: Although
getInflationRate
andgetInflationGovernor
provide more direct inflation data,getSupply
can offer a broader context.
Request Parameters
The getSupply
method accepts an optional configuration object with the following fields:
commitment
(string, optional): Specifies the commitment level for the query. If omitted, the default commitment of the RPC node is used.excludeNonCirculatingAccountsList
(boolean, optional): If set totrue
, thenonCirculatingAccounts
array will be excluded from the response. Defaults tofalse
. This can be useful to reduce response size if the list of individual non-circulating accounts is not needed.
Example Configuration:
Response Structure
The response is a JSON object with the following fields:
value
: An object containing the supply information:total
(u64): The total SOL supply in lamports.circulating
(u64): The circulating SOL supply in lamports.nonCirculating
(u64): The non-circulating SOL supply in lamports.nonCirculatingAccounts
(array of strings, optional): An array of public keys (as base58 encoded strings) of accounts holding non-circulating SOL. This field is omitted ifexcludeNonCirculatingAccountsList
was set totrue
in the request.
context
: An object containing:slot
(u64): The slot at which the information was retrieved.
Example Response (with excludeNonCirculatingAccountsList: false
):
Example Response (with excludeNonCirculatingAccountsList: true
):
Code Examples
Developer Tips
- Lamports vs. SOL: The amounts are returned in lamports. Remember to divide by
1,000,000,000
(1 SOL = 10^9 lamports) to convert to SOL. - Data Freshness: The data reflects the state at the slot indicated in the
context
object and based on the commitment level used. excludeNonCirculatingAccountsList
: Use this option if you only need the aggregate supply numbers to optimize the response size and processing time, especially if the list of non-circulating accounts is very long.- Dynamic Values: The supply figures can change frequently due to token issuance (inflation) and burning mechanisms.
This guide should help you effectively use the getSupply
RPC method to query Solana’s supply data.