Skip to main content

A tool for building shareable Multi-Agent tokenomic models

Project description

Tokesim

CI

Tokesim

A Tokeneconomics Simulator.
View Demo · ·

Table of Contents

About The Project

Tokesim is an Agent Based Modeling tool that makes it easy to test token economic models. It's built using mesa-behaviors an extension to Mesa ABM framework bring more type hints and patterns to make models,agents,utility functions and strategies shareable and more extensible. The goal of Tokesim is to help developers run simulations against Smart Contracts, in a block chain agnostic way, using shreable and reusable modules and libraries to do so.

Tokesim Features:

  • Typehints to make agents and models extensible
  • Ability to run against and simulation against your smart contracts
  • An architecture to make the simulations portable to multiple chains
  • ChartJS integration from Mesa framework
  • Support for testing Ethereum based smart contracts directly

Getting Started

Prerequisites

  • node v10.15.3 or later
  • npm v6.4.1 or later
  • python 3.7 or later but not 3.8 ;)

Installation

Clone/ download the project, and install dependencies. For development

git clone https://github.com/tokesim/tokesim.git && cd tokesim 
python3.7 -m venv venv
source venv/bin/activate
pip install poetry
poetry build
npm install -g @tokesim/tokesim-chain
# in a new terminal window
tokesim-chain --port 5554

or

pip install tokesim
npm install -g @tokesim/tokesim-chain
# in a new terminal window
tokesim-chain --port 3004

Usage

Run simulation

In order to run a simulation against a chain the default init will create a simulation for you to modify as you see fit. You'll need to start the chain simulation service.

# remember to activate your venv
source venv/bin/activate
pip install tokesim

# just like create react app generate template
tokesim init --dir simple-token --agents 20

#start chain simulator
tokesim-chain -c ethereum --port 3004

#run the simulation defaults to terminating after 100 steps
tokesim run --config ./simple-token/simulation.json --port 3004

Simulation App Layout

By default tokesim init will generate a default application layout, that specifies the accounts used a balance for each of the agents as well as configuration file and some simple bonded token curve agents. The contracts specified are a listed here

# ./simple-token/
.
└── simple-token    
    └── contracts 
    |    |── SimpleToken.bin
    |    └── SimpleToken_abi.json
    |── accounts.json    
    |── config_schema.json       
    |── simple_token_agent.py
    |── simple_token_model.py
    |── simple_token_config.py
    └── simulation.json

Configurations

Explanation coming soon

Roadmap

Coming soon

Contributing

How to contribute, build and release are outlined in CONTRIBUTING.md, BUILDING.md and RELEASING.md respectively. Commits in this repository follow the CONVENTIONAL_COMMITS.md specification.

License

Apache License 2.0

Resources

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

tokesim-0.1.0.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

tokesim-0.1.0-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file tokesim-0.1.0.tar.gz.

File metadata

  • Download URL: tokesim-0.1.0.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for tokesim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 51b1ef40db22bf4029ad50e19ebc6584e8a7196fecf323b0095f02dfdf637805
MD5 5bc5599c75958e5a2e27b4ddc42cd9a3
BLAKE2b-256 bbbd2226b1c927a21a64f8a3d6a4620b8471aeb8a1efc08815d3312c9624c43b

See more details on using hashes here.

File details

Details for the file tokesim-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tokesim-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for tokesim-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac4583dd80e1993fe41fb86c43af2861952d2d169c1f1a86a22fa11e57af741c
MD5 30b9e59556e3154a888629511875514a
BLAKE2b-256 609183366876f12899b039519807f68df3f25d22f541bb24e345aa5a0922d95b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page