# getInflationRate

The `getInflationRate` RPC method returns a **snapshot of inflation distribution** for the **current epoch**, including how new SOL issuance is allocated between validators and the Solana Foundation. It provides a real-time view into the **annualized inflation rate** applied to token rewards and economic modeling.

***

#### ✅ Common Use Cases

* **Estimate Staking Returns**\
  View the current **annualized inflation rate** allocated to validators—useful for estimating staking APRs.
* **Track Foundation Allocation**\
  Monitor the proportion of inflation being distributed to the **Solana Foundation** during the current epoch.
* **Analyze Current Economic Metrics**\
  Fetch up-to-date inflation data to evaluate Solana’s token issuance behavior in the active epoch.

***

#### 🛠 Request Parameters

This method **does not require any parameters**.

***

#### 📦 Response Structure

The `result` field returns an object:

```json
{
  "total": 0.065,
  "validator": 0.06,
  "foundation": 0.005,
  "epoch": 540
}
```

| Field        | Type  | Description                                                                     |
| ------------ | ----- | ------------------------------------------------------------------------------- |
| `total`      | *f64* | Total inflation rate for the current epoch (e.g., `0.065` = 6.5% annualized).   |
| `validator`  | *f64* | Portion of inflation allocated to validators (e.g., `0.06` = 6%).               |
| `foundation` | *f64* | Portion of inflation allocated to the Solana Foundation (e.g., `0.005` = 0.5%). |
| `epoch`      | *u64* | Epoch number to which the inflation rates apply.                                |

***

#### 💡 Example: Fetch Current Inflation Rates

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

***

**Code Examples**

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

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

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

    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';

getInflationRate(RPC_URL);
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def get_inflation_rate(rpc_url):
    try:
        response = requests.post(
            rpc_url,
            headers={
                'Content-Type': 'application/json',
            },
            json={
                'jsonrpc': '2.0',
                'id': 1,
                'method': 'getInflationRate'
            }
        )
        
        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_inflation_rate(RPC_URL)
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "jsonrpc": "2.0",
  "result": {
    "epoch": 822,
    "foundation": 0,
    "total": 0.04395241940186995,
    "validator": 0.04395241940186995
  },
  "id": 1
}
```

***

#### 🧠 Developer Tips

* **Epoch-Specific Data**\
  These values are **specific to the current epoch**. To understand future trends or configurations, use `getInflationGovernor`.
* **Annualized Rates**\
  Although values apply to the current epoch, they are expressed as **annualized percentages**, allowing for straightforward APR comparison.
* **Rates Evolve Over Time**\
  The inflation rate tapers gradually based on the long-term monetary policy. While `getInflationGovernor` outlines the trajectory, `getInflationRate` shows the effective rate **right now**.
* **Use in Wallets & Dashboards**\
  Integrate this endpoint to display real-time APR insights to delegators and validators.


---

# 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/getinflationrate.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.
