Giter VIP home page Giter VIP logo

dreadful-dev / brownian_motion_generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattytokenomics/brownian_motion_generator

0.0 0.0 0.0 1.14 MB

Library of functions to generate Brownian motion simulations for multiple series that exhibit mean reversion, correlation, and/or custom distributions that do not follow typical normal distributions.

License: GNU General Public License v3.0

Python 100.00%

brownian_motion_generator's Introduction

Intro

Library to generate Brownian motion random walks for multiple series that exhibit mean reversion, correlation, skew, kurtosis, and/or custom distributions that do not follow typical normal distributions.

This can be used for testing trading strategies, risk analysis, tokenomics design stress testing, Monte Carlo simulations, and inputs into existing testing, modeling, and simulation frameworks such as cadCAD and radCAD - see the Examples folder for details.

Installation and Usage

pip install brownian_motion_generator

from brownian_motion_generator import brownian_motion_generator as bmg

Common Use Cases

  • Stress testing collateral based systems. Generating random walks of asset prices can help to identify potential exploits or risks of undercollateralization.
  • Optimizing rates of emission/inflation. Generating random walks of TVL/users/revenue growth can help to identify how emissions may need to be tweaked.
  • Identifying critical thresholds. Generating random walks of user activity, TVL, and/or protocol revenues can help identify any crucial levels to hit (or avoid) where sustainable growth kicks in (or death spiral feedback loops begin).
  • Understanding risks and levels of exposure to general market conditions or the performance of a given asset outside your control. Generating random walks of S&P 500 or BTC prices can help identify the degree and critical levels in macro risks.
  • Model positive feedback loops and/or death spirals in user behavior. For example generating random walks of NFT marketplace trading activity helps protocols identify and minimize the risks of wash trading.
  • Assumption testing. Generating random walks of critical model inputs can stress test any general system design to identify which assumptions must hold true for the system to be sustainable, and/or identity any assumptions which are unlikely to hold true in practice based on realistic random walks.

How to Use

See the Examples folder for tutorials in Jupyter notebook and equivalent html file format. Tutorials cover quick examples of generating multiple simulations of multiple correlated series with mean reverting, correlated, and/or non-normal distributions of returns, and how to integrate the generated random walks into existing simulation frameworks such as radCAD.

Feedback, Questions, Improvements?

Please open an issue on GitHub or get in touch

Credits

Original credit to these two resources which were the building blocks:

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.