How yutiansut/qautlra-rs works
Project type and purpose
• This is a full-stack, modular, distributed trading and market-data processing platform implemented in Rust with a front-end component.
• Purpose: ingest market data from multiple sources (CTP, Sina, QQ), normalize it, distribute it in real time (WebSocket/REST), process/transform it into standard formats, run quantitative strategies, and provide a web UI for monitoring and trading.
File structure
• Top-level Cargo.toml defines the workspace.
• Sub-crates under root:
• qamdgateway, qamdgateway-ctp/qq/sina: market data gateways (Actor model via Actix)
• qamd-rs: market-data processing library (standard structures, converters)
• qars: quantitative engine core (backtest, factor compute, strategy execution, Python FFI)
• qifi-rs: standardized financial interfaces (account/order structs, serialization)
• ctp-md, ctp-md-qq/sina, ctp-trader, openctp-trader: bindings and wrappers around CTP/OpenCTP APIs
• qaoms/web: front-end (Vue.js) for data visualization and trading
• Common crates: ctp-common, ctp-common-tts generate Rust bindings for CTP.
• Configuration files: config.json, config_ctp.json, etc.
• Examples and tests in each crate illustrate usage and integration points.
README for additional insights
• Architecture uses an Actor model for distribution and concurrency.
• Main flows: market data ingestion → normalization → distribution → subscription via WebSocket/REST → consumption by strategies or front-end.
• Emphasizes modular components that can run independently or together.
Final advice
• Rust crate as a component.
• Feature flags or build-time config for gateway selection.
• Detail both real-time streaming path (WebSocket) and control path (REST).
• Layer 1: External Sources
• Layer 2: Gateways (Actors)
• Layer 3: Processing & Engine
• Layer 4: Distribution & Consumption
• This level of detail ensures the engineer can trace end-to-end data flow and deployment boundaries.