A cadCAD Design Digital Twin for Subspace Network Economic Dynamics.
A stock and flow description for SSC on the tokeconomics of Subspace. This model uses this as the departure point for the dynamics being simulated.
A stock and flow description for Staking Pool Shares
This Digital Twin is a Stock & Flow representation for the SSC token dynamics as they flow through Subspace's distinct mechanisms. Balances on the system are split across economic sectors of interest: Farmers, Operators, Nominators and Holders, each one with distinct admissible actions.
The parameters, mechanisms and their constituint logic were based mainly on
Subnomicon and Token Economics design documents that were provided. Several
assumptions were required to be done, and they're indicated with XXX
tags
through this repo.
- Option 1 (CLI): Just pass
python -m subspace_model
This will generate an pickled file atdata/simulations/
using the default single run system parameters & initial state.- To perform a multiple run, pass
python -m subspace_model -e
- To perform a multiple run, pass
- Option 2 (cadCAD-tools easy run method): Import the objects at
subspace_model/__init__.py
and use them as arguments to thecadCAD.tools.execution.easy_run
method. Refer tosubspace_model/__main__.py
to an example.
├── notebooks
│ ├── fund_inclusion.ipynb
│ ├── issuance_sweep.ipynb
│ ├── reward_split_sweep.ipynb
│ ├── sanity_check.ipynb
│ └── standard_stochastic.ipynb
├── README.md
├── requirements.txt
├── resources
│ ├── shares-stock-flow.png
│ └── ssc-stock-flow.png
└── subspace_model
├── __init__.py
├── __main__.py
│ ├── experiment.py
│ ├── logic.py
│ ├── params.py
│ ├── structure.py
│ └── types.py
├── const.py
├── metrics.py
├── trajectory_metrics.py
Digital twin python modules.
Python Module | Purpose |
---|---|
experiment.py | Code for running experiments, parameter sweeps, and scenario planning. |
logic.py | All logic for substeps of blocks. Informs how state is mutated. |
params.py | System parameters, initial state, and standard parameters. |
structure.py | The model structure as a netlist that wires state update blocks. |
types.py | Type definitions for the model state and parameters. |
const.py | System constants |
metrics.py | System metrics |
trajectory_metrics.py | Metrics that require trajectory dataset. |
cadCAD (complex adaptive dynamics Computer-Aided Design) is a python based modeling framework for research, validation, and Computer Aided Design of complex systems. Given a model of a complex system, cadCAD can simulate the impact that a set of actions might have on it. This helps users make informed, rigorously tested decisions on how best to modify or interact with the system in order to achieve their goals. cadCAD supports different system modeling approaches and can be easily integrated with common empirical data science workflows. Monte Carlo methods, A/B testing and parameter sweeping features are natively supported and optimized for.
For more information on cadCAD:
- https://community.cadcad.org/t/introduction-to-cadcad/15
- https://community.cadcad.org/t/putting-cadcad-in-context/19
- https://github.com/cadCAD-org/demos
1. Pre-installation Virtual Environments with venv
(Optional):
It's a good package managing practice to create an easy to use virtual environment to install cadCAD. You can use the built in venv
package.
Create a virtual environment:
$ python3 -m venv ~/cadcad
Activate an existing virtual environment:
$ source ~/cadcad/bin/activate
(cadcad) $
To Deactivate virtual environment:
(cadcad) $ deactivate
$
Requires >= Python 3.6
Install all packages with requirement.txt
$ pip3 install -r requirements.txt