project screenshot 1
project screenshot 2
project screenshot 3

Monte Carlo GHO

Using PIDs to adjust borrow rates to maintain peg of GHO. User simulation done using Monte Carlo method

Monte Carlo GHO

Created At

LFGHO

Project Description

Inspired by Emilio's talk on GHO and Decentralized Stablecoins, this project attempts to show how PIDs can be used to control the borrow rates of a token to try to keep the value of the token pegged to a pre-defined value.

Users and their behaviors are simulated using Monte Carlo method. For example, their wallet is given 0 to 1000 USD in a uniform random distribution. External events (both positive and negative) happen at each epoch with their intensity being sampled according to a normal distribution. Users' instinct (whether the current value is high or low) is also sampled according to a normal distribution.

How it's Made

The project is made in Python3 using Jupyter Notebooks. It uses numpy and matplotlib for necessary functionalities.

There are three major pieces:

  1. PID: This is what the governance sets. PID outputs what the borrow rate should be to bring the value of GHO to the desired peg value.
  2. User simulation: User's wallets, instincts, etc. are simulated with borrow rates and current value of GHO as inputs
  3. New GHO value: After each epoch, the updated value of GHO is calculated.
background image mobile

Join the mailing list

Get the latest news and updates