getInflationReward
The getInflationReward method returns the inflation (staking) rewards received by a list of addresses for a specific epoch. This method is essential for tracking actual rewards earned by stakers and validators, enabling accurate reward history, tax reporting, and performance analysis.
Solana distributes staking rewards at the beginning of each new epoch to all accounts that had staked tokens during the previous epoch. The reward amount depends on the total amount staked, the validator's performance, the validator's commission rate, and the network's inflation rate. This method allows you to query the exact lamport amount of rewards received by specific stake accounts for any completed epoch.
This method is crucial for staking dashboards, wallet applications, tax reporting tools, and validator performance analyzers. It provides authoritative data about actual rewards distributed, which can differ from projected rewards due to validator performance variations, commission changes, or slashing events. The method supports querying multiple addresses in a single call for efficient batch processing.
Parameters
parameter | type | description |
|---|---|---|
addresses | array | Array of address strings (base-58 encoded) to query for inflation rewards |
config | object | Optional configuration object |
config.commitment | string | Level of commitment: 'confirmed' or 'finalized' (default: 'finalized') |
config.epoch | number | Optional. The epoch for which to fetch rewards. Defaults to the previous completed epoch |
config.minContextSlot | number | Optional. Minimum slot that the request can be evaluated at |
Return Object
field | type | description |
|---|---|---|
result | array | Array of reward objects or null for each address (null if address did not receive rewards) |
result[].epoch | number | The epoch for which the reward was distributed |
result[].effectiveSlot | number | The slot in which the rewards were distributed |
result[].amount | number | Reward amount in lamports |
result[].postBalance | number | Account balance in lamports after the reward was applied |
result[].commission | number|null | Validator commission rate when the reward was credited, or null for non-validator accounts |
Request Example
Response Example
Tip: Returns null for addresses that didn't receive rewards in the specified epoch (e.g., not staked, inactive validators). The commission field is only populated for vote accounts (validators). Query the previous epoch for most recent distributed rewards. Rewards are distributed at the start of each new epoch.