Maths
Last updated
Last updated
The staking mechanics incorporate different components in order to fulfil the following purposes:
Reward long-term stakers without hard locking the assets for longer periods of time than the mandatory 90 days lock.
Discourage gaming the distributions and reduce volatility (both in pool share and floor price) created by actors trying to do so.
Converge all long-term stakers shares toward the same nominal value per lizard, over successive distributions, to guarantee a fair distribution process.
Note: This section describes the basic mathematics behind the staking solution. In order to be programmed in Solidity, adjustments will be applied, keeping the same principles.
In order to both reward long-term stakers and discourage gaming distribution, staking is calculated through compounding rewards.
When a lizard is staked, a base weight of 1 is assigned. This weight will then compound at a rate of 0.5% per day.
W(t) = lizard weight t = time staked r = compounding rate
A lizard's share of the pool at a fixed distribution date is then calculated by dividing its weight by the sum of all weights in the pool.
S = the lizard's share of the pool W = the lizard's weight at the distribution time P = the sum of all weights in the pool at the distribution time
Since every lizard's staked follow the same rule, if no other lizards are added to the pool, each lizard's share of the pool remains constant in time. A lizard being staked at a later date will have a smaller share of the pool than the others, hence providing an advantage to long-term stakers.
Since the pool size inflates over time due to the rebasing, if no other mechanism were introduced, a late staker would never be able to catch up to long-term stakers and reach their nominal share of the pool per lizard (1/number of lizards in the pool).
To reward later participants for staking long-term, the inflation of the pool is partially reset every time a distribution has occurred, hence reducing the difference in share per lizard between the early stakers and late stakers that have been through one or more distributions.
This compound inflation will reset every rewards distribution cycle.
Each user is assigned a weight of 100 "shares", rebased at an additional 0.5% daily.
A global total of all shares is maintained and updated each time the stake or un-stake function is called, and whenever a new rewards "pool" is opened up.
A pool is created to represent a reset of inflated shares and additional rewards being claimable. A reset occurring means a user's inflated shares are slashed by 80%. User's inflated shares are calculated as:
However, a user's rewards will still be calculated off their pre-reset values for the corresponding pool created. Only future pools will take into account their reset shares. Users will also have different rewards based on which pool's rewards are being claimed.
Here is an example of this mechanism in action:
User A stakes 10 lizards on day 3 of the staking pool.
The existing staking pool had 1000 deposits on the start day, then another 1000 on day 2.
The existing global shares of day 1 would be 100,500.
The existing global shares of day 2 would be 201,502.5.
Day 3 ended and with User A, 490 more lizards were staked.
User A has a share of 1,005, with the global shares being 252,760.012.
User A has a weight of 0.3976%.
Before day 4 ends, 100,000 USDC is deposited into the pool. An additional 200 lizards were also deposited.
The current global shares are 272,760.012.
User A has a weight of 0.3685%.
User A's reward for pool 1 would be 368.5 USDC.
A reset occurs. The current inflated shares are 2760.012, and after the reset, will be 552.0024. Prior to the reset, the global shares will be 270,552.0024.