GithubHelp home page GithubHelp logo

rmm01-simulations's Introduction

RMM01-Simulations

This repository serves as the central repository for all simulations of products/mechanism built using RMM-01. Its contents, as currently stands, includes simulation packages intended to analyze the replication accuracy of RMM-01 under various market conditions and market assumptions, as well as the generation of an optimal swap fee.

Directory

rmms-py

Package finalized

This project is intended to investigate the replication of payoffs using custom Constant Function Market Makers (CFMMs) in the spirit of the 2021 paper from Angeris, Evans and Chitra. For now it only focuses on the Covered Call replication. The project is organized as follows:

modules contains all the simulation toolkit. In particular:

  • modules/arb.py implements the optimal arbitrage logic.
  • modules/cfmm.py implements the actual CFMM pool logic.
  • modules/utils.py contains a number of utility functions (math, geometric brownian motion generation).
  • modules/simulate.py is simply the function used to run an individual simulation.
  • modules/optimize_fee.py contains the logic required to find the optimal fee given some market and pool parameters.

simulation.py is a script used to run individual simulations whose parameters are specified in the config.ini file.

optimal_fees_parallel.py is a script to run an actual fee optimization routine for a prescribed parameter space (to be specified within the script itself).

optimal_fees_visualization.py is a script that generates a visual representation of the output of a fee optimization routine.

error_distribution.py is a script to plot the distribution of errors given some market and pool parameters for different fee regimes.

All the different functions and design choices are documented in a separate document.


CFMM-py

๐Ÿšง Package still under construction ๐Ÿšง

Package for simulating RMM-01 performance with respect to various market conditions and arbitrage rules using the simpy discrete event simulator package. Based off the rmms-py package, with now arbitrary share count and arbitrage occuring with respect to a finite liquidity market, currently Uniswap V2. Price generation now no longer just geometric brownian motion with intentions to make actor-based price generation on the reference market.

Consists of four main module files:

  • CFMM.py contains logic for CFMM pools. Currently includes RMM-01 and Uniswap V2 logic
  • arb.py contains optimal arbitrage logic given minimum arb profit for execution. Arbitrage occurs between RMM-01 and a reference AMM market with finite liquidity, currently Uniswap V2
  • main.py contains simpy environment/simulation path logic
  • test.py contains testing logic for each module and resulting set of functions

rmm01-simulations's People

Contributors

experiencedft avatar fiberedskies avatar 0xjepsen avatar kinrezc avatar sbneo2022 avatar alexangelj avatar chadury2021 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.