Documentation index

getInflationRate

Returns the specific inflation values for the current epoch, including the total inflation rate, the portion going to validators, and the portion going to the foundation. Unlike getInflationGovernor which returns the schedule parameters, this method returns the actual calculated rates for the current epoch. This is the go-to method for displaying current staking APY and understanding real-time inflation metrics.

Parameters

This method does not accept any parameters.

Response

Returns an object:

FieldTypeDescription
totalf64Total inflation rate
validatorf64Inflation rate allocated to validators
foundationf64Inflation rate allocated to the foundation
epochu64Epoch for which these values are valid

Code Examples

cURL

Terminal
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getInflationRate",
  "params": []
}'

TypeScript

TypeScript
const response = await fetch("http://88.216.36.108:7999", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getInflationRate",
    params: []
  }),
});
const { result } = await response.json();
console.log("Total inflation:", (result.total * 100).toFixed(2) + "%");

Python

Python
import requests

response = requests.post("http://88.216.36.108:7999", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getInflationRate",
    "params": []
})
result = response.json()["result"]
print(f"Total inflation: {result['total']*100:.2f}%")

Rust

Rust
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client.post("http://88.216.36.108:7999")
        .json(&json!({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "getInflationRate",
            "params": []
        }))
        .send().await?
        .text().await?;
    println!("{}", res);
    Ok(())
}

Example Response

JSON
{
  "jsonrpc": "2.0",
  "result": {
    "total": 0.065,
    "validator": 0.05,
    "foundation": 0.015,
    "epoch": 385
  },
  "id": 1
}