Calculation of Tree Rewards
This page is an overview of how Badger tree rewards are distributed between users.
Previous Method for Calculating Tree Rewards
Rewards bot was taking snapshots for each user's balance for each vault on the last block of running rewards cycle.
Let's say user has some stake in some token in one of Badger's vaults...
The total balance of all other user balances in the vault is something like...
At this point, let's identify what is user's share of the vaults total balance...
Then there is the amount of rewards that has to be distributed for this particular vault...
Concluding everything from the above, our particular user will get 1% of the rewards pool...
With this method, users who deposited their funds at the end of the cycle, end up receiving a full cycles worth of rewards as though they had assets deposited the whole time. This is disproportionate to what they are in fact entitled to.
Introducing Tree TWAP rewards
To solve this problem, we are now taking multiple snapshots during the rewards cycle and calculating the TWAP price out of all balances.
The amount of snapshots we are going to take during cycle will be 3 but this can change and evolve over time.
Examples of How This Will Work
Example 1:
User has deposited funds at the beginning of the cycle and their balance doesn't change throughout. Totals also remains the same, assuming all users have not done anything with their funds.
Again:
We take 3 snapshots + the snapshot at the start cycle block and sum up each user's balances. As user had the same balance each time we take a snapshot, we will multiply user balance by 4...
As each user balance is summed up multiple times, totals will also be summed...
That same action is done to identify the user's share of the total vault balance...
User reward percentage will be 1% again but it was verified that user had their funds locked through the entire cycle.
Below is a more complex example.
Example 2:
User has deposited funds at the last block of currently running rewards cycle...
Taking multiple snapshots again, user didn't have any balance at any snapshot taken during cycle except the last one...
Let's check how that changes user's share of the rewards...
In this case, user's reward share is 0.25%.
This method gives more rewards to users who had their funds deposited the entire cycle, making this distribution more fair.
Example 3:
Let's imagine that user had their funds in one of vaults but decided to withdraw right after the first cycle block...
In this case, user who withdrew their funds after the first cycle block receives only 0.25% of the rewards share...
This gives users who had their funds in sett at the beginning of the cycle a fraction of rewards, instead of giving them nothing as was the process before.
Last updated
Was this helpful?