---
title: getInflationReward
description: >-
  Returns the inflation reward credited to each supplied address for an epoch.
  Depending on the supplied address, this may be a staking reward or a voting
  reward.
url: /docs/rpc/http/getinflationreward
type: reference
hideTableOfContents: true
---

Returns the inflation reward credited to each supplied address for an epoch.
Depending on the supplied address, this may be a staking reward or a voting
reward.

<Callout type="info" title="Source">
  [`get_inflation_reward`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L696)
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getInflationReward",
  "params": [
    // !hover(1:4) addresses
    [
      "6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu",
      "BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"
    ],
    // !hover(1:4) config
    {
      // !hover epoch
      "epoch": 800,
      // !hover commitment
      "commitment": "finalized"
    }
  ]
}
```

```ts !!request title="Kit"
import { address, createSolanaRpc } from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

// !hover(1:4) addresses
let addresses = [
  address("6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu"),
  address("BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2")
];

// !hover epoch
let epoch = BigInt(2);

let inflationReward = await rpc.getInflationReward(addresses, { epoch }).send();

console.log(inflationReward);
```

```ts !!request title="web3.js"
import { Connection, PublicKey, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

// !hover(1:4) addresses
let addresses = [
  new PublicKey("6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu"),
  new PublicKey("BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2")
];

// !hover epoch
let epoch = 2;

let inflationReward = await connection.getInflationReward(addresses, epoch);

console.log(inflationReward);
```

```rs !!request title="Rust"
use anyhow::Result;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;
use solana_sdk::pubkey;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://api.devnet.solana.com"),
        CommitmentConfig::confirmed(),
    );

    // !hover(1:4) addresses
    let addresses = [
        pubkey!("6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu"),
        pubkey!("BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"),
    ];

    // !hover epoch
    let epoch = 2;

    let inflation_reward = client.get_inflation_reward(&addresses, Some(epoch)).await?;

    println!("{:#?}", inflation_reward);

    Ok(())
}
```

### !params

#### !! addresses

!type array  
!required

An array of addresses to query, as base-58 encoded strings

#### !! config

!type object  
!optional

Configuration object containing the following fields:

##### !! commitment

!type string  
!values processed confirmed finalized  
!default finalized

Solana RPC uses the following commitment levels:

| Value       | Description                                                                                                                                                                                                                                                                |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `processed` | Return data from the highest slot this node has processed on the fork it currently considers best. This is the newest view, but it can still change if the cluster switches forks.                                                                                         |
| `confirmed` | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. This is more stable than `processed`, but it is still a weaker guarantee than `finalized`.                                                                       |
| `finalized` | Return data from the highest slot that the cluster recognizes as finalized. In practice, this means the slot has reached maximum vote lockout in validators' vote towers and is recognized by at least two-thirds of active stake. This is the strongest commitment level. |

##### !! epoch

!type u64

An epoch for which the reward occurs. If omitted, the previous epoch will be
used

##### !! minContextSlot

!type number

The minimum slot that the request can be evaluated at

```json title="Example"
{ "minContextSlot": 341197000 }
```

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover(1:10) result
  "result": [
    {
      // !hover epoch
      "epoch": 2,
      // !hover effectiveSlot
      "effectiveSlot": 224,
      // !hover amount
      "amount": 2500,
      // !hover postBalance
      "postBalance": 499999442500,
      // !hover commission
      "commission": null
    },
    null
  ],
  "id": 1
}
```

!type array

The result field will be a JSON array whose elements are either reward objects
or `null` when no reward data is available for the corresponding input address:

##### !! epoch

!type u64

Epoch for which reward occurred

##### !! effectiveSlot

!type u64

The slot in which the rewards are effective

##### !! amount

!type u64

Reward amount in lamports

##### !! postBalance

!type u64

Post balance of the account in lamports

##### !! commission

!type u8 | null

Vote account commission when the reward was credited

</APIMethod>
