A high-performance gRPC-based market data simulator built in Go, designed to demonstrate distributed systems architecture and real-time data streaming capabilities for quantitative finance applications.
This project implements a realistic market data dissemination system that showcases:
- ๐ gRPC bidirectional streaming for real-time market data distribution
- ๐ Efficient order book data structures with price-time priority
- โก Protocol Buffer serialization for high-performance communication
- ๐๏ธ Microservices architecture patterns used in financial technology
Perfect for: Software engineering portfolios, quantitative developer positions, and fintech interviews.
โโโโโโโโโโโโโโโโโโโ gRPC Stream โโโโโโโโโโโโโโโโโโโ
โ Clients โโโโโโโโโโโโโโโโโโโโบโ Server โ
โ โ โ โ
โโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโโค
โ โข Subscribe โ โ โข OrderBook โ
โ โข Display โ โ โข Market โ
โ โข Reconnect โ โ Generator โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
- Project Foundation: Professional Go project structure
- Protocol Buffers: Complete gRPC service definitions
- Order Book Engine: Efficient data structures with maps and linked lists
- Configuration System: YAML-based instrument configuration
- Testing Framework: Comprehensive unit tests
- gRPC Server: Bidirectional streaming implementation with client management
- Market Data Generator: Realistic market event simulation (60% ADD, 25% MODIFY, 15% DELETE)
- Client Application: Interactive console client with real-time order book display
- Error Handling: Connection management, reconnection logic, and graceful shutdown
- Real-time Updates: Incremental order book updates with sequence numbers
- Multi-instrument Support: Subscribe/unsubscribe to multiple instruments
- Structured Logging: Comprehensive logging with different levels
- Web Dashboard: Real-time order book visualization
- Historical Replay: Market data backtesting capabilities
- Multi-Asset Support: Equities, futures, and options
- Performance Metrics: Latency monitoring and optimization
| Component | Technology |
|---|---|
| Language | Go 1.20+ |
| Communication | gRPC with Protocol Buffers |
| Configuration | YAML with validation |
| Testing | Go standard testing framework |
| Architecture | Clean architecture with dependency injection |
market-data-simulator/
โโโ cmd/ # Application entry points
โ โโโ server/ # gRPC server main
โ โโโ client/ # Client application main
โโโ internal/ # Private application code
โ โโโ orderbook/ # Order book data structures
โ โโโ config/ # Configuration management
โ โโโ simulator/ # Market data generation
โ โโโ server/ # gRPC server implementation
โ โโโ client/ # Market data client
โ โโโ logger/ # Structured logging
โโโ proto/ # Protocol Buffer definitions
โโโ configs/ # Configuration files
โโโ pkg/ # Public library code
โโโ test/ # Test files
- Go 1.20 or later
- Protocol Buffers compiler (
protoc) - gRPC Go plugins
# Clone the repository
git clone https://github.com/RonithManikonda/market-data-simulator.git
cd market-data-simulator
# Install dependencies
go mod tidy
# Generate Protocol Buffer code
./scripts/generate_proto.sh
# Run tests
go test ./test/... -v
# Start server
go run cmd/server/main.go
# Start client (in another terminal)
go run cmd/client/main.go --server=localhost:8080 --instruments=AAPL,MSFT| Metric | Target | Description |
|---|---|---|
| Latency | Sub-millisecond | Market data distribution |
| Throughput | 10,000+ updates/sec | Per instrument capacity |
| Concurrency | 1,000+ connections | Simultaneous client support |
| Memory | O(log n) operations | Efficient order book |
The system supports flexible configuration via YAML files. Example configuration:
server:
port: "8080"
event_rate: 500 # events per second per instrument
max_clients: 1000
instruments:
- id: "AAPL"
symbol: "AAPL"
order_book_depth: 10
tick_size: 0.01
min_quantity: 100
initial_price: 150.00
- id: "MSFT"
symbol: "MSFT"
order_book_depth: 10
tick_size: 0.01
min_quantity: 100
initial_price: 300.00Run the complete test suite:
# Run all tests
go test ./test/... -v
# Run tests with coverage
go test ./test/... -cover
# Run benchmarks
go test ./test/... -bench=.This is a portfolio project, but suggestions and feedback are welcome! Please open an issue to discuss proposed changes.
This project is licensed under the MIT License - see the LICENSE file for details.
This project demonstrates skills essential for:
- ๐ Quantitative Developer positions
- ๐ฆ Financial Technology engineering roles
- โก High-Frequency Trading system development
- ๐ Real-time Systems architecture
go run cmd/server/main.goThe server will:
- Load configuration from
configs/instruments.yaml - Initialize order books for all instruments
- Start generating realistic market events
- Listen for client connections on port 8080
# Basic client
go run cmd/client/main.go --server=localhost:8080
# Client with initial subscriptions
go run cmd/client/main.go --server=localhost:8080 --instruments=AAPL,MSFTsubscribe AAPL- Subscribe to AAPL market datashow AAPL- Display current order bookunsubscribe AAPL- Unsubscribe from AAPLlist- Show active subscriptionshelp- Show all available commandsquit- Exit the client
- Web-based real-time dashboard with order book visualization
- Historical market data replay capabilities
- Support for multiple asset classes (equities, futures, options)
- Performance monitoring and latency optimization
- Docker containerization and orchestration
- Horizontal scaling with load balancing
- Database persistence for historical data
- Integration with real market data feeds
A demonstration of distributed systems architecture for financial markets
Repository โข Issues โข Documentation