I was wondering how inflation rewards are added to a stake account. I can't find any transactions that transfer the rewards to a stake account. There is a special block where the inflation rewards are accounted for (usually the first block of the next epoch) but this block has 0 transactions.
I'm asking because I noticed some weird behaviour in epoch 683. I was querying the inflation rewards for a stake account at this epoch on three different dates. First it showed inflation rewards of 234966 lamports, then 234967 lamports and now again 234966 lamports. It differs only by one lamport, so I assume some rounding issues?
I'm using gagliardetto/solana-go to fetch the inflation rewards:
inflationReward, err := c.rpcClient.GetInflationReward(
context.Background(),
stakingAccount,
&rpc.GetInflationRewardOpts{
Epoch: epoch,
Commitment: rpc.CommitmentConfirmed,
},
)
The code fetches the inflation rewards of all stake accounts of a specific staker. These stake accounts get merged at some point. Could it be that there are rounding issues on chain when stake accounts get merged? Like one stake account has 5 lamports as rewards and the other 7 lamports but when merged it has only 11 lamports?