How to adjust parameters in the simulation
Last updated
Last updated
Most of the time, the simulations generated with the Basic editor are almost what we need for our project, but we want some further adjustments. Some instances where this might be the case are:
We want to add some different hypothetical scenarios for the users to test (e.g. base scenario, pessimistic, and optimistic)
We want to adapt some incentive schedule to a formula more complex than what is available in the Basic editor, for instance one that depends on a given protocol performance parameter, and not just time.
We want to change protocol fee distribution percentages over time.
These are the easiest changes and can be done by modifying only some âInput parametersâ and âSimulation equationsâ. Here are examples of the steps to follow:
For this example, we want to add a selector available to the results dashboard end-users where they can change between different hypothetical scenarios for the future growth of the protocol. We would do the following:
Find each time-dependent parameter representing a growth hypothesis of the protocol. Usually there is one for each value proposition defined (for example TDP_VP_1_GROWTH_PARAM)
Create one time-dependent parameters for each growth scenario we want to consider for the selector
Generate the selector in âInput parametersâ with the different options desired (e.g. âLow adoptionâ, âMid adoptionâ, and âHigh adoptionâ)
Find in the âSimulation equationâ the references to the original time dependent parameter and replace them with the selector.
For example: TDP_vp_1_growth_param should be replaced with SE_preset_scenarios.case("High adoption": TDP_vp_1_growth_param_high, "Mid adoption": TDP_vp_1_growth_param_mid, "Low adoption": TDP_vp_1_growth_param_low).
Then, add the selector to the inputs available to the user through the âSidebar Configurationâ section.
For this example, we want to adjust the release schedule of a token incentive. Following the recommended workflow, we generated the starting point for this simulation through the Basic editor, which included an Incentives Reserve and a linear incentive release schedule. When we converted the simulation to the Advanced editor mode, this got interpreted as an âIncentives Reserveâ agent to hold the token incentives and a âIncentives Reserve distributionâ flow to release them. In order to adjust it to our precise definition:
Identify the agent that holds the tokens for that incentive, in the âAgents and Token Flowsâ section.
2. In the âToken Exchange Flowsâ table of the same section, identify the token flow that distributes those tokens to their recipients. It will have the previously identified agent as its âSourceâ.
3. Find the equation corresponding to the value of the token flow in the âSimulation Equationsâ section and substitute with the appropriate formula.
In the example shown in the images, the original amount of tokens distributed as incentives is all of the amount vested at each timestep (which means that in the Basic editor we selected âdistribute as it vestsâ).
If instead we want to distribute rewards each year at a rate that decreases over time, we would change the formula to:
(1 - SP_yearly_rewards_decay_percent / 100)^(time.years // 1) * time_step.years * SP_initial_tokens_incentives
In this formula, every year there is a decay of SP_yearly_rewards_decay_percent relative to the original amount of tokens given SP_initial_tokens_incentives.
We can also introduce a threshold to ensure the tokens given are not greater than the tokens that the reserve has:
MIN(A_incentives_reserve_1.total_tokens.previous, (1 - SP_yearly_rewards_decay_percent / 100)^(time.years // 1) * time_step.years * SP_initial_tokens_incentives)
This is our new âF_INCENTIVE_1â.
We will also need to add the static parameters SP_yearly_rewards_decay_percent and SP_initial_tokens_incentives that we introduced in the formula to the âInput Parametersâ section, and assign them default values.