Staker behavior

One of the most recurrent utilities in the token economy is staking. Stakers will purchase tokens and stake them as long as the yield offered by the protocol is higher than the expected APY of the market. To model this, we need to implement several lines of Simulation Equations.

Imagine an example where the rewards for stakers are:

  1. Fees from the protocol, determined by the variable VA_fees_to_stakers.

  2. Extra incentives to stakers, determined by VA_emissions_to_stakers_value_eavg.

The equations would be:

VA_staking_equilibrium_tokens

(VA_fees_to_stakers + VA_emissions_to_stakers_value_eavg) / (VA_eavg_token_price * time_step.years * SP_competitive_market_apy_percent/100)

This first equation establishes how many tokens are required to stake at each time to reach equilibrium with the expected APY. Based on the currently staked tokens and the ones that should be staked, we calculate the total amount of tokens that will be purchased or sold in the market to achieve equilibrium. Lastly, we create some stability constraints on VA_staked_tokens_traded.

VA_desired_staked_tokens_variation

MAX(VA_staking_equilibrium_tokens - A_stakers.total_tokens, VA_locked_staked_tokens - A_stakers.total_tokens)

VA_staked_tokens_traded

MAX(MIN(VA_desired_staked_tokens_variation.previous, market_tokens.previous * (1-EXP(-time_step.days/SP_liquidity_time_constant))), - market_tokens.previous * (1-EXP(-time_step.days/SP_liquidity_time_constant/30)))

We then have a mechanism to ensure some token staking lock-up in the following rows:

VA_locked_staked_tokens_array

store_amount(VA_locked_staked_tokens_array.previous, MAX(0, VA_staked_tokens_traded), SP_staking_max_timelock, time.months)

VA_locked_staked_tokens

stored_total(VA_locked_staked_tokens_array.previous)

To add another stream of revenue directed to the stakers, we should adapt the VA_staking_equilibrium_tokens formula to include those revenues. Ensure that the currencies are in USD per timestep for each of them.

Last updated