Open 0x-r4bbit opened 6 months ago
@3esmit I've taken the contents of the document you've created (thanks for that btw!) and created this issue here so we can track its state accordingly.
I understand that this is quite a big task, especially considering that we'll need at least some unit/e2e tests that show satisfying scenarios.
We can break this down further if necessary.
Depends on #51
I started doing the changes as I have in my mind, but then I had the issue #51 as a blocker. This is needed because this changes will update this logic, and it also should be clear what changed. Currently it would be unclear what would be changed because its currently unclear what current behavior is, and if it was working, changing it could break it.
Thanks for the update, will have a look at #51
Contents copied from: https://notes.status.im/lNd8kcVmQEWcDYEldpl26Q
On StakeManager, accounts need to be processed every epoch.
When an account is processed, it gets Multiplier Points. An account can get Multiplier Points until it reaches a BOOST_LIMIT. BOOST_LIMIT is _stake * MAX_BOOST
The increase on each account MPs also incrases the total supply of MPs.
To distribute rewards, the formula uses total supply of MPs: ((userBalance + userMultipliers) / (epochTotalBalance + epochTotalMultipliers)) * epochReward
The increase on MPs impact how epochReward is calculated, as for every account processed, the next epoch would have more MPs.
Additionally, the total MPs gets inconstient for future epochs, in a scenario where many accounts didnt processed, it could happen that a past epoch have more MPs than the epoch after it, it would be possible to hard to do in current architecture.
The best solution would be to be able to predict how much MPs would be minted by the end of the epoch.