Operations dispatched by showcase/nautilus-trader/harness/src/main.rs
Applies fills across linked OUO orders in Cache and invokes OrderManager::handle_contingencies.
Submits OUO pullback+breakout pair on L2 OrderMatchingEngine and fills only the breakout leg.
Partially fills pullback Limit order, then triggers and partially fills breakout StopLimit on L2 OrderBook.
Runs SimulatedExchange::process_liquidations on a multi-currency MarginAccount (base_currency = None).
Runs SimulatedExchange::process_liquidations on a well-funded single-currency USD MarginAccount.
Runs SimulatedExchange::process_liquidations on a single-currency USD MarginAccount holding an underwater JPY-settled USD/JPY position.
nautechsystems/nautilus_trader @ 056f31ebd43d84df9a3afde2e58ef2167759d061
Handles OrderFilled contingency updates and emits ModifyLocalQuantity or CancelLocal for linked OUO orders.
Applies L2 book deltas, matches resting/stop-triggered orders, and triggers update_ouo_child_after_fill.
Resizes linked contingent child orders during fills (update_ouo_child_after_fill) and modifications (update_contingent_order).
Buckets open positions, sums unrealized PnL via liquidation_unrealized_total, and compares equity vs maintenance margin.
Routes LiquidationTrigger across venue OrderMatchingEngines via liquidate_open_positions or liquidate_all_open_positions.
In-memory Cache, L2 OrderBook, MarginAccount, and nautilus_exec output telemetry
Stores orders, fills, positions, MarginAccount balances/margins, and Cache::try_get_xrate Mid FX rates.
Captures emitted OrderManagerAction, OrderEventAny updates, and LIQUIDATION- fills.
OUO client/engine remaining leaves preservation and single-currency foreign-settled liquidation
ModifyLocalQuantity equals sibling.filled_qty() + primary.leaves_qty() when sibling already has partial fills.
OUO sibling remains open on matching engine with leaves_qty == primary.leaves_qty() and quantity == child_filled + primary.leaves_qty().
Single-currency MarginAccount aggregates FX-converted PnL under base_currency and liquidates underwater foreign-settled positions.
OrderManager OUO sibling under-sizing, OrderMatchingEngine contingent leaves overwrite, and single-currency MarginAccount liquidation bypass
OrderManager::handle_contingencies passed leaves_qty directly to modify_order_quantity without adding contingent_order.filled_qty().
update_contingent_quantity compared target leaves_qty against order.leaves_qty() then passed leaves_qty directly as total quantity to update_order.
plan_liquidations bucketed by settlement_currency without base_currency aggregation or FX conversion, and execute_liquidations skipped non-base instruments.