Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
e581c0c
2025/08/31, Add price prot points.
Aug 31, 2025
c51e285
Merge remote-tracking branch 'origin' into enhancement/price_protecti…
Aug 31, 2025
a615dfc
2025/08/31, Change to Optional.
Aug 31, 2025
b9a86b8
Merge branch 'develop' of https://github.com/nautechsystems/nautilus_…
Oct 5, 2025
9144243
2025/10/06, Add price protection
Oct 5, 2025
6ab5c45
2025/10/09, Fix
Oct 9, 2025
17537a0
Merge remote-tracking branch 'origin' into enhancement/price_protecti…
Oct 9, 2025
932f197
2025/10/09, Add Test for Market order with protection
Oct 9, 2025
ceafd36
2025/10/09, Add Test for Stop Market order with protection
Oct 9, 2025
3dffb43
2025/10/11, Merge wtih dev.
Oct 11, 2025
13be16a
2025/10/14, Precommit2.
Oct 14, 2025
5681c06
Merge
Oct 15, 2025
fcbda02
Fix clippy2
Oct 15, 2025
caa7eb4
Merge remote-tracking branch 'origin' into enhancement/price_protecti…
Oct 18, 2025
5c76faf
2025/10/21, Fix tests.
Oct 21, 2025
4e44337
Merge remote-tracking branch 'origin' into enhancement/price_protecti…
Oct 21, 2025
7d56172
Fix test
Oct 21, 2025
d4eabdd
Merge remote-tracking branch 'origin' into enhancement/price_protecti…
Oct 21, 2025
78103e4
Fix pre-commit
Oct 21, 2025
40d7337
Change PositionId validation check from ASCII to UTF-8 (#3105)
Osub Oct 21, 2025
851574e
Update pull request template
cjdsellers Oct 21, 2025
e001e93
Refine ActorExecutor logging
cjdsellers Oct 21, 2025
d68b833
Update dependencies including cbindgen
cjdsellers Oct 21, 2025
7d5cda3
Fix race condition in account registration during startup
cjdsellers Oct 22, 2025
22c2262
Improve price_to_order_id hashing for L2 books
cjdsellers Oct 22, 2025
ef9365c
Upgrade databento crate
cjdsellers Oct 22, 2025
10e9881
Improve order book handling of NoOrderSide deltas
cjdsellers Oct 22, 2025
5793f19
Fix orderbook test for cross-platform hash values
cjdsellers Oct 22, 2025
4bf3205
Refactor accounts and margin handling in Rust
cjdsellers Oct 22, 2025
9f91524
Refine execution client await_account_registered
cjdsellers Oct 22, 2025
8218d55
Refine ensure_file_exists function and tests
cjdsellers Oct 22, 2025
b17e02e
Update dependencies and release notes
cjdsellers Oct 22, 2025
6c473d9
Upgrade Cython
cjdsellers Oct 22, 2025
9c8f944
Standardize error variable naming conventions
cjdsellers Oct 23, 2025
d3b8801
Add backtest example for databento CME simple quoter
cjdsellers Oct 23, 2025
70b93cf
Install ripgrep in CI and make hook graceful when missing
cjdsellers Oct 23, 2025
72c85e9
Fix OKX spot margin quote quantity order handling
cjdsellers Oct 23, 2025
f2f126e
Fix error conventions hook for cross-platform compatibility
cjdsellers Oct 23, 2025
7b366f2
Update OKX integration guide
cjdsellers Oct 23, 2025
63ec339
Standardize account state updates and connection sequencing
cjdsellers Oct 23, 2025
9cadb59
Fix Bybit wallet balance calculation for spot borrow
cjdsellers Oct 23, 2025
e688992
Fix Bybit spot position reports for spot margin borrowing
cjdsellers Oct 23, 2025
488327c
Improve ActorExecutor to log full exception tracebacks
cjdsellers Oct 23, 2025
63adea9
Add liquidity utilization rate to AMM pool profiler (#3107)
filipmacek Oct 23, 2025
6977da3
Add filter_sec_types config to skip unsupported IB instrument types (…
sunlei Oct 23, 2025
5125aa4
Update dependencies and release notes
cjdsellers Oct 23, 2025
37ab4e1
Improve error handling in hypersync DEX event processing
cjdsellers Oct 23, 2025
9b3684d
Refine async task exception handling in ThrottledEnqueuer
cjdsellers Oct 23, 2025
540cc6c
Refine error handling for external message streaming task
cjdsellers Oct 23, 2025
2c5f5f5
Fix BacktestEngine to retain instruments on reset
cjdsellers Oct 23, 2025
9490c81
Add possibility to emit QuoteTick when updating order book (#3106)
faysou Oct 23, 2025
775b5df
Refine quotes from book updates
cjdsellers Oct 23, 2025
02fa035
Standardize exception logging
cjdsellers Oct 24, 2025
a8d0daf
Improve HTTP adapter error handling for cancellation
cjdsellers Oct 24, 2025
6dbbfb2
Fix Redis multi-stream consumer skipping messages
cjdsellers Oct 24, 2025
90c3962
Fix pre-commit and update Rust developer guide
cjdsellers Oct 24, 2025
00017f6
Standardize instruments between Python and Rust
cjdsellers Oct 24, 2025
92fb0fc
Update dependencies
cjdsellers Oct 24, 2025
b2b41a5
Upgrade Cython
cjdsellers Oct 24, 2025
4d3e062
Implement reconnects for blockchain RPC client
cjdsellers Oct 24, 2025
587b15d
Improve BacktestNode error handling with explicit exception
cjdsellers Oct 25, 2025
9b975a5
Fix InstrumentProvider exception handling
cjdsellers Oct 25, 2025
e2c6105
Fix msgspec encoding for type objects with qualified names
cjdsellers Oct 25, 2025
8765fb1
Standardize mutex lock error handling
cjdsellers Oct 25, 2025
f797366
Standardize crate manifests and docs
cjdsellers Oct 24, 2025
a9d0524
Fix bugs found in Polymarket adapter audit
cjdsellers Oct 25, 2025
c54a0a6
Fix typo in installation docs grep command
cjdsellers Oct 25, 2025
8966528
Standardize mutex lock error handling
cjdsellers Oct 25, 2025
7c9b9d8
Add wheel count validation for release workflows
cjdsellers Oct 25, 2025
4549ba2
Implement OKX spot margin reconciliation and quote-quantity orders
cjdsellers Oct 25, 2025
371770a
Update dependencies and release notes
cjdsellers Oct 25, 2025
4c77b4e
Repair OKX spot margin per-instrument position reconciliation
cjdsellers Oct 25, 2025
0efd190
Fix OKX WebSocket heartbeat and standardize logging
cjdsellers Oct 25, 2025
d112beb
Improve robustness of adapter WebSocket reconnection tests
cjdsellers Oct 25, 2025
38bb120
Improve Polymarket execution flows and efficiency
cjdsellers Oct 26, 2025
bcf3f67
Add heartbeat for Coinbase Intx websocket
cjdsellers Oct 25, 2025
e4d4334
Fix logging bugs and improve error handling
cjdsellers Oct 26, 2025
4081bf0
Improve OKX adapter reliability and correctness
cjdsellers Oct 26, 2025
7ab77fa
Improve Polymarket trade event signaling
cjdsellers Oct 26, 2025
0b27724
Improve adapter websocket reconnection tests robustness
cjdsellers Oct 26, 2025
3f996ce
Refine CI wheel artifacts handling
cjdsellers Oct 26, 2025
a0d5e23
Prepare release
cjdsellers Oct 26, 2025
e550aff
Fix CI tag-release job git credentials
cjdsellers Oct 26, 2025
6eec712
Bump version
cjdsellers Oct 26, 2025
3dd9781
Optimize CI common-setup action
cjdsellers Oct 26, 2025
f3576c9
Refine README
cjdsellers Oct 26, 2025
0bc4fad
Drop support for Python 3.11
cjdsellers Oct 26, 2025
43cf017
Remove redundant TypeVar
cjdsellers Oct 26, 2025
fb9daed
Upgrade CI GitHub actions
cjdsellers Oct 26, 2025
4b0cba5
Standardize crate READMEs
cjdsellers Oct 26, 2025
3095adf
Update CI wheel counts
cjdsellers Oct 26, 2025
6e92041
Remove black and refine lint configs
cjdsellers Oct 27, 2025
f6eb1da
Add initial backtest visualization tearsheets
cjdsellers Oct 27, 2025
5262e2d
Refactor reading of feather files in catalog (#3114)
faysou Oct 27, 2025
5965565
Upgrade implied-vol crate (#3115)
faysou Oct 27, 2025
b5545b9
Update dependencies and refine tooling
cjdsellers Oct 27, 2025
325b914
Continue Hyperliquid adapter
cjdsellers Oct 28, 2025
afc3100
Optimize BacktestEngine data loading with deferred sorting
cjdsellers Oct 28, 2025
c40ecb1
Upgrade continuous reconciliation for execution engine
cjdsellers Oct 28, 2025
f1a66de
Merge with dev
Oct 28, 2025
dcab1ca
Add BitMEX SubmitBroadcaster scaffolding
cjdsellers Oct 28, 2025
92a927f
Fix OKX spot margin position reports for borrowing
cjdsellers Oct 28, 2025
e6c536a
Improve OKX quantity parsing error handling
cjdsellers Oct 29, 2025
fc66613
Update docs guidance on one node per process
cjdsellers Oct 29, 2025
47ab77b
Port Bybit integration adapter to Rust
cjdsellers Oct 29, 2025
4b70060
Add OKX spot margin and swap quoter example
cjdsellers Oct 29, 2025
5e52e49
Fix Bybit pagination tests
Antifrajz Oct 29, 2025
3f52baa
Merge remote-tracking branch 'origin' into enhancement/price_protecti…
Antifrajz Oct 29, 2025
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 crates/adapters/bitmex/src/websocket/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,8 @@ pub fn parse_order_update_msg(

// BitMEX doesn't send trigger price in regular order updates?
let trigger_price = None;
// BitMEX doesn't send protection price in regular order updates
let protection_price = None;

let event_id = UUID4::new();
let ts_event = parse_optional_datetime_to_unix_nanos(&msg.timestamp, "timestamp");
Expand All @@ -684,6 +686,7 @@ pub fn parse_order_update_msg(
Some(account_id),
price,
trigger_price,
protection_price,
))
}

Expand Down
5 changes: 5 additions & 0 deletions crates/backtest/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ pub struct BacktestVenueConfig {
default_leverage: Option<f64>,
/// The instrument specific leverage configuration (for margin accounts).
leverages: Option<HashMap<Currency, f64>>,
/// Defines an exchange-calculated price boundary to prevent a market order from being
/// filled at an extremely aggressive price.
price_protection_points: f64,
}

impl BacktestVenueConfig {
Expand All @@ -315,6 +318,7 @@ impl BacktestVenueConfig {
base_currency: Option<Currency>,
default_leverage: Option<f64>,
leverages: Option<HashMap<Currency, f64>>,
price_protection_points: Option<f64>,
) -> Self {
Self {
name,
Expand All @@ -336,6 +340,7 @@ impl BacktestVenueConfig {
base_currency,
default_leverage,
leverages,
price_protection_points: price_protection_points.unwrap_or(0.0),
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/backtest/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ impl BacktestEngine {
trade_execution: Option<bool>,
allow_cash_borrowing: Option<bool>,
frozen_account: Option<bool>,
price_protection_points: Option<Decimal>,
) -> anyhow::Result<()> {
let default_leverage: Decimal = default_leverage.unwrap_or_else(|| {
if account_type == AccountType::Margin {
Expand Down Expand Up @@ -182,6 +183,7 @@ impl BacktestEngine {
use_message_queue,
allow_cash_borrowing,
frozen_account,
price_protection_points,
)?;
let exchange = Rc::new(RefCell::new(exchange));
self.venues.insert(venue, exchange.clone());
Expand Down Expand Up @@ -546,6 +548,7 @@ mod tests {
None,
None,
None,
None,
)
.unwrap();
engine
Expand Down
13 changes: 12 additions & 1 deletion crates/backtest/src/exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ pub struct SimulatedExchange {
use_message_queue: bool,
allow_cash_borrowing: bool,
frozen_account: bool,
price_protection_points: Decimal,
}

impl Debug for SimulatedExchange {
Expand Down Expand Up @@ -180,6 +181,7 @@ impl SimulatedExchange {
use_message_queue: Option<bool>,
allow_cash_borrowing: Option<bool>,
frozen_account: Option<bool>,
price_protection_points: Option<Decimal>,
) -> anyhow::Result<Self> {
if starting_balances.is_empty() {
anyhow::bail!("Starting balances must be provided")
Expand Down Expand Up @@ -219,6 +221,7 @@ impl SimulatedExchange {
use_message_queue: use_message_queue.unwrap_or(true),
allow_cash_borrowing: allow_cash_borrowing.unwrap_or(false),
frozen_account: frozen_account.unwrap_or(false),
price_protection_points: price_protection_points.unwrap_or(Decimal::ZERO),
})
}

Expand Down Expand Up @@ -273,6 +276,12 @@ impl SimulatedExchange {

self.instruments.insert(instrument.id(), instrument.clone());

let price_protection = if self.price_protection_points.is_zero() {
None
} else {
Some(self.price_protection_points)
};

let matching_engine_config = OrderMatchingEngineConfig::new(
self.bar_execution,
self.reject_stop_orders,
Expand All @@ -281,7 +290,8 @@ impl SimulatedExchange {
self.use_position_ids,
self.use_random_ids,
self.use_reduce_only,
);
)
.with_price_protection_points(price_protection);
let instrument_id = instrument.id();
let matching_engine = OrderMatchingEngine::new(
instrument,
Expand Down Expand Up @@ -875,6 +885,7 @@ mod tests {
None,
None,
None,
None,
)
.unwrap(),
));
Expand Down
2 changes: 2 additions & 0 deletions crates/execution/src/client/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ impl ExecutionClientCore {
quantity: Quantity,
price: Price,
trigger_price: Option<Price>,
protection_price: Option<Price>,
ts_event: UnixNanos,
venue_order_id_modified: bool,
) {
Expand Down Expand Up @@ -329,6 +330,7 @@ impl ExecutionClientCore {
Some(self.account_id),
Some(price),
trigger_price,
protection_price,
);

self.send_order_event(OrderEventAny::Updated(event));
Expand Down
3 changes: 3 additions & 0 deletions crates/execution/src/engine/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4485,6 +4485,7 @@ fn test_handle_updated_order_event(mut execution_engine: ExecutionEngine) {
Some(account_id),
order.price(),
None, // trigger_price
None, // protection_price
));
execution_engine.process(&order_updated_event);

Expand Down Expand Up @@ -6604,6 +6605,7 @@ fn test_order_updates_in_own_book() {
Some(account_id), // account_id
Some(new_bid_price), // new price
None, // trigger_price
None, // protection_price
));

let order_updated_ask = OrderEventAny::Updated(OrderUpdated::new(
Expand All @@ -6620,6 +6622,7 @@ fn test_order_updates_in_own_book() {
Some(account_id), // account_id
Some(new_ask_price), // new price
None, // trigger_price
None, // protection_price
));

execution_engine.process(&order_updated_bid);
Expand Down
1 change: 1 addition & 0 deletions crates/execution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ pub mod matching_engine;
pub mod models;
pub mod order_emulator;
pub mod order_manager;
pub mod protection;
pub mod trailing;
15 changes: 15 additions & 0 deletions crates/execution/src/matching_engine/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

use rust_decimal::Decimal;

/// Configuration for `OrderMatchingEngine` instances.
#[derive(Debug, Clone)]
pub struct OrderMatchingEngineConfig {
Expand All @@ -23,6 +25,7 @@ pub struct OrderMatchingEngineConfig {
pub use_position_ids: bool,
pub use_random_ids: bool,
pub use_reduce_only: bool,
pub price_protection_points: Option<Decimal>,
}

impl OrderMatchingEngineConfig {
Expand All @@ -45,8 +48,19 @@ impl OrderMatchingEngineConfig {
use_position_ids,
use_random_ids,
use_reduce_only,
price_protection_points: None,
}
}

/// Sets the price protection points for the matching engine.
#[must_use]
pub const fn with_price_protection_points(
mut self,
price_protection_points: Option<Decimal>,
) -> Self {
self.price_protection_points = price_protection_points;
self
}
}

#[allow(clippy::derivable_impls)]
Expand All @@ -61,6 +75,7 @@ impl Default for OrderMatchingEngineConfig {
use_position_ids: false,
use_random_ids: false,
use_reduce_only: false,
price_protection_points: None,
}
}
}
Loading
Loading