Skip to content

Python toolbox for simulation of matching markets in economics

Notifications You must be signed in to change notification settings

ajamjoom/MatchingMarkets.py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

We simulated TTC with the help of a Matching Markets simulator that can be found contained in this repository and created an order book settlement simulation from scratch so that we can compare thet wo mechanisms.

*Note that orders are represented as we have defined them mathematically - as a Python4-tuple in the same order as mentioned in this paper (c1,q1,c2,q2). They are generated by the typeGen function in sandbox.py.

While we did not write any code for visualizations, all of the code pertaining to the actual algorithms was written by us, and can be found in sandbox.py. In addition to writing the algorithms that conduct the actual exchanges in TTC and the conventional workbook settlement mechanism, we wrote code to combine both mechanisms and run and exchange on them. Lastly we created methods to run each of the three mechanism separately (TTC, Orderbook Settlement, Combo) and a method that runs all the mechanisms on the same bucket of agents and compares their performance.

Running our code will output analytics about the exchange (percent of completed orders, number of transactions...etc). You can run our code with the following line:

python3 sandbox.py

Replace with one of the following {ttc, settle, combo, race} and replace <num_of_agents> with an integer that represents the number of agents you want to participate in the exchange. Each agent places a single order.

About

Python toolbox for simulation of matching markets in economics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%