I'm thinking which events/calls (or whatever) should I take into account to get a number of staked in the protocol? I did this exercise for Reef protocol (but this should be similar for all Substrate protocols) based on 'Staking.Bonded' and 'Staking.Withdrawn' events, but my number does not match with a presented on the reef protocol subscan - 6.2B . I would like to be able to calculate this metric on a wallet level in the future incl. historical values that's why I'm trying to do it based on events.
In other words, which events are responsible for increasing a number of staked tokens and which ones decrease this value?