Generic Simulation Tool Docs
  • 👋Welcome to the Cenit tokenomics simulation platform
  • âœī¸Basic Editor
    • âš™ī¸Set up your Token Economy
    • 🔍Analyze and improve your Token Economy
  • 📊Advanced Editor
    • Introduction
      • Converting from the Basic editor
      • Creating from scratch with the Advanced editor
    • Advanced editor workflow
      • Allocation and Vesting
      • Agents and Token Flows
      • Input Parameters
      • Simulation Equations
      • Metrics
      • Sidebar Configuration
      • Results Graphs Configuration
    • How to adjust parameters in the simulation
    • How to add new token mechanics
  • OTHERS
    • Stuff to be aware of
      • Timestep length
      • Staker behavior
      • Market Liquidity
      • Token price
    • â„šī¸Formulae
Powered by GitBook
On this page
  1. Advanced Editor

How to add new token mechanics

PreviousHow to adjust parameters in the simulationNextStuff to be aware of

Last updated 9 months ago

We might encounter cases where we need to add a token mechanic that is not at all available through the Basic editor. In such cases, we can add it through the advanced editor.

For example, suppose we want to add an expenditure of the treasury related to the number of users on the platform, to represent infrastructure costs. Let’s assume the treasury is selling tokens to cover this cost.

Step 1: Changes in Agents and Token Flows

Since the Treasury agent is already in the simulation, we do not need to create a new one, simply add a new mechanic in which this agent participates. We need to create a new flow representing the action we want the treasury to take.

This new flow represents the treasury selling tokens to the market, so its Source is “Treasury” and its destination is the “Market”.

Step 2: Changes the equations

Next, we need to fill in the equation for the new token flow. The appropriate row in the equations table was created automatically with a default value of 0 when we added the new token flow in the previous section.

We want this selling flow to increase with the usage of the platform, since it’s meant to cover infrastructure costs.. We can do this by adding a multiplier on TDP_vp_1_growth_param to calculate the total infrastructure expenses. Let’s consider that we spend $0.01 USD for each dollar lent, which we will introduce as a new parameter, SP_vp_expense_operations. Additionally, since token flows are always defined as token units per time step, and the infrastructure expenses are in dollars per month, we need to multiply by the time step in months and divide by the token price or, in this case, an average of it.

Now, the system will look like this:

Note that the platform indicates that there is an error in the new equation we wrote. This is because we introduced a new static parameter (SP_vp_expense_operations) that we have not yet defined in the “Input Parameters'' section. We will do that next in order to fix this error.

Step 3: Changes in the input parameters

We simply need to introduce a new static parameter for the parameter we defined in the equation, and give it a default value.

Remember that to let the user change a static parameter and test it, we will need to add it into the sidebar section.

Step 4: Equations debugging

Now we can go to the simulation preview and check whether the numbers make sense.

In this example, we see that there is a moment when the treasury runs out of tokens, meaning the protocol does not have enough tokens to pay the expenses we introduced.

There are two possibilities:

  1. The simulation is well configured, indicating a problem with the treasury expenditure, which will run out of tokens quickly. This insight would mean we need to rethink the treasury expenditure.

  2. The simulation is ill-formed: Here, we realize that spending 0.01 USD in infrastructure for each dollar exchanged makes no sense, and that we actually meant 0.0001 USD.

After applying the change, the simulation runs normally.

We can now confirm the impact on the economy by looking at the buying and selling pressure charts ("Treasury sales to cover infrastructure", highlighted in red in the chart below).

Alternatively, we could create a custom metric and graph to visualize it. We will do that next.

Step 5: Configuration of reports

We can configure a report to provide a specific insight to the end user, or for internal consumption. This time, we will create a new graph for the report to understand treasury expenditure.

On the metrics screen, we introduce the flow that represents the token sale. We want to report this sale monthly, so we use the appropriate groupby function. Additionally, we need to represent the amount in USD, so we convert the tokens to USD.

Now that we have the metric ready, we can open the “Results Graph Configuration” and create the new graph.

We add our newly created metric as the variable to plot.

And then we add it in the “Results Graphs Configuration”

Finally, we are ready to “Go to results preview”.

Once we verify the impact is as expected, we should add the newly created input parameter in the “Sidebar Configuration” to let the user test it, since by default, the input parameters created in the setup are not visible from the dashboard. In this case, we can add it into the “User behavior” section.

With that, we will have completed a full iteration of the token economy.

📊