Rust Trader is a high-performance financial trading system implemented in Rust. It leverages Rust's memory safety guarantees and concurrency features, along with the Tokio runtime for efficient concurrent execution, to provide a reliable and efficient trading system.
The project is organized into several modules:
-
src/descriptor/domain_entity.rs
: This file contains the definitions for the domain entities used in the trading system. These entities represent the core business objects in the system, such as orders and trades. -
src/descriptor/domain_logic.rs
: This file contains the business logic related to the domain entities. This includes the rules for order execution, trade matching, and other core trading operations. -
src/descriptor/system_entity.rs
: This file contains the definitions for the system entities used in the trading system. These entities represent the infrastructure components of the system, such as the order book and the market data connector. -
src/descriptor/system_logic.rs
: This file contains the logic related to the system entities. This includes the algorithms for order routing, market data processing, and other system-level operations. -
src/main.rs
: This is the entry point of the application. It sets up the trading system and starts the main event loop.
-
Parallel Execution: Rust Trader uses the Tokio runtime for efficient concurrent execution. This allows it to handle multiple orders and trades simultaneously, improving overall system performance.
-
Graph-based Order Chain: The OrderExecutor struct in system_entity.rs is responsible for executing orders. It uses a directed acyclic graph (DAG) to represent the dependencies between orders, allowing for efficient execution of complex order strategies.
-
Market Data Connection: The
MarketDataConnector
struct insystem_entity.rs
is responsible for connecting to the market data feed. It uses WebSockets to receive real-time market data updates. -
Notification Service: The
NotificationService
struct insystem_entity.rs
is responsible for sending notifications. It uses a Slack webhook to send messages to a specified Slack channel.
To run the project, navigate to the rust_trader
directory and use the cargo run
command:
cd rust_trader
cargo run
To run the tests for the project, use the cargo test
command:
cargo test
Contributions to Rust Trader are welcome! Please submit a pull request or create an issue to discuss any changes you'd like to make.
Rust Trader is licensed under the MIT License.