StableSims is an open-source project aimed at simulating MakerDAO's Dai stablecoin system

Overview

StableSims

StableSims is an open-source research project aimed at optimizing MakerDAO Liquidations 2.0 incentive parameters (chip and tip).

This project is conducted through Blockchain @ Berkeley, and TAKES NO CREDIT FOR THE MAKER PROTOCOL LOGIC THAT WAS COPIED VERBATIM FROM THE SOURCE CODE.

You can find the summary of our findings in our research paper.

Getting started

  1. Make sure you have Docker installed.
  2. Clone the repo
  3. Create a docker container to run the simulations in:
docker run -it -v PATH_TO_REPO:/stablesims python:3.9 bash
  1. Inside the docker shell, run:
cd stablesims
pip install -r requirements.txt
  1. To run the simulation, run:
python run.py
Comments
  • Connect ETH price feed

    Connect ETH price feed

    We need a feed of ETH prices to drive simulation dynamics.

    Our options here are to use a random process (Ornstein-Uhlenbeck) to completely model the ETH price, or to sample from a historical distribution.

    We should start with the latter, though it will be confounded by ETH market idiosyncrasies from the sample time frame. This is preferable when investigating Black Thursday, but not for generalized hypotheses.

    cadcad 
    opened by akirillo 2
  • implement keeper policy functions and bidding models

    implement keeper policy functions and bidding models

    • add keeper_bid and keeper_bid_generator to policies.py
    • create new models.py to hold bidding models
    • assumed that state for keepers would change to object withkeeper id as key and bidding model value
    opened by sehyunc 1
  • Model Vault Opening/Closing Behavior

    Model Vault Opening/Closing Behavior

    We need to decide on system-wide and keeper-specific behavior regarding opening and closing Vaults.

    We will definitely need a warmup period of Vault opening to start the simulation. However, we may also need a random process to model the opening of arbitrary Vaults over the course of the simulation, and potentially separate logic governing how Keepers interact with their Vaults.

    Similarly, we will have to decide on the system semantics for Vault closure.

    Since the Dai system doesn't explicitly react to price, this will likely be our price-reactive model component. At a high level, one is incentivized to open a Vault if they believe Dai price will go up, and to close a Vault if they believe Dai price will go down.

    cadcad 
    opened by akirillo 1
  • Frontend Demo with Backend

    Frontend Demo with Backend

    Implemented Frontend:

    • using Victory, Material-UI
    • merged Andrew's frontend demo code for connection
    • needs testing

    Includes landing page (optional), Graph component, Form component for parameters), Dark theme

    opened by sehyunc 1
  • Dai.js Interactive notebook

    Dai.js Interactive notebook

    Heya --

    I stumbled upon your project late at night looking at the dai.js dependents and thought I'd drop by to share this jupyter-like dai.js notebook: https://observablehq.com/@jparklev/dai-js-interactive Feel free to fork it or edit it there. My sense is that it might be useful for what you're doing, but if not, no worries -- don't mind me

    opened by jparklev 1
  • Decide on stablecoin protocol to use

    Decide on stablecoin protocol to use

    What stablecoin implementation will we use? Do we need to tweak any existing ones? Need to consider what implications this bears on the economic modeling platform and agent/asset classes.

    good first issue 
    opened by akirillo 1
  • Define asset classes

    Define asset classes

    Not sure if this is absolutely necessary for a simplified economic model, since traders will transact using just stablecoin, but we will need control over some asset classes / stablecoin value derivatives to accurately model crises (e.g. simulate asset bubble for 2008 Great Recession).

    This includes defining how the assets are priced, and perhaps asset-specific trader behaviors.

    opened by akirillo 1
  • Consult with experts

    Consult with experts

    We should definitely ask some experts who have worked in / understand the fields we're pushing into, i.e. economics and cryptocurrency.

    We'll try to get a sense for which parts of the project are most feasible, and what directions to pursue for the most interesting and value-additive work.

    To start this effort off, I think we should definitely hop on a call with Tanay Kothari and Catherine Gu from Stanford, who wrote the Simulating Stablecoin Systems with Latent Market Confidence Index paper.

    Talking to Dev would also probably help, he'll probably be able to tell us what's feasible and what isn't, and generally poke holes in our project early on so we don't waste time unnecessarily.

    Any other ideas?

    good first issue 
    opened by akirillo 1
  • Read papers / online resources

    Read papers / online resources

    We need to read up on context-building resources to gain a solid grounding in popular stablecoin implementations, the economic principles at play, and the details of the crises we want to model.

    We should also see what previous work we can find in the realm of economic simulations, and ideally, stablecoin simulations.

    As we do our preliminary research, we should add all pertinent resources that we find to the resources doc.

    Let's aim to get this done by the end of Spring break. Of course, we'll be doing more reading and research as we go through the project, but we need to establish a footing now.

    good first issue 
    opened by akirillo 1
  • Price usage fixes

    Price usage fixes

    Oopsies, was using spot as the actual ilk price in a couple places - made the appropriate changes. Also, swapped out c_ratios param in keepers for spot_padding. Same idea, they have some risk tolerance dictating how collateralized the vaults they open are, but now spot_padding is multiplied by spot (the maximum drawable debt per unit of ilk) to determine how much debt to draw when opening a new vault.

    opened by akirillo 0
Owner
Blockchain at Berkeley
Berkeley's hub for blockchain innovation
Blockchain at Berkeley
Simulating Sycamore quantum circuits classically using tensor network algorithm.

Simulating the Sycamore quantum supremacy circuit This repo contains data we have obtained in simulating the Sycamore quantum supremacy circuits with

Feng Pan 46 Nov 17, 2022
Code accompanying "Learning What To Do by Simulating the Past", ICLR 2021.

Learning What To Do by Simulating the Past This repository contains code that implements the Deep Reward Learning by Simulating the Past (Deep RSLP) a

Center for Human-Compatible AI 24 Aug 7, 2021
A python package simulating the quasi-2D pseudospin-1/2 Gross-Pitaevskii equation with NVIDIA GPU acceleration.

A python package simulating the quasi-2D pseudospin-1/2 Gross-Pitaevskii equation with NVIDIA GPU acceleration. Introduction spinor-gpe is high-level,

null 2 Sep 20, 2022
Simulating an AI playing 2048 using the Expectimax algorithm

2048-expectimax Simulating an AI playing 2048 using the Expectimax algorithm The base game engine uses code from here. The AI player is modeled as a m

Subha Ramesh 2 Jan 31, 2022
PaddleRobotics is an open-source algorithm library for robots based on Paddle, including open-source parts such as human-robot interaction, complex motion control, environment perception, SLAM positioning, and navigation.

简体中文 | English PaddleRobotics paddleRobotics是基于paddle的机器人开源算法库集,包括人机交互、复杂运动控制、环境感知、slam定位导航等开源算法部分。 人机交互 主动多模交互技术TFVT-HRI 主动多模交互技术是通过视觉、语音、触摸传感器等输入机器人

null 185 Dec 26, 2022
Project Aquarium is a SUSE-sponsored open source project aiming at becoming an easy to use, rock solid storage appliance based on Ceph.

Project Aquarium Project Aquarium is a SUSE-sponsored open source project aiming at becoming an easy to use, rock solid storage appliance based on Cep

Aquarist Labs 73 Jul 21, 2022
Trading Gym is an open source project for the development of reinforcement learning algorithms in the context of trading.

Trading Gym Trading Gym is an open-source project for the development of reinforcement learning algorithms in the context of trading. It is currently

Dimitry Foures 535 Nov 15, 2022
Project to create an open-source 6 DoF input device

6DInputs A Project to create open-source 3D printed 6 DoF input devices Note the plural ('6DInputs' and 'devices') in the headings. We would like seve

RepRap Ltd 47 Jul 28, 2022
StyleTransfer - Open source style transfer project, based on VGG19

StyleTransfer - Open source style transfer project, based on VGG19

Patrick martins de lima 9 Dec 13, 2021
OpenLT: An open-source project for long-tail classification

OpenLT: An open-source project for long-tail classification Supported Methods for Long-tailed Recognition: Cross-Entropy Loss Focal Loss (ICCV'17) Cla

Ming Li 37 Sep 15, 2022
Complete system for facial identity system. Include one-shot model, database operation, features visualization, monitoring

Complete system for facial identity system. Include one-shot model, database operation, features visualization, monitoring

null 2 Dec 28, 2021
Complete system for facial identity system

Complete system for facial identity system. Include one-shot model, database operation, features visualization, monitoring

null 4 May 2, 2022
Face-Recognition-based-Attendance-System - An implementation of Attendance System in python.

Face-Recognition-based-Attendance-System A real time implementation of Attendance System in python. Pre-requisites To understand the implentation of F

Muhammad Zain Ul Haque 1 Dec 31, 2021
Face-Recognition-Attendence-System - This face recognition Attendence system using Python

Face-Recognition-Attendence-System I have developed this face recognition Attend

Riya Gupta 4 May 10, 2022
Simple-System-Convert--C--F - Simple System Convert With Python

Simple-System-Convert--C--F REQUIREMENTS Python version : 3 HOW TO USE Run the c

Jonathan Santos 2 Feb 16, 2022
Real-Time-Student-Attendence-System - Real Time Student Attendence System

Real-Time-Student-Attendence-System The Student Attendance Management System Pro

Rounak Das 1 Feb 15, 2022
E2e music remastering system - End-to-end Music Remastering System Using Self-supervised and Adversarial Training

End-to-end Music Remastering System This repository includes source code and pre

Junghyun (Tony) Koo 37 Dec 15, 2022
Designing a Minimal Retrieve-and-Read System for Open-Domain Question Answering (NAACL 2021)

Designing a Minimal Retrieve-and-Read System for Open-Domain Question Answering Abstract In open-domain question answering (QA), retrieve-and-read mec

Clova AI Research 34 Apr 13, 2022