The Magic Behind the Commons Simulator — Part 2: Initialization

Vitor Marthendal
Commons Stack
Published in
8 min readMay 4, 2021

This is Part 2 of 3 of our “Deep Dive” into the inner workings of the Commons Simulator where we explain timesteps, states of key variables throughout the simulation, and simulation initialization. Much credit to Lauren Luz for co-authoring this piece with much fun, very deep thought, and so amazing writing skills.

Using cadCAD as a design tool for Regenerative Commons Economies

The Commons Simulator is a gamified computation tool powered by a cadCAD backend that blends art and simulation into a choose-your-own-adventure sci-fi storyline with possible dystopian or utopian endings. In the game, you travel back in time and use cadCAD as a tool to help a community design a regenerative Commons to advance the RadicalxChange movement, thereby saving the world from total planetary and economic destruction. In this series, we explore the intricacies of the cadCAD backend that powers this fun, engaging and user-friendly frontend. If you haven’t yet already, we recommend reading Part 1 of this series to get the necessary primer for understanding the magic-in-words we get into below 👇

Ready?

Timesteps

The Commons Simulator has a specific framework where the model behaviour is divided into a series of discrete slices of time called timesteps. Within a timestep, any set of mechanisms can be defined and performed. Each timestep uses the same sequence of mechanisms, and the output data from each timestep is used as the input data for the following timestep. A timestep can be set to represent any specific length of time; for us, it constitutes one day. The whole simulation lasts 1095 timesteps for a total of 3 years. A sequence of 13 mechanisms is executed for every timestep, i.e., day, meaning that the simulation result will be the outcome of 13*1095 = 14235 iterations on the state variables and mechanisms of the model!

States

The cadCAD modeling framework is based on the states of key variables, which are affected by endogenous (internal) and exogenous (environmental) processes through the system mechanisms (to be discussed in Part 3). To give you a better idea, when we discuss “states” we are referring to the conditions of key variables at different snapshots in time. During the simulation, the series of mechanisms is run many times iteratively. In one instant in time you can consider the key variables — Proposals, Participants, Funding Pool, RxC Reserve, and Sentiment — and get an idea of the condition of the Commons at that moment. This represents the general state of the Commons, which is essentially a combination of the “states” of each of those key variables.

In the following sections, we define the system states in the Commons Simulator using stock-and-flow diagrams that explain which mechanisms affect the model states.

1. Network

The network is a directed graph data structure where each node is either a participant holding RxC tokens or a proposal requesting funding. Each participant node has an affinity for each proposal node, and this is represented by the edges between the nodes. This affinity defines how inclined a participant is to vote on a given proposal.

Participant-Proposal Social Network Source: TokenEngineer

2. Proposals

Each proposal has 4 possible states: candidate, active, completed and failed. When a proposal is created, it starts as a “candidate”, with the future-saving RadicalxChange project plan and the amount of funds requested defined. If the proposal gets enough voting support and is funded, it becomes “active”, receiving the requested funds and starting to work to advance RxC goals. If a proposal accomplishes its stated objective, its state changes to “completed”. If the proposal does not achieve its goal, its state changes to “failed”. When a project either completes or fails, the participants with high affinity for that project will have a change in their overall Sentiment reflecting their reaction to the proposal’s final status.

Stock and Flow Diagram representing the four proposal states

3. Sentiment

Each participant has its own sentiment towards the Commons. The Average Commons Sentiment is measured by the mean sentiment of every participant. The initial Average Commons Sentiment is defined by the Hatch initialization, where each Hatcher is assigned a sentiment. After the Hatch phase, every new participant that enters the Commons is assigned a random sentiment, which affects the Average Commons Sentiment. The sentiment is positively affected when a proposal receives funds and becomes active, and when a proposal succeeds in completing its mission. Conversely, when a proposal fails (does not meet its goals) the Average Commons Sentiment goes down. Also, as we will explore later, there is a mechanism that introduces a small decline in sentiment (sentiment decay) over time due to a loss of interest in the Commons.

Stock and Flow Diagram representing the changes in sentiment due to corresponding mechanisms

4. Participants

There are two types of participants in the Commons. The Hatchers enter the Commons during the Hatch phase, bootstrapping the RadicalxChange Commons with funds. The amount of tokens a Hatchers receives are locked for a predefined period of time (lockup period). Thus, Hatchers can only exit the RadicalxChange Commons, (i.e., burn all of their tokens) after the lockup period when their tokens are unlocked. On the other hand, those participants that enter the Commons after the Hatch and add funds via the Augmented Bonding Curve (ABC) are called Regular Participants. Unlike the Hatchers, the Regular Participants’ tokens are not locked so they can burn and/or exit at the Commons at any time.

Stock and Flow Diagram representing the the journey of the Hatchers and the Regular Participants

5. Funding Pool

The Funding Pool funds the RadicalxChange Commons’ proposals. Funds flow into the pool during the Hatch phase when the Commons Tribute is applied, and when participants burn their tokens and pay an Exit Tribute. Funds flow out of the pool when a proposal passes.

Stock and Flow Diagram representing the flow of funds in the Funding Pool

6. Commons Reserve

The Commons Reserve uses xDAI to back the minted RxC token on the Augmented Bonding Curve. During the Hatch, the total amount invested by the Hatchers minus the Commons Tribute goes to the RxC Reserve to mint RxC tokens and define the initial token supply. After the Hatch period, every participant has the opportunity to mint new RxC tokens by adding xDAI to the Commons Reserve. If a participant wants to burn their tokens, the corresponding amount of xDAI will leave the RxC Reserve, an Exit Tribute will be deducted and sent to the Funding Pool, and the rest will go to the participant’s wallet.

Stock and Flow Diagram representing the flow of funds in the RxC Reserve

As you can see, the mechanisms performed by cadCAD change the states of key variables throughout the simulation. When considered together, metrics taken from these states provide information about the overall success of the Commons and ultimately affect the final prediction of the future.

Each of these states have initial values at the beginning of the simulation. These initial states are defined by the player’s inputs (i.e. number of Hatchers, number of initial proposals, etc., as described in Part 1) and some constant values. In the next section we go through the setup that occurs at the start of simulation, defined as “Simulation Initialization”.

You made it this far, keep on reading to learn more 😉

Simulation Initialization

To set everything up at the beginning of the simulation, a series of initial functions — performed only once — are executed and the initial states are set. This is referred to as the “Simulation Initialization”. These functions are outlined below.

1. Hatch Initialization

In this stage, every Hatcher, defined by the player’s input “Number of Hatchers”, contributes a percentage of their funds to the Hatch, given by the player’s input “Commons Tribute”. This initial contribution has a random distribution.

2. Augmented Bonding Curve (ABC) Initialization

To set up the Augmented Bonding Curve, the simulator deducts the player input “Commons Tribute” from the preset Hatchers’ initial contribution and adds it to the Funding Pool. The remaining funds are added to the RxC Reserve to back the RxC token.

Next, a desired token price is defined and a specific token supply, determined by the amount of funds in the RxC reserve, is created to keep this price according to the ABC.

Finally, the input “Exit tribute” (%) is configured on the ABC so new investors that exit after the Hatch period are required to “donate” that percentage of their retrieved investment to the Funding Pool.

3. Network Initialization

To complete the network initialization, some Hatchers are randomly chosen to create proposals. Each proposal requests some amount of funds for its completion, and each Hatcher is attributed a random affinity for each proposal. The number of initial proposals is defined by the player’s input in level 2.

Setting Up Initial Conditions of the Commons

The above initialization functions define Hatch phase: an event where Hatchers invest in the Commons, pay the Commons Tribute to fund future proposals, and have their tokens locked for a certain period. After the Hatch phase closes, iterative simulation with cadCAD begins (as we’ll get into in Part 3). During the following phase, the RadicalxChange Commons opens to new investors and the model will simulate new behaviors such as the effect of new members entering the Commons without having their tokens locked, the fluctuations causes by speculation, and more!

Nice job! You’re well on your way now to understanding the nitty-gritty inner workings of cadCAD magic as it is used to power the artistic and engaging Commons Simulator gamified educational webcomic.

In this post you learned about the following:

  • Timesteps
  • States of key variables
  • Simulation Initialization

In the third and final part of this series we will zoom in on the mechanisms performed sequentially and repeatedly throughout the simulation, and how they affect the states of key variables and produce at last the final prediction of Commons success. Stay tuned!

Thanks for sticking with us! We hope you’ll join us next time for Part 3. If you liked Part 2, give us a hand (or 50) 👏 and follow Commons Stack for the next episode. Learn more by trying out the simulator yourself, joining our team or checking out our repo on GitHub.

Help support us directly by liking or 👉👉 donating to our project 👈👈 on Giveth.io!

Don’t forget to join the Trusted Seed so you are eligible to participate in the upcoming Hatch of the TE Commons!

Thanks to Lauren Luz, Griff Green, Danielle Gennety, Santiago Gonzalez Toral, Merlin Egalite, Marko Prljic, Jeff Emmett, and Chuy Garcia for content, edits, and suggestions on this piece.

--

--