# getSupply

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:

```json
{
  "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:**

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

**Response:**

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

***

**Code Examples**

{% tabs %}
{% tab title="Nodejs" %}

```javascript
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);
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def get_supply(rpc_url):
    try:
        response = requests.post(
            rpc_url,
            headers={
                'Content-Type': 'application/json',
            },
            json={
                'jsonrpc': '2.0',
                'id': 1,
                'method': 'getSupply',
                'params': [
                    {
                        'excludeNonCirculatingAccountsList': True
                    }
                ]
            }
        )
        
        data = response.json()
        
        # Print the exact full response
        print('Full RPC Response:')
        print(json.dumps(data, indent=2))
        
        return data
        
    except Exception as error:
        print(f'Error getting health: {error}')
        return None

# Example usage
RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key'
get_supply(RPC_URL)
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "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**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coinvera.io/integration/solana/rpc/getsupply.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
