← Back to home

Monte Carlo GHO

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

Screenshots

Monte Carlo GHO screenshot 1
Monte Carlo GHO screenshot 2
Monte Carlo GHO screenshot 3

Problem Statement

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.

Solution

The project is made in Python3 using Jupyter Notebooks. It uses numpy and matplotlib for necessary functionalities.There are three major pieces: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.User simulation: User's wallets, instincts, etc. are simulated with borrow rates and current value of GHO as inputsNew GHO value: After each epoch, the updated value of GHO is calculated.

Hackathon

LFGHO

2024

Contributors