How gitbitex/gitbitex-new works
Main Components
a) Core Components:
• Matching Engine (Central component)
• Market Data System
• Order Management System
• Feed/WebSocket System
• OpenAPI/REST Interface
• Persistence Layer (MongoDB, Redis, Kafka)
b) Supporting Components:
• Authentication System
• Wallet Integration Points
• Monitoring System (Prometheus metrics)
Detailed Component Breakdown
A. Matching Engine Layer:
• In-memory matching engine as the core component
• Command processing system (CommandSerializer, CommandDeserializer)
• Snapshot management system
• Order book management
• Account book integration
B. Market Data Layer:
• Order book snapshots
• Candle/Ticker generation
• Trade persistence
• Account persistence
C. Communication Layer:
• WebSocket feed system
• REST API endpoints
• Authentication interceptors
D. Storage Layer:
• MongoDB for persistent storage
• Redis for caching
• Kafka for event streaming
Data Flow Representation
• Order flow: API → Matching Engine → Market Data
• WebSocket feed distribution
• Snapshot creation and storage
• Market data updates
• Command replay mechanism
[Client Layer]
• ↓ ↑
[API Layer (REST + WebSocket)]
• ↓ ↑
[Command Processing Layer]
• ↓ ↑
[Matching Engine Core]
• ↓ ↑
[Market Data Processing]
• ↓ ↑
[Persistence Layer]
Implementation Details
• Queue representations for high-throughput areas
• Redundancy/failover capabilities
• Snapshot points and recovery mechanisms
Critical Notes
• In-memory nature of the matching engine
• Standby deployment capability
• Command replay mechanisms
• Monitoring points for performance metrics
• Wallet integration points