How yunuskusak/kusak-infra works
KUSAK is a Binance trading-engine prototype with live market-data ingestion and a separate research workflow for recording, replay, backtesting, and parameter exploration. The README describes the intended WebSocket-to-strategy-to-order path; sampled source confirms startup configuration, WebSocket reconnect handling, and research backtesting. The README’s older infrastructure description does not document the newer research and risk modules, so those capabilities are represented from the source index and CLI excerpt, with uncertain wiring omitted.
Main entry points: research_main.cpp Research CLI · main.cpp Strategy Thread · binance_http_client.hpp HTTP Client · backtester.hpp Backtester
Components 31
Live Trading
- Live Engine
src/main.cpp - Configuration
include/config.hpp - Market Events
include/core_types.hpp - Strategy Thread
src/main.cpp - Order Channel
src/main.cpp - Order Thread
src/main.cpp
Exchange Connectivity
- WebSocket Client
include/ws_client.hpp - HTTP Client
include/binance_http_client.hpp - REST Orders
include/binance_rest_client.hpp - Exchange Filters
include/exchange_info_manager.hpp
Research Workflow
- Tick Records
include/research_types.hpp - Market Recorder
include/market_data_recorder.hpp - Replay Engine
include/replay_engine.hpp - Backtester
include/backtester.hpp - Parameter Optimization
include/parameter_optimizer.hpp - Walk-Forward Optimization
include/walk_forward_optimizer.hpp - Genetic Optimization
include/genetic_optimizer.hpp - Paper Trading
include/paper_trader.hpp - Signal Analyzer
python/signal_analyzer.py - Research CLI
src/research_main.cpp
Market Analytics
- Regime Detection
include/regime_detector.hpp - Risk Scoring
include/risk_scorer.hpp - Adverse Selection
include/adverse_selection_tracker.hpp - VPIN Tracking
include/vpin_velocity_tracker.hpp - Slippage Models
include/slippage_models.hpp
Observability
- Latency Monitor
include/latency_monitor.hpp - Telemetry Sink
include/telemetry_sink.hpp - Logger
include/logger.hpp - Notifications
include/notification.hpp
Other components
- Operator
- Binance
Connections 32
- Operator → Live Engine: configures
src/main.cpp - Live Engine → Configuration: loads config
src/main.cpp - Binance → WebSocket Client: streams market data
README.md - WebSocket Client → Market Events: parses events
README.md - Market Events → Strategy Thread: feeds events
README.md - Strategy Thread → Order Channel: queues orders
README.md - Order Channel → Order Thread: dispatches tasks
README.md - Order Thread → REST Orders: sends orders
README.md - REST Orders → HTTP Client: uses HTTP
include/binance_rest_client.hpp - HTTP Client → Binance: calls REST
README.md - HTTP Client → Exchange Filters: fetches filters
include/exchange_info_manager.hpp - Operator → Research CLI: selects mode
- Research CLI → Market Recorder: starts recording
src/research_main.cpp - Research CLI → Replay Engine: runs replay
src/research_main.cpp - Replay Engine → Tick Records: dispatches records
include/replay_engine.hpp - Research CLI → Backtester: runs backtest
src/research_main.cpp - Backtester → Tick Records: consumes ticks
include/backtester.hpp - Research CLI → Parameter Optimization: optimizes parameters
src/research_main.cpp - Parameter Optimization → Backtester: evaluates candidates
include/parameter_optimizer.hpp - Research CLI → Walk-Forward Optimization: runs validation
src/research_main.cpp - Research CLI → Genetic Optimization: runs search
src/research_main.cpp - Research CLI → Paper Trading: runs simulation
src/research_main.cpp - Research CLI → Signal Analyzer: analyzes signals
- Strategy Thread → Regime Detection: consults regime
src/main.cpp - Strategy Thread → Risk Scoring: checks risk
src/main.cpp - Strategy Thread → Adverse Selection: tracks toxicity
src/main.cpp - Strategy Thread → VPIN Tracking: tracks VPIN
src/main.cpp - Strategy Thread → Slippage Models: models slippage
src/main.cpp - Live Engine → Latency Monitor: measures latency
src/main.cpp - Live Engine → Telemetry Sink: emits telemetry
src/main.cpp - Live Engine → Logger: logs events
src/main.cpp - Research CLI → Notifications: sends summaries
src/research_main.cpp