Skip to main content

nautilus_execution/python/
mod.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! Python bindings from [PyO3](https://pyo3.rs).
17
18pub mod config;
19pub mod fee;
20pub mod fill;
21pub mod latency;
22pub mod reconciliation;
23
24use pyo3::prelude::*;
25
26/// Loaded as `nautilus_pyo3.execution`.
27///
28/// # Errors
29///
30/// Returns a `PyErr` if registering any module components fails.
31#[pymodule]
32pub fn execution(_: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
33    m.add_function(wrap_pyfunction!(
34        reconciliation::py_adjust_fills_for_partial_window,
35        m
36    )?)?;
37    m.add_function(wrap_pyfunction!(
38        reconciliation::py_calculate_reconciliation_price,
39        m
40    )?)?;
41    m.add_function(wrap_pyfunction!(
42        reconciliation::py_create_inferred_reconciliation_trade_id,
43        m
44    )?)?;
45    m.add_function(wrap_pyfunction!(
46        reconciliation::py_create_position_reconciliation_venue_order_id,
47        m
48    )?)?;
49    m.add_class::<crate::engine::config::ExecutionEngineConfig>()?;
50    m.add_class::<crate::order_emulator::config::OrderEmulatorConfig>()?;
51    m.add_class::<crate::models::fee::FixedFeeModel>()?;
52    m.add_class::<crate::models::fee::MakerTakerFeeModel>()?;
53    m.add_class::<crate::models::fee::PerContractFeeModel>()?;
54    m.add_class::<crate::models::fill::DefaultFillModel>()?;
55    m.add_class::<crate::models::fill::BestPriceFillModel>()?;
56    m.add_class::<crate::models::fill::OneTickSlippageFillModel>()?;
57    m.add_class::<crate::models::fill::ProbabilisticFillModel>()?;
58    m.add_class::<crate::models::fill::TwoTierFillModel>()?;
59    m.add_class::<crate::models::fill::ThreeTierFillModel>()?;
60    m.add_class::<crate::models::fill::LimitOrderPartialFillModel>()?;
61    m.add_class::<crate::models::fill::SizeAwareFillModel>()?;
62    m.add_class::<crate::models::fill::CompetitionAwareFillModel>()?;
63    m.add_class::<crate::models::fill::VolumeSensitiveFillModel>()?;
64    m.add_class::<crate::models::fill::MarketHoursFillModel>()?;
65    m.add_class::<crate::models::latency::StaticLatencyModel>()?;
66    Ok(())
67}