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:
| Field | Type | Description |
|---|---|---|
total | f64 | Total inflation rate |
validator | f64 | Inflation rate allocated to validators |
foundation | f64 | Inflation rate allocated to the foundation |
epoch | u64 | Epoch for which these values are valid |
Code Examples
cURL
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getInflationRate",
"params": []
}'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
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
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
{
"jsonrpc": "2.0",
"result": {
"total": 0.065,
"validator": 0.05,
"foundation": 0.015,
"epoch": 385
},
"id": 1
}