Skip to main content

nautilus_execution/matching_engine/
config.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
16use serde::{Deserialize, Serialize};
17
18/// Configuration for `OrderMatchingEngine` instances.
19#[derive(Debug, Clone, Deserialize, Serialize, bon::Builder)]
20#[serde(default, deny_unknown_fields)]
21pub struct OrderMatchingEngineConfig {
22    #[builder(default)]
23    pub bar_execution: bool,
24    #[builder(default)]
25    pub bar_adaptive_high_low_ordering: bool,
26    #[builder(default = true)]
27    pub trade_execution: bool,
28    #[builder(default)]
29    pub liquidity_consumption: bool,
30    #[builder(default)]
31    pub reject_stop_orders: bool,
32    #[builder(default)]
33    pub support_gtd_orders: bool,
34    #[builder(default)]
35    pub support_contingent_orders: bool,
36    #[builder(default)]
37    pub use_position_ids: bool,
38    #[builder(default)]
39    pub use_random_ids: bool,
40    #[builder(default)]
41    pub use_reduce_only: bool,
42    #[builder(default)]
43    pub use_market_order_acks: bool,
44    #[builder(default)]
45    pub queue_position: bool,
46    #[builder(default)]
47    pub oto_full_trigger: bool,
48    pub price_protection_points: Option<u32>,
49}
50
51impl Default for OrderMatchingEngineConfig {
52    fn default() -> Self {
53        Self::builder().build()
54    }
55}