Quickstart
This guide will help you set up Exchange locally and execute your first order.Make sure you have Docker and Docker Compose installed on your system before proceeding.
Prerequisites
Before you begin, ensure you have the following installed:- Rust (latest stable version)
- Docker and Docker Compose
- Git
Installation
Configure environment variables
Copy the example environment file and configure your database credentials:The default
.env configuration looks like this:You can customize these values based on your local setup, but the defaults should work for most users.
Start infrastructure services
Use Docker Compose to start Redis and Postgres:This will start:
- Redis on port 6379 (for pub/sub messaging)
- Postgres on port 5000 (for persistent storage)
Build the project
Build all the Exchange components:This compiles the four main components:
- Router (REST API server)
- Engine (order matching engine)
- WebSocket stream (real-time data)
- Database processor (async DB writes)
Create your first order
Now that Exchange is running, let’s create a user and place an order.Create a user
First, create a test user:Place a limit order
Create a buy order for SOL/USDC:order_id.
Check your order status
Retrieve your order using theorder_id from the previous response:
Get open orders
View all open orders for your user:Cancel an order
Cancel a specific order:Explore market data
Exchange provides several endpoints to query market data:Get order book depth
Get recent trades
Get ticker data
Get kline (candlestick) data
Connect to WebSocket
For real-time updates, connect to the WebSocket server:Next steps
Architecture
Learn how Exchange components work together
API reference
Explore all available API endpoints