Bancor v3 python spec, simulator, and emulator library. This is an open-source python package developed by Bancor Research. It is meant to assist in the design, testing, and validating of Bancor v3 behavior.
Project description
Bancor Simulator
Bancor Simulator is an open-source python package developed by Bancor Research. It aims to assist the design, testing, and validation of Bancor v3 tokenomics.
See official documentation for complete details.
Warning: The docs are a work in progress with potentially broken links, unfinished sections, and a non-exhaustive overview of commands and example usage. Moreover, the entirety of the codebase and documentation is subject to change without warning.
Introduction
All state transition functions and accompanying data structures described in the product specification BIP15: Proposing Bancor 3 are the core system level operations of this library.
Organization
This is the project directory structure:
bancor_research/ <------- ** General Research Project **
└───── bancor_emulator/ <------- Solidity Emulation Project
└── bancor_simulator/ <------- ** Spec & Simulation Project **
│ ├── v3/ <------- Current Version
│ └── simulation/ <------- Agent-based simulation module
│ │ └── agents.py <------- Mesa Agent-based implementations of the Bancor protocol.
│ │ └── batch_run.py <------- Script used to perform a parameter sweep.
│ │ └── model.py <------- Main Bancor Simulation module interface.
│ │ └── random_walk.py <------- Generalized behavior for random walking
│ │ └── run.py <------- Runs the simulation server with browser-based UI
│ │ └── server.py <------- Configures the browser-based interface.
│ │ └── utils.py <------- Misc utility functions
│ │
│ └── spec/ <------- State transition functions and data structures described in BIP15.
│ └── actions.py <------- Deposit, trade, & withdrawal algorithm logic.
│ └── emulation.py <------- Verifies solidity result parity.
│ └── network.py <------- Main BancorDapp application interface.
│ └── rewards.py <------- Autocompounding and standard rewards logic.
│ └── state.py <------- State variables, constants, data structures, and CRUD interfaces.
│ └── utils.py <------- Misc utility functions
│
└── main.py <------- Application
** These docs apply.
Notation
Code snippets appearing in this style
are to be interpreted as Python 3 code.
Formatting & Style
Code is formatted according to PEP8, which is the official Python style guide. In order to overcome the burden on the developers to fix formatting, we use Black which reports on format errors and automatically fixes them.
Project setup
If you don't already have one, create a virtualenv using these instructions
Install
Bancor3 Simulation is available for Python 3.6+
To install using pypi, run this command:
$ pip install bancor-research
Documentation
In addition to the codebase, this repository holds the Jupyter Book source for Bancor v3 Simulation: A hands-on demo of features described in BIP15: Proposing Bancor 3.
To make a change to the jupyter book and update:
-
Get your copy of this repository:
git clone https://github.com/bancorprotocol/research
Build and preview the jupyter-book text locally
To build locally, pip install -r requirements.txt
and then jupyter-book build .
Follow the build instructions on the Jupyter Book guide. The guide has information on how to use the Jupyter Book CLI to build this book. You can find the Jupyter Book build instructions here.
Build and preview the text locally
To build locally, pip install -r requirements.txt and then jupyter-book build .
Follow the build instructions on the Jupyter Book guide. The guide has information on how to use the Jupyter Book CLI to build this book. You can find the Jupyter Book build instructions here.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bancor_research-3.1.1.tar.gz
.
File metadata
- Download URL: bancor_research-3.1.1.tar.gz
- Upload date:
- Size: 83.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.2 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b86534792d1312bd9a8a6df859d13404cb45c1d49945ce80f4ca4ae1e1d56417 |
|
MD5 | 21277df486ca83f32151b62a95fdf2be |
|
BLAKE2b-256 | 7c8562f46efa3d0c2a83f4cb1e99d358dc944b2a81c3f3d2ca39d6f5dbc57f23 |
File details
Details for the file bancor_research-3.1.1-py3-none-any.whl
.
File metadata
- Download URL: bancor_research-3.1.1-py3-none-any.whl
- Upload date:
- Size: 100.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.2 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d47b35c8590df07f1b128cee4e6379fd16ce78d95ca1f6b164bd3c4e4b979d1d |
|
MD5 | 25947436c640b615a4f929eaf55bcf86 |
|
BLAKE2b-256 | d1f853dd8c94f463cd4ec9ab5842df5d5ca1f47ddd04af8444a18f84e40666c9 |