1

I'm trying to gather all the staking rewards I've received for tax purposes.

I've been calling getInflationReward, which worked fine up until epoch 398. For some reason, it returns null for all the addresses I tried after epoch 398.

The payload I'm sending looks like this:

{
    "jsonrpc":"2.0",
    "id":123, 
    "method":"getInflationReward", 
    "params": [["My Address"], 
        {
            "epoch": 398
        }
    ] 
}

For epochs 398+, I get this response:

{
    "jsonrpc": "2.0",
    "result": [
        null
    ],
    "id": 123
}

Is there a known issue or some change at epoch 398 that might cause this?

Thanks.

1 Answer 1

2

null response means there was no staking reward. I tried getInflationReward for an account I know has been staked and active during epoch 398 and I managed to get a response for epochs around 398 with no problem.

I think your issue is that the account you're querying has been inactive after epoch 398 and not generating rewards.

Check if an account has been active for a specific epoch with this rpc call:

curl https://api.mainnet-beta.solana.com -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getStakeActivation",
    "params": [
      "My Address",
      {
        "epoch": 399
      }
    ]
  }
'

If you can pass the account pubkey in question, I can look further into it.

1
  • I think you're right. Thank you for your answer. Commented Sep 8, 2023 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.