Calculation of Vault Scheduled Rewards
The logic of calculating scheduled rewards was similar to tree rewards calculation, when only one snapshot was taken per user in the end of the cycle.
That caused problems, as there is a high chance that some of users will deposit their funds at the end of the cycle and still get full reward amount. This results in reduced rewards for other users who had balances deposited during the entire cycle.
We solved this by taking multiple snapshots for different blocks during cycle, averaging each user balance.
Example 1:
User deposits funds at the beginning of the cycle and their balance doesn't change during the rewards cycle. Other user's balances also remain unchanged.
For vault scheduled rewards we take only 3 snapshots, at the start, end and somewhere in the middle of cycle.
Let's assume this user had 1000
boost since they are holding some amount of Badger tokens. Other users have no boost.
Now, totals will also change, as user balance was boosted
After that same action is done to identify what is user's share of the vault total balance:
User reward percentage will be 91**%** as ****their balance was boosted
Example 2 (more complex):
User with boost deposit funds at the end of the current rewards cycle.
Taking multiple snapshots again, user didn't have any balance at any snapshot taken during cycle except the latest one. Also, user has a boost of 1000.
Let's calculate user's share in pool and make sure it's less than in the Example 1:
As we can see from the number of 77% user's rewards will decrease. So even if user deposited a large amount of tokens and gets boosted by the end of cycle, they will still get less rewards than previously, giving more rewards to users who had their balance unchanged since the beginning of cycle.
Last updated
Was this helpful?