Project that consists on simulating a double auction market using React (client side) and Python (server side).
The App consists of a Configuration Panel and a Dashboard consisting of currently 6 screens.
- Orders Placed : Limit orders placed by every trader bot.
- Trader Statistics : A brief statistics about the status of the trader.
- Price Serie : A Time Serie chart of the price.
- Logs : Logs of the market such as transactions and orders placed.
- Bids & Asks : Twoway chart of the Bids and Asks.
- 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.
Websockets implementation for python using asyncio. These consists of a Market object that represents the market functionality. The market can do these operations:
- Add orders to a queue.
- Update the time.
- Match trading orders.
- Sends back to the client the transactions and limit orders made.
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.
-
Open two terminals. In the first one will be running the client side and in the second will run the server side.
-
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.
- Open the 2nd terminal and run the following command:
python server\server.py
- 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.