Live¶
- class InstrumentProviderConfig¶
Bases:
objectConfiguration for instrument providers.
- filter_callable¶
- filters¶
- load_all¶
- load_ids¶
- log_warnings¶
- class LiveDataClientConfig¶
Bases:
objectConfiguration for live data clients.
- handle_revised_bars¶
- instrument_provider¶
- routing¶
- class LiveDataEngineConfig¶
Bases:
objectConfiguration for live data engines.
- buffer_deltas¶
- debug¶
- emit_quotes_from_book¶
- emit_quotes_from_book_depths¶
- external_clients¶
- time_bars_build_delay¶
- time_bars_build_with_no_updates¶
- time_bars_interval_type¶
- time_bars_origin_offset¶
- time_bars_skip_first_non_full_bar¶
- time_bars_timestamp_on_close¶
- validate_data_sequence¶
- class LiveExecClientConfig¶
Bases:
objectConfiguration for live execution clients.
- instrument_provider¶
- routing¶
- class LiveExecEngineConfig¶
Bases:
objectConfiguration for live execution engines.
- allow_overfills¶
- debug¶
- external_clients¶
- filter_position_reports¶
- filter_unclaimed_external_orders¶
- filtered_client_order_ids¶
- generate_missing_orders¶
- inflight_check_interval_ms¶
- inflight_check_retries¶
- inflight_check_threshold_ms¶
- load_cache¶
- manage_own_order_books¶
- max_single_order_queries_per_cycle¶
- open_check_interval_secs¶
- open_check_lookback_mins¶
- open_check_missing_retries¶
- open_check_open_only¶
- open_check_threshold_ms¶
- own_books_audit_interval_secs¶
- position_check_interval_secs¶
- position_check_lookback_mins¶
- position_check_retries¶
- position_check_threshold_ms¶
- purge_account_events_interval_mins¶
- purge_account_events_lookback_mins¶
- purge_closed_orders_buffer_mins¶
- purge_closed_orders_interval_mins¶
- purge_closed_positions_buffer_mins¶
- purge_closed_positions_interval_mins¶
- reconciliation¶
- reconciliation_instrument_ids¶
- reconciliation_lookback_mins¶
- reconciliation_startup_delay_secs¶
- single_order_query_delay_ms¶
- snapshot_positions_interval_secs¶
- class LiveNode¶
Bases:
objectPython-facing wrapper owning a [LiveNode].
run_async moves the node into the returned awaitable, so the wrapper is empty for the remainder of a hosted run. Every method then fails with a clear error rather than aliasing the node the run future is driving. Capture cache, portfolio, and handle before starting a hosted run; each is an independent handle that stays usable while the node runs.
- add_actor_from_config(config)¶
- add_builtin_actor(type_name, config)¶
Adds a built-in example actor from its type name and config.
This method exists only to single-source bundled example actor code across Rust and Python tests/examples. It is not a first-class extension path for adding native actors.
- add_builtin_strategy(type_name, config)¶
Adds a built-in example strategy from its type name and config.
This method exists only to single-source bundled example strategy code across Rust and Python tests/examples. It is not a first-class extension path for adding native strategies.
- add_exec_algorithm(exec_algorithm)¶
Adds an execution algorithm to the trader.
Execution algorithms are registered in both the component registry (for lifecycle management) and the actor registry (for data callbacks via msgbus).
# Errors
Returns an error if: - The node is currently running. - An execution algorithm with the same ID is already registered.
- add_exec_algorithm_from_config(config)¶
- add_plugin(path, type_name, config=None, sha256=None)¶
Loads and registers one plug-in instance.
# Errors
Returns an error because dynamic plug-in hosting lives in the host-side integration.
- add_strategy(strategy)¶
Adds a strategy to the trader.
Strategies are registered in both the component registry (for lifecycle management) and the actor registry (for data callbacks via msgbus).
# Errors
Returns an error if: - The node is currently running. - A strategy with the same ID is already registered. - The strategy configures one or more external order claims and the request repeats
an instrument, or either tier already contains a requested claim.
The strategy configures one or more external order claims or an OMS type override, and the execution engine is already borrowed. A strategy configuring neither does not take the borrow and cannot fail this way.
- add_strategy_from_config(config)¶
- static build(name, config=None)¶
Creates a new LiveNode directly from a kernel name and optional configuration.
This is a convenience method for creating a live node with a pre-configured kernel configuration, bypassing the builder pattern. If no config is provided, a default configuration will be used.
# Errors
Returns an error if kernel construction fails.
- static builder(name, trader_id, environment)¶
Creates a new LiveNodeBuilder for fluent configuration.
# Errors
Returns an error if the environment is invalid for live trading.
- cache¶
Returns the cache shared with the kernel and registered components.
- dispose()¶
Disposes the live node kernel and releases resources.
Does nothing while a hosted run holds the node. The run returns the node when it finishes, so a try/finally cleanup that outlives the run disposes it as usual.
- environment¶
Gets the node’s environment.
- handle()¶
Returns a thread-safe handle for controlling and observing this node.
The handle stays valid for the node’s whole lifetime, including while run_async owns the node, and is the supported way to stop a hosted run.
- instance_id¶
Gets the node’s instance ID.
- is_running¶
Checks if the live node is currently running.
Answered from the handle, so this stays truthful while a hosted run holds the node.
- portfolio¶
Returns the portfolio shared with the kernel and registered components.
- run()¶
Run the live node with automatic shutdown handling.
This method starts the node, runs indefinitely, and handles graceful shutdown on interrupt signals.
# Thread Safety
The event loop runs directly on the current thread (not spawned) because the msgbus uses thread-local storage. Endpoints registered by the kernel are only accessible from the same thread.
# Shutdown Sequence
Signal received (SIGINT, SIGTERM, or handle stop).
Trader components stopped (triggers order cancellations, etc.).
Event loop continues processing residual events for the configured grace period.
Kernel finalized, clients disconnected, remaining events drained.
# Errors
Returns an error if the node fails to start or encounters a runtime error.
- run_async()¶
Runs the live node on the caller’s asyncio event loop.
Takes the node and returns an awaitable that resolves once the node has stopped. The host owns the loop and its signal handling, so this installs no signal handlers. Stop the node through the handle from handle(); cancelling the awaiting task requests the same graceful shutdown, waits for it to finish, then re-raises the cancellation.
Capture cache, portfolio, and handle() before calling this. They stay usable while the node runs, whereas the node itself is owned by the returned awaitable.
# Limitations
A node configured with a cache database backing is rejected. Those backings wait for their worker task by blocking the calling thread, which stalls the host loop rather than merely slowing it. Use run() for a database-backed node until the backings can be driven without blocking a host loop.
# Errors
Returns an error if the node has already been taken, no event loop is running, a cache database backing is configured, or another node is already running on this loop.
- stop()¶
Stop the live node.
This method stops the trader, waits for the configured grace period to allow residual events to be processed, then finalizes the shutdown sequence.
# Errors
Returns an error if shutdown fails.
- trader_id¶
Gets the node’s trader ID.
- class LiveNodeBuilder¶
Bases:
objectPython wrapper for LiveNodeBuilder that uses interior mutability to work around PyO3’s shared ownership model.
- add_data_client(name, factory, config, routing=None)¶
- add_exec_client(name, factory, config, routing=None)¶
- add_simulated_exec_client(name, factory, config)¶
- build()¶
- with_cache_config(config)¶
- with_cache_database_factory(factory)¶
- with_controller(controller)¶
- with_data_engine_config(config)¶
- with_delay_post_stop_secs(delay_secs)¶
- with_delay_shutdown_secs(delay_secs)¶
- with_exec_engine_config(config)¶
- with_external_msgbus_factory(factory)¶
- with_instance_id(instance_id)¶
- with_load_state(load_state)¶
- with_logging(logging)¶
- with_msgbus_config(config)¶
- with_portfolio_config(config)¶
- with_reconciliation(reconciliation)¶
- with_reconciliation_lookback_mins(mins)¶
- with_risk_engine_config(config)¶
- with_save_state(save_state)¶
- with_timeout_connection(timeout_secs)¶
- with_timeout_disconnection_secs(timeout_secs)¶
- with_timeout_portfolio(timeout_secs)¶
- with_timeout_reconciliation(timeout_secs)¶
- class LiveNodeConfig¶
Bases:
objectConfiguration for live Nautilus system nodes.
- cache¶
- controller¶
- data_engine¶
- delay_post_stop_secs¶
- environment¶
- exec_engine¶
- instance_id¶
- load_state¶
- logging¶
- loop_debug¶
- msgbus¶
- plugins¶
- portfolio¶
- queue_monitor¶
- risk_engine¶
- save_state¶
- shutdown_on_error¶
- timeout_connection_secs¶
- timeout_disconnection_secs¶
- timeout_portfolio_secs¶
- timeout_reconciliation_secs¶
- timeout_shutdown_secs¶
- trader_id¶
- class LiveNodeHandle¶
Bases:
objectThread-safe control handle for a [LiveNode].
Stays valid for the node’s whole lifetime, including while a hosted run owns the node, and is safe to call from any thread or from a signal handler.
- is_running¶
Returns whether the node is currently running.
- is_stopping¶
Returns whether a stop has been requested.
- state¶
Returns the node’s current lifecycle state.
- stop()¶
Signals the node to stop, returning immediately.
The node then runs its full shutdown sequence, so callers awaiting run_async observe completion only once shutdown finishes.
- class LiveRiskEngineConfig¶
Bases:
objectConfiguration for live risk engines.
- bypass¶
- debug¶
- max_notional_per_order¶
- max_order_modify_rate¶
- max_order_submit_rate¶
- class NodeState¶
Bases:
objectLifecycle state of the LiveNode runner.
- IDLE = NodeState.IDLE¶
- RUNNING = NodeState.RUNNING¶
- SHUTTING_DOWN = NodeState.SHUTTING_DOWN¶
- STARTING = NodeState.STARTING¶
- STOPPED = NodeState.STOPPED¶
- class PluginConfig¶
Bases:
objectConfiguration for one Rust-native plug-in instance loaded by a live node.
- config¶
- path¶
- sha256¶
- type_name¶