Introduction
High-performance stock exchange with matching engine, orderbooks, and market maker
Overview
Stock Exchange is a high-performance trading platform built in Go that implements a complete stock exchange system with a working matching engine, real-time orderbooks, and an automated market maker.
This project demonstrates core financial trading concepts including order matching, price-time priority, and market making algorithms.
Key Features
Matching Engine
Fast order matching with price-time priority algorithm
Orderbook
Real-time bid/ask orderbook with depth visualization
Market Maker
Automated liquidity provider with spread management
REST API
Complete HTTP API for trading operations
Architecture
The system is built with three core components:
Matching Engine
The heart of the exchange that matches buy and sell orders using price-time priority. It processes limit orders, market orders, and maintains the order queue.
Orderbook
Manages the collection of outstanding orders for each trading instrument. Provides real-time bid/ask prices and order depth.
Market Maker
An automated agent that continuously provides liquidity by placing buy and sell orders around the current market price.
Technology Stack
- Language: Go (Golang)
- Web Framework: Echo
- Blockchain: Ganache (Ethereum local blockchain)
- Containerization: Docker & Docker Compose