The OrderMatchingSystem is a simple FIFO algorithm application, which simulates how modern banking systems handle stock orders.
I use NextJS and NodeJS for frontend and backend respectively. They comunicate each other via traditional REST APIs and WebSocket.
For simplicity, I only define orders with two types: BUY
and SELL
and don't consider limit order, options and futures trading.
The matching logic is based on First In First Out aka FIFO algorithm.
In order to create as many valid trade as possible, the BUY and SELL orders are sorted in a time-price manner. That is, the earlier
an order is, the higher
its priority in a queue.
Make sure you have Node installed on your machine and git clone this repo, run npm install
and npm start
afterwards.
Once done, open this link http:localhost/ticker/APPL
to see the website.
- Find a dynamic open data for real-time stock market.
- Split API endpoints and Orderbook into microservices.
- Containerize both frontend and backend.
- Deploy this on a server like GCP or a third-party host like Netlify.
- Introduce CI/CD pipeline.
- Introduce testing tools such as Selenium.
- TBD.