Skip to content

Sergio2405/DoubleAuction-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Double-Auction Simulator (Development version)

Project that consists on simulating a double auction market using React (client side) and Python (server side).

Client

The App consists of a Configuration Panel and a Dashboard consisting of currently 6 screens.

  1. Orders Placed : Limit orders placed by every trader bot.
  2. Trader Statistics : A brief statistics about the status of the trader.
  3. Price Serie : A Time Serie chart of the price.
  4. Logs : Logs of the market such as transactions and orders placed.
  5. Bids & Asks : Twoway chart of the Bids and Asks.
  6. Market Statistics : Important statistics about the market such as the volume, price and bids & asks.

This screens will update in real time as the traders place their orders and transactions are made.

Server

Websockets implementation for python using asyncio. These consists of a Market object that represents the market functionality. The market can do these operations:

  1. Add orders to a queue.
  2. Update the time.
  3. Match trading orders.
  4. Sends back to the client the transactions and limit orders made.

Deploy App

To launch the app you need to have installed node in order to run the React app (client side). For the server side just need python.

  1. Open two terminals. In the first one will be running the client side and in the second will run the server side.

  2. Open the 1st terminal and cd to src folder and then run the following command:

npm start

The client side app runs the in the development mode.
Open http://localhost:3000 to view it in your browser.

  1. Open the 2nd terminal and run the following command:
python server\server.py
  1. If you want to change the PORT and HOST where the app runs and websocket listens:
    • Change the parameters PORT and HOST in the Market component in the client side (client\src\index.js)
    <Market 
        HOST = "localhost"
        PORT = "8001"
        DURATION = {setup["duration"]}
        MAX_PRICE = {setup["max_price"]}
        MAX_QUANTITY = {setup["max_quantity"]}
        TRADERS = {setup["n_traders"]}
        HOLDINGS = {setup["holdings"]}
        COLORS = {["yellow", "green","gray", "brown", "orange"]}
      />
    • Change the parameters PORT and HOST in the server side (server\server.py)
    HOST = "localhost" 
    PORT = 8001
    • Remember that these parameters need to be the same in both server and client side.