Services
Services
Section titled “Services”TradeX consists of multiple microservices, each responsible for a specific domain.
Market Data Service
Section titled “Market Data Service”Language: Go
Purpose: Market data ingestion and distribution
- Consumes trade & order-book data from Kafka
- Maintains per-symbol order books (L2)
- Publishes WebSocket feeds (trades, book, ticker, kline)
- Provides REST API for snapshots and history
- Exposes gRPC for internal services
Documentation: Market Data API
Order Service
Section titled “Order Service”Language: NestJS (TypeScript)
Purpose: Order management and execution
- Handles order intake and validation
- Manages wallet and risk bookkeeping
- Integrates with Kafka and Drizzle pipelines
- Processes order lifecycle events
Documentation: Order API
Auth Service
Section titled “Auth Service”Language: FastAPI (Python)
Purpose: Authentication and authorization
- Manages user authentication
- Handles token lifecycle (JWT)
- PostgreSQL persistence
- API key management
Documentation: Auth API
User Service
Section titled “User Service”Language: FastAPI (Python)
Purpose: User profile management
- User profile and preferences
- KYC (Know Your Customer) management
- Kafka consumers for user events
- MongoDB and PostgreSQL storage
Documentation: User API
Wallet Service
Section titled “Wallet Service”Language: FastAPI (Python)
Purpose: Wallet operations
- Balance management
- Deposit and withdrawal processing
- Transaction history
- Hold and release operations
Documentation: Wallet API
Metadata Service
Section titled “Metadata Service”Language: Go
Purpose: Trading symbols and configuration
- Symbol and instrument management
- Index price configuration
- Market configuration
- Trading rules and parameters
Documentation: Metadata API
Matching Engine
Section titled “Matching Engine”Language: Rust Purpose: Order matching and execution
- High-performance order matching
- Order book management
- Trade execution
- Redis, MongoDB, and Prometheus integration
Market Maker Service
Section titled “Market Maker Service”Language: Go Purpose: Automated market making and liquidity provision
- Actor model architecture (one worker per symbol)
- Inventory-adjusted spread pricing algorithm
- Real-time order placement and management via Order Service
- Risk management with automatic kill switch
- Position and P&L tracking
- Shadow mode for testing strategies
Key Features:
- Quoting Engine: Computes bid/ask prices with inventory adjustment
- Risk Guards: Pre-trade checks for position and loss limits
- Kill Switch: Automatic shutdown on risk violations (exposure, loss, lag, reject storm)
- Multi-level Quoting: Configurable depth with progressive spreads
- Shadow Mode: Test strategies without placing real orders
Integration Points:
- Kafka: Consumes market data and engine events
- Order Service: Places/cancels orders via HTTP API
- Metadata Service: Fetches instrument definitions via gRPC
- PostgreSQL: Stores configurations, positions, and orders
Documentation: Market Maker Service | Market Maker API