GithubHelp home page GithubHelp logo

shrutiappiah / simulating-an-economy-abm Goto Github PK

View Code? Open in Web Editor NEW
92.0 11.0 19.0 169 KB

Simulation of reward tokens in a DAO ⚡️Employs multi-agent simulations and discrete-time Markov random fields.

License: MIT License

Python 97.62% Dockerfile 2.38%

simulating-an-economy-abm's Introduction

Simulating an Organizational Economy

Research

This is a multi-agent simulator for token mechanisms in decentralized organizations. Use this to simulate your own token-based societies!

Built out of a project for scientifically evaluating an organizational incentive schemes, this simulation demonstrates the behaviour of a decentralized autonmous economy over time. The system is akin to those occuring in statistical mechanics and is modelled as a discrete-time Markov chain.

Read my paper on Decentralized Organizations as Multi-Agent Systems (Mar 2017)

Cryptosystems Simulation Workshop

Ahoj Ethereum developers!

Python

Make sure you have Python 3. You can download the latest version here - https://www.python.org/

Dependencies

Install all dependencies either manually or by using

$ pip3 install -r requirements.txt

Clone

Clone this repository.

$ git clone https://github.com/ShrutiAppiah/Simulating-an-Economy-ABM

On Terminal or Command Prompt, cd into the main directory for this repository.

If you want to follow the workshop, see Token Engineering. If you want to skip ahead and run the code, go to Run/

Token Engineering

In the token engineering design process, you will define your token economy as an optimization problem, mathematically model it, and then validate it using this multi-agent simulation.

🚀 Objective 🚀


A simple token economy aims to either maximize or minimize one parameter or function. The objective function is also known as the fitness function or utility function.

Define the goal of your token economy. Think long-term.

In this example, I want my token to incentivize human agents to contribute in projects. So, I could define my objective function as:

Maximize f(x) = Total number of human agents participating in a project in each iteration

🌐 Domain 🌐


In this example, the domain is a single organization/company with a fixed number of agents.

Domain: A single DAO with 10x10 participants

👫 System agents/players 👫


The agents of the system constitute of all the parties that can transact with one another.

In this example, the agents of this economy are members of the DAO.

Agents: Members of the DAO

The agents certainly have some properties associated with them. At this point, you may have uncovered some of them.

In this example, the agents have the following known properties -

Properties:
Altruistic
Fair
Truthful
Rational

🕑 System clock 🕑


The clock is defined as the smallest period in which the objective function/parameter changes. The period should be repeatable.

In this example, the period is the granular unit in which a full project cycle can be completed i.e. the project can be posted, agents can opt in to it, complete it, and get rewarded.

👌 Assumptions 👌


There are always some unknowns in any system. Although not measured or verified, we may have a rough idea of what these unknowns could be. These will be defined as assumptions.

In this example, we make the following assumptions -

Quality of all the projects completed are similar
Agents aren't able to evaluate difficulty of projects
All token transactions are tracked

⚓ Constraints ⚓


Constraints bound the system. An optimally constrained system is easy to find solutions for.

System constraints

  • Bounded rationality of agents

Technical constraints

  • Scalability
  • Gas price

➡️ Input parameters ➡️


Can be obtained from prior statistical studies

  • User or design research
  • Behavioural economics
  • Surveys

In this example, one of the input parameters are the altruism coefficients.

🔰 Starting mechanism 🔰


In most cases, you may be able to define some of these in your starting mechanism -

  • Incentives/tokens
  • Token supply
  • Is there a cap?
  • Value -- Is the value pegged to fiat or a stablecoin?
  • Mobility
  • Tradability -- What can the token be exchanged for?
  • Any identified equilibria

This example started with the mechanism of a simple Boltzmann Wealth Model.

Run

Navigate into the cloned repo folder

$ cd Simulating-an-Economy-ABM

And run

$ python3 VisualizeEconomy.py

Docker

docker build -t simulating-an-economy-abm .
docker run -it -p 8521:8521 -v `pwd`:/usr/local/models simulating-an-economy-abm

View

The server should host it on http://127.0.0.1:8521/

🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁

Support

Join TokenWork on Telegram Read my paper on Decentralized Organizations as Multi-Agent Systems (Mar 2017)
Star this repo if you found this model useful. Reach out to me if you'd like to collaborate.

License

License: MIT

Copyright (c) 2017 Shruti Appiah

simulating-an-economy-abm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simulating-an-economy-abm's Issues

VisualiseEconomy.py might not be instantiating Modular Server right

Had a bit of trouble getting the script to work, but I changed the instantiation to the below and that got it working for me:

server = ModularServer(
    WealthModel,
    [grid, chart],
    name="Wealth Model",
    model_params={
        "N": economy_scale*economy_scale,
        "width": economy_scale,
        "height": economy_scale
    })

I got the idea to do that from a quick read through the library you used. Perhaps it's been recently updated. I can make a PR if wanted?

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.