{"id":21221798,"url":"https://github.com/primitivefinance/rmm01-simulations","last_synced_at":"2026-02-19T12:01:55.633Z","repository":{"id":37519471,"uuid":"440988594","full_name":"primitivefinance/RMM01-Simulations","owner":"primitivefinance","description":"RMM-01 Simulations","archived":false,"fork":false,"pushed_at":"2023-03-29T13:30:29.000Z","size":2367,"stargazers_count":50,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-16T08:11:37.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primitivefinance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-22T21:28:25.000Z","updated_at":"2024-11-23T13:17:05.000Z","dependencies_parsed_at":"2024-11-20T22:46:05.287Z","dependency_job_id":"633d138c-3766-4c1e-9ca2-6d94ddd11c88","html_url":"https://github.com/primitivefinance/RMM01-Simulations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/primitivefinance/RMM01-Simulations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2FRMM01-Simulations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2FRMM01-Simulations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2FRMM01-Simulations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2FRMM01-Simulations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primitivefinance","download_url":"https://codeload.github.com/primitivefinance/RMM01-Simulations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2FRMM01-Simulations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29612509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T22:33:47.943Z","updated_at":"2026-02-19T12:01:55.608Z","avatar_url":"https://github.com/primitivefinance.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RMM01-Simulations\nThis 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.\n\n## Directory\n\n### rmms-py\n**Package finalized**\n\nThis 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.](https://stanford.edu/~guillean/papers/rmms.pdf) For now it only focuses on the Covered Call replication. The project is organized as follows:\n\n``modules`` contains all the simulation toolkit. In particular:\n\n- ``modules/arb.py`` implements the optimal arbitrage logic.\n- ``modules/cfmm.py`` implements the actual CFMM pool logic.\n- ``modules/utils.py`` contains a number of utility functions (math, geometric brownian motion generation).\n- ``modules/simulate.py`` is simply the function used to run an individual simulation.\n- ``modules/optimize_fee.py`` contains the logic required to find the optimal fee given some market and pool parameters.\n\n``simulation.py`` is a script used to run individual simulations whose parameters are specified in the ``config.ini`` file.\n\n``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).\n\n``optimal_fees_visualization.py`` is a script that generates a visual representation of the output of a fee optimization routine.\n\n``error_distribution.py`` is a script to plot the distribution of errors given some market and pool parameters for different fee regimes.\n\nAll the different functions and design choices are documented in a separate document.\n\n---\n### CFMM-py\n🚧 **Package still under construction** 🚧\n\nPackage 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.\n\nConsists of four main ``module`` files:\n\n- ``CFMM.py`` contains logic for CFMM pools. Currently includes RMM-01 and Uniswap V2 logic\n- ``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 \n- ``main.py`` contains simpy environment/simulation path logic\n- ``test.py`` contains testing logic for each module and resulting set of functions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivefinance%2Frmm01-simulations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimitivefinance%2Frmm01-simulations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivefinance%2Frmm01-simulations/lists"}