A comprehensive cryptocurrency trading platform with a high-performance matching engine and web client.
The project is organized into two main components:
- engine/ - A high-performance trading engine for order matching
- web-client/ - A Next.js web application for the trading interface
- Processes order creation and cancellation
- Implements price-time priority matching algorithm
- Generates executed trades
- Maintains an order book
cd engine
npm install
npm run build
npm startThe engine reads orders from src/input/orders.json and outputs to:
outputs/orderbook.json- The current state of the order bookoutputs/trades.json- All executed trades
{
"type_op": "CREATE",
"account_id": "1",
"amount": "0.00230",
"order_id": "1",
"pair": "BTC/USDC",
"limit_price": "63500.00",
"side": "SELL"
}The type_op field can be either CREATE to place a new order or DELETE to cancel an existing order.
cd engine
npm testThe web client is built with Next.js.
cd web-client
npm install
npm run devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
The easiest way to deploy the Next.js app is to use the Vercel Platform from the creators of Next.js.
- Node.js (v20 or later recommended)
- TypeScript