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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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