I am trying to calculate na IRR (internal rate of return) of all my staking operations, and for this I need all staking deposits, withdrawals, as well as all rewards calculated and awarded by validators at every epoch.
Deposits and withdrawals from the staking contract are easy to find, but I have absolutely no idea where/how to find the rewards.
Can someone put me on the right track? I'm expecting a transaction executed at the end of every epoch or something similar.
UPDATE: The most detailed description of the mechanics that I'm interested in seems to be on the staking-pool contract itself:
https://github.com/near/core-contracts/tree/master/staking-pool
And my understanding is that I could simply track my staked balance per validator from one transaction to another (the internal_ping function seems to be called all the time to distribute rewards).
So here goes the updated question:
What is the methodology of obtaining a time series of 'staking reward cash flows' - shall I simply look up the state of my staked balance on each of the validators that I delegated to for every epoch that I'm interested in, and 'piece together' the flows from the change in the staked balance?