A modular agent-based model of the Lido Dual Governance system, based on the open-source Solidity implementation.
Implements the official Lido Dual Governance specifications
This model utilizes an open-source Python library radCAD, an extension to cadCAD.
The model implements the official Lido Dual Governance Specification wherever possible, and adds additional actor-level assumptions for simulations detailed in the ASSUMPTIONS.md document.
The main model capabilities are described in the MODELLING_CAPABILITIES.md document. There you find:
- Current model state
- Parametrized elements of DG
- Available scenario analytics
- Tested scenario templates
- Possible questions to be answered
- Scenarios in the research pipeline
You could either look into already completed simulation notebooks in the folder or run simulations on your local machine via the instructions below.
- Clone or download this GitHub repository by running
git clone https://github.com/collectif-dao/dg-research.git
in your terminal. - Set up your development environment using Anaconda virtual environment:
This guide provides step-by-step instructions on how to set up an Anaconda virtual environment for your project. This documentation assumes that you have Anaconda or Miniconda installed on your system.
If you haven't already installed Anaconda or Miniconda, you can download and install it from the official website:
To create a new virtual environment, use the following command:
conda create --name lido-dual-governance-abm
To start using the virtual environment, you need to activate it:
conda activate myenv
Once the environment is activated, you can install the necessary packages. You can install the packages using:
conda install --file requirements.txt
Or alternatively using pip:
pip install -r requirements.txt
Or by using a target from Makefile
:
make install
The Makefile
provides a set of targets to automate the execution of different simulations.
To run all the defined simulations in sequence, use the following command:
make run_simulations
This will execute the all existing simulations in order.
Or you can run a specific simulation by it's name, for example:
make model_validation
Current model code has been tested on Python 3.12 version, so please let us know if you're facing issues with older versions.
We use Pytest to test the model code, as well as the notebooks.
To execute the Pytest tests simply run:
pytest
We use Scalene to benchmark CPU/GPU and Memory consumption. After running a benchmark Scalene will open a Web UI with details on the simulation consumption.
Note
If you're running on Windows you'll be able to see reports only on CPU and GPU profiling, but not memory or copy profiling.
The following command runs Scalene on a provided benchmark.
scalene benchmarks/memory_profiling.py
WIP: Would be provided in later stage