Skip to content

Refactor execution message handling in Rust #2291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nautilus_core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 16 additions & 15 deletions nautilus_core/backtest/src/exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ use nautilus_core::{
correctness::{check_equal, FAILED},
AtomicTime, UnixNanos,
};
use nautilus_execution::{client::ExecutionClient, messages::TradingCommand};
use nautilus_execution::{
client::ExecutionClient,
matching_engine::{config::OrderMatchingEngineConfig, engine::OrderMatchingEngine},
messages::TradingCommand,
models::{fee::FeeModelAny, fill::FillModel, latency::LatencyModel},
};
use nautilus_model::{
accounts::AccountAny,
data::{
Expand All @@ -42,11 +47,7 @@ use nautilus_model::{
};
use rust_decimal::{prelude::ToPrimitive, Decimal};

use crate::{
matching_engine::{config::OrderMatchingEngineConfig, OrderMatchingEngine},
models::{fee::FeeModelAny, fill::FillModel, latency::LatencyModel},
modules::SimulationModule,
};
use crate::modules::SimulationModule;

pub struct SimulatedExchange {
id: Venue,
Expand Down Expand Up @@ -626,7 +627,14 @@ mod tests {
},
};
use nautilus_core::{AtomicTime, UnixNanos, UUID4};
use nautilus_execution::client::ExecutionClient;
use nautilus_execution::{
client::ExecutionClient,
models::{
fee::{FeeModelAny, MakerTakerFeeModel},
fill::FillModel,
latency::LatencyModel,
},
};
use nautilus_model::{
accounts::{AccountAny, MarginAccount},
data::{
Expand All @@ -645,14 +653,7 @@ mod tests {
use rstest::rstest;
use ustr::Ustr;

use crate::{
exchange::SimulatedExchange,
models::{
fee::{FeeModelAny, MakerTakerFeeModel},
fill::FillModel,
latency::LatencyModel,
},
};
use crate::exchange::SimulatedExchange;

static ATOMIC_TIME: LazyLock<AtomicTime> =
LazyLock::new(|| AtomicTime::new(true, UnixNanos::default()));
Expand Down
2 changes: 0 additions & 2 deletions nautilus_core/backtest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
pub mod data_client;
pub mod engine;
pub mod exchange;
pub mod matching_engine;
pub mod models;
pub mod modules;

#[cfg(feature = "ffi")]
Expand Down
5 changes: 4 additions & 1 deletion nautilus_core/execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ nautilus-common = { path = "../common" }
nautilus-core = { path = "../core" }
nautilus-model = { path = "../model", features = ["stubs"] }
anyhow = { workspace = true }
chrono = { workspace = true }
derive_builder = { workspace = true }
indexmap = { workspace = true }
log = { workspace = true }
pyo3 = { workspace = true, optional = true }
rand = { workspace = true }
rust_decimal = { workspace = true }
rust_decimal_macros = { workspace = true }
serde = { workspace = true }
strum = { workspace = true }
ustr = { workspace = true }
tokio = { workspace = true }
ustr = { workspace = true }
uuid = { workspace = true }

[dev-dependencies]
criterion = { workspace = true }
Expand Down
Loading
Loading