Live¶
Live trading engine and node components.
- class BarsResponse¶
Bases:
objectAn owned BarsResponse response.
- bar_type¶
- client_id¶
- correlation_id¶
- data¶
- end¶
- params¶
- start¶
- ts_init¶
- class BatchCancelOrders¶
Bases:
object- cancels¶
- causation_id¶
- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- strategy_id¶
- trader_id¶
- ts_init¶
- class BatchModifyOrders¶
Bases:
object- causation_id¶
- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- modifies¶
- params¶
- strategy_id¶
- trader_id¶
- ts_init¶
- class BookDeltasResponse¶
Bases:
objectAn owned BookDeltasResponse response.
- client_id¶
- correlation_id¶
- data¶
- end¶
- instrument_id¶
- params¶
- start¶
- ts_init¶
- class BookDepthResponse¶
Bases:
objectAn owned BookDepthResponse response.
- client_id¶
- correlation_id¶
- data¶
- end¶
- instrument_id¶
- params¶
- start¶
- ts_init¶
- class BookResponse¶
Bases:
objectAn owned BookResponse response.
- client_id¶
- correlation_id¶
- data¶
- end¶
- instrument_id¶
- params¶
- start¶
- ts_init¶
- class CancelAllOrders¶
Bases:
object- causation_id¶
- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- order_side¶
- params¶
- strategy_id¶
- trader_id¶
- ts_init¶
- class CancelOrder¶
Bases:
object- causation_id¶
- client_id¶
- client_order_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- strategy_id¶
- trader_id¶
- ts_init¶
- venue_order_id¶
- class ClientCache¶
Bases:
objectRead-only access to the owning node’s cache.
- account(account_id)¶
- client_order_id(venue_order_id)¶
- client_order_ids_open(venue=None, instrument_id=None, strategy_id=None, account_id=None)¶
- get(key)¶
- instrument(instrument_id)¶
- instrument_ids(venue=None)¶
- instruments(venue=None)¶
- order(client_order_id)¶
- order_book(instrument_id)¶
- order_list(order_list_id)¶
- orders(venue=None, instrument_id=None, strategy_id=None, account_id=None, side=None)¶
- orders_inflight(venue=None, instrument_id=None, strategy_id=None, account_id=None, side=None)¶
- orders_open(venue=None, instrument_id=None, strategy_id=None, account_id=None, side=None)¶
- orders_open_count(venue=None, instrument_id=None, strategy_id=None, account_id=None, side=None)¶
- position(position_id)¶
- position_id(client_order_id)¶
- positions_open(venue=None, instrument_id=None, strategy_id=None, account_id=None, side=None)¶
- quote(instrument_id, index=0)¶
- strategy_id_for_order(client_order_id)¶
- venue_order_id(client_order_id)¶
- class CustomDataResponse¶
Bases:
objectAn owned CustomDataResponse response.
- client_id¶
- correlation_id¶
- data¶
- data_type¶
- end¶
- params¶
- start¶
- ts_init¶
- venue¶
- class DataClientConfig¶
Bases:
objectShared configuration for data clients registered with a live node.
- dict()¶
- handle_revised_bars¶
- instrument_provider¶
- json()¶
- routing¶
- to_importable(factory=None)¶
- class ExecutionClientConfig¶
Bases:
objectShared configuration for execution clients registered with a live node.
- dict()¶
- instrument_provider¶
- json()¶
- routing¶
- to_importable(factory=None)¶
- class FundingRatesResponse¶
Bases:
objectAn owned FundingRatesResponse response.
- client_id¶
- correlation_id¶
- data¶
- end¶
- instrument_id¶
- params¶
- start¶
- ts_init¶
- class GenerateFillReports¶
Bases:
object- causation_id¶
- command_id¶
- correlation_id¶
- end¶
- instrument_id¶
- log_receipt_level¶
- params¶
- start¶
- ts_init¶
- venue_order_id¶
- class GenerateOrderStatusReport¶
Bases:
object- causation_id¶
- client_order_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue_order_id¶
- class GenerateOrderStatusReports¶
Bases:
object- causation_id¶
- command_id¶
- correlation_id¶
- end¶
- instrument_id¶
- log_receipt_level¶
- open_only¶
- params¶
- start¶
- ts_init¶
- class GeneratePositionStatusReports¶
Bases:
object- causation_id¶
- command_id¶
- correlation_id¶
- end¶
- instrument_id¶
- log_receipt_level¶
- params¶
- start¶
- ts_init¶
- class InstrumentProviderConfig¶
Bases:
objectConfiguration for instrument providers.
- filter_callable¶
- filters¶
- load_all¶
- load_ids¶
- log_warnings¶
- class InstrumentResponse¶
Bases:
objectAn owned InstrumentResponse response.
- client_id¶
- correlation_id¶
- data¶
- end¶
- instrument_id¶
- params¶
- start¶
- ts_init¶
- class InstrumentsResponse¶
Bases:
objectAn owned InstrumentsResponse response.
- client_id¶
- correlation_id¶
- data¶
- end¶
- params¶
- start¶
- ts_init¶
- venue¶
- 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 LiveExecutionEngineConfig¶
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_orders¶
- snapshot_positions¶
- snapshot_positions_interval_secs¶
- submission_recovery_policy¶
- 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(actor)¶
Adds a constructed Python actor to the trader.
# Errors
Returns an error if the node is running, the actor is invalid, or registration fails.
- 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 configured external order instrument IDs repeat an instrument or the cache already
contains a requested claim.
The strategy configures one or more external order instrument IDs and the cache is already borrowed.
The strategy configures an OMS type override and the execution engine is already borrowed.
- add_strategy_from_config(config)¶
- add_stream_processor(callback)¶
Adds a callback for supported typed external messages.
While run or run_async services external ingress, the node invokes callbacks in registration order before normal inbound streaming filters for recognized JSON or MessagePack typed payloads. Each callback receives an encoding-independent Python mapping that follows the concrete payload’s serialized object shape and adds a payload_type field. Other encodings are skipped with a warning. External egress is suppressed while the callback runs, so synchronous publications remain local. Callback exceptions are logged, stop the remaining processors, and skip internal republishing.
# Errors
Returns an error if the node is no longer available for mutation.
- static build(name, config=None, *, data_factories=None, exec_factories=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()¶
- static from_config(name, config=None, *, data_factories=None, exec_factories=None)¶
- 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¶
- catalogs¶
- controller¶
- data_clients¶
- data_engine¶
- delay_post_stop_secs¶
- environment¶
- exec_clients¶
- exec_engine¶
- instance_id¶
- load_state¶
- logging¶
- loop_debug¶
- msgbus¶
- plugins¶
- portfolio¶
- queue_monitor¶
- risk_engine¶
- save_state¶
- shutdown_on_error¶
- streaming¶
- 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¶
- full_position_exit_venues¶
- max_notional_per_order¶
- max_order_modify_rate¶
- max_order_submit_rate¶
- class ModifyOrder¶
Bases:
object- causation_id¶
- client_id¶
- client_order_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- price¶
- quantity¶
- strategy_id¶
- trader_id¶
- trigger_price¶
- ts_init¶
- venue_order_id¶
- 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 OptionChainReferencePriceResponse¶
Bases:
objectAn owned OptionChainReferencePriceResponse response.
- client_id¶
- correlation_id¶
- params¶
- price¶
- series_id¶
- ts_init¶
- class PluginConfig¶
Bases:
objectConfiguration for one Rust-native plug-in instance loaded by a live node.
- config¶
- path¶
- sha256¶
- type_name¶
- class QueryAccount¶
Bases:
object- account_id¶
- causation_id¶
- client_id¶
- command_id¶
- correlation_id¶
- params¶
- trader_id¶
- ts_init¶
- class QueryOrder¶
Bases:
object- causation_id¶
- client_id¶
- client_order_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- strategy_id¶
- trader_id¶
- ts_init¶
- venue_order_id¶
- class QueueMonitorConfig¶
Bases:
objectConfiguration for runner queue pressure monitoring.
- mean_dispatch_ns_clear¶
- mean_dispatch_ns_trigger¶
- queue_depth_clear¶
- queue_depth_trigger¶
- class QuotesResponse¶
Bases:
objectAn owned QuotesResponse response.
- client_id¶
- correlation_id¶
- data¶
- end¶
- instrument_id¶
- params¶
- start¶
- ts_init¶
- class RequestBars¶
Bases:
objectAn owned RequestBars request.
- bar_type¶
- client_id¶
- end¶
- end_ns¶
- limit¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- class RequestBookDeltas¶
Bases:
objectAn owned RequestBookDeltas request.
- client_id¶
- end¶
- end_ns¶
- instrument_id¶
- limit¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- class RequestBookDepth¶
Bases:
objectAn owned RequestBookDepth request.
- client_id¶
- depth¶
- end¶
- end_ns¶
- instrument_id¶
- limit¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- class RequestBookSnapshot¶
Bases:
objectAn owned RequestBookSnapshot request.
- client_id¶
- depth¶
- instrument_id¶
- params¶
- request_id¶
- ts_init¶
- class RequestCustomData¶
Bases:
objectAn owned RequestCustomData request.
- client_id¶
- data_type¶
- end¶
- end_ns¶
- limit¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- class RequestFundingRates¶
Bases:
objectAn owned RequestFundingRates request.
- client_id¶
- end¶
- end_ns¶
- instrument_id¶
- limit¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- class RequestInstrument¶
Bases:
objectAn owned RequestInstrument request.
- client_id¶
- end¶
- end_ns¶
- instrument_id¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- class RequestInstruments¶
Bases:
objectAn owned RequestInstruments request.
- client_id¶
- end¶
- end_ns¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- venue¶
- class RequestOptionChainReferencePrice¶
Bases:
objectAn owned RequestOptionChainReferencePrice request.
- client_id¶
- instrument_id¶
- params¶
- request_id¶
- series_id¶
- ts_init¶
- class RequestQuotes¶
Bases:
objectAn owned RequestQuotes request.
- client_id¶
- end¶
- end_ns¶
- instrument_id¶
- limit¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- class RequestTrades¶
Bases:
objectAn owned RequestTrades request.
- client_id¶
- end¶
- end_ns¶
- instrument_id¶
- limit¶
- params¶
- request_id¶
- start¶
- start_ns¶
- ts_init¶
- class SubmissionRecoveryPolicy¶
Bases:
objectPolicy when recovery queries cannot establish a submission’s venue outcome.
This configuration is reserved for submission recovery. The runtime currently uses local resolution for both variants; retention is not implemented yet.
- RESOLVE_LOCALLY = SubmissionRecoveryPolicy.RESOLVE_LOCALLY¶
- RETAIN_UNRESOLVED = SubmissionRecoveryPolicy.RETAIN_UNRESOLVED¶
- class SubmitOrder¶
Bases:
object- causation_id¶
- client_id¶
- client_order_id¶
- command_id¶
- correlation_id¶
- exec_algorithm_id¶
- instrument_id¶
- order¶
- order_init¶
- params¶
- position_id¶
- strategy_id¶
- trader_id¶
- ts_init¶
- class SubmitOrderList¶
Bases:
object- causation_id¶
- client_id¶
- command_id¶
- correlation_id¶
- exec_algorithm_id¶
- instrument_id¶
- order_inits¶
- order_list¶
- params¶
- position_id¶
- strategy_id¶
- trader_id¶
- ts_init¶
- class SubscribeBars¶
Bases:
object- bar_type¶
- client_id¶
- command_id¶
- correlation_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeBookDeltas¶
Bases:
object- book_type¶
- client_id¶
- command_id¶
- correlation_id¶
- depth¶
- instrument_id¶
- managed¶
- params¶
- ts_init¶
- venue¶
- class SubscribeBookDepth¶
Bases:
object- book_type¶
- client_id¶
- command_id¶
- correlation_id¶
- depth¶
- instrument_id¶
- managed¶
- params¶
- ts_init¶
- venue¶
- class SubscribeCustomData¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- data_type¶
- params¶
- ts_init¶
- venue¶
- class SubscribeFundingRates¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeIndexPrices¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeInstrument¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeInstrumentClose¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeInstrumentStatus¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeInstruments¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeMarkPrices¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeOptionGreeks¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeQuotes¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class SubscribeTrades¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class TradesResponse¶
Bases:
objectAn owned TradesResponse response.
- client_id¶
- correlation_id¶
- data¶
- end¶
- instrument_id¶
- params¶
- start¶
- ts_init¶
- class UnsubscribeBars¶
Bases:
object- bar_type¶
- client_id¶
- command_id¶
- correlation_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeBookDeltas¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeBookDepth¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeCustomData¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- data_type¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeFundingRates¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeIndexPrices¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeInstrument¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeInstrumentClose¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeInstrumentStatus¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeInstruments¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeMarkPrices¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeOptionGreeks¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeQuotes¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
- class UnsubscribeTrades¶
Bases:
object- client_id¶
- command_id¶
- correlation_id¶
- instrument_id¶
- params¶
- ts_init¶
- venue¶
Python adapter clients¶
Override hooks are documented in the adapter interface. This API listing shows public methods; see the guide for ownership and migration rules.
Base classes for Python adapter clients and their factories.
- class DataClientFactory¶
Bases:
objectConstructs a data client without scheduling work or opening network resources.
- static create(*, name: str, config: DataClientConfig, cache: ClientCache, clock: Clock) DataClient¶
Construct a client using the owning node context.
- class DataClient¶
Bases:
_ClientAn adapter providing custom or instrument data through queued events.
- create_task(coroutine: Coroutine[object, object, object], name: str = 'background') Task[object]¶
Schedule and supervise a coroutine on the bound owner loop.
- property is_connected: bool¶
Return whether the connection hook completed before shutdown.
- class MarketDataClient¶
Bases:
DataClientA data client providing instrument market data.
- create_task(coroutine: Coroutine[object, object, object], name: str = 'background') Task[object]¶
Schedule and supervise a coroutine on the bound owner loop.
- property is_connected: bool¶
Return whether the connection hook completed before shutdown.
- class ExecutionClientFactory¶
Bases:
objectConstructs an execution client with the owning node’s identity and clock.
- static create(*, name: str, config: ExecutionClientConfig, cache: ClientCache, clock: Clock, trader_id: TraderId) ExecutionClient¶
Construct a client using the owning node context.
- class ExecutionClient¶
Bases:
_ClientAn execution adapter which emits account, order, and reconciliation events.
- generate_account_state(balances: list[AccountBalance], margins: list[MarginBalance], reported: bool, ts_event: int, info: dict[str, object] | None = None) None¶
Queue an account snapshot for core processing.
- generate_order_denied(order: object, reason: str) None¶
Queue the order denied event using the owning clock.
- generate_order_submitted(order: object) None¶
Queue the order submitted event using the owning clock.
- generate_order_rejected(order: object, reason: str, ts_event: int, due_post_only: bool) None¶
Queue the order rejected event using the owning clock.
- generate_order_accepted(order: object, venue_order_id: VenueOrderId, ts_event: int) None¶
Queue the order accepted event using the owning clock.
- generate_order_modify_rejected(order: object, venue_order_id: VenueOrderId | None, reason: str, ts_event: int) None¶
Queue the order modify rejected event using the owning clock.
- generate_order_cancel_rejected(order: object, venue_order_id: VenueOrderId | None, reason: str, ts_event: int) None¶
Queue the order cancel rejected event using the owning clock.
- generate_order_updated(order: object, venue_order_id: VenueOrderId, quantity: Quantity, price: Price | None, trigger_price: Price | None, protection_price: Price | None, ts_event: int) None¶
Queue the order updated event using the owning clock.
- generate_order_canceled(order: object, venue_order_id: VenueOrderId | None, ts_event: int) None¶
Queue the order canceled event using the owning clock.
- generate_order_triggered(order: object, venue_order_id: VenueOrderId | None, ts_event: int) None¶
Queue the order triggered event using the owning clock.
- generate_order_expired(order: object, venue_order_id: VenueOrderId | None, ts_event: int) None¶
Queue the order expired event using the owning clock.
- generate_order_filled(order: object, venue_order_id: VenueOrderId, venue_position_id: PositionId | None, trade_id: TradeId, last_qty: Quantity, last_px: Price, quote_currency: Currency, commission: Money | None, liquidity_side: LiquiditySide, ts_event: int) None¶
Queue the order filled event using the owning clock.
- create_task(coroutine: Coroutine[object, object, object], name: str = 'background') Task[object]¶
Schedule and supervise a coroutine on the bound owner loop.
- property is_connected: bool¶
Return whether the connection hook completed before shutdown.
Python instrument providers¶
Instrument loading and local storage for Python adapters.
- class InstrumentProvider¶
Bases:
objectLoads instrument definitions into adapter-local storage.
- property count: int¶
Return the number of locally stored instruments.
- async initialize(reload: bool = False) None¶
Load configured instruments once, retrying after a failed initialization.
- async load_all_async(filters: dict | None = None) None¶
Load all instruments matching the venue-specific filters.
- async load_ids_async(instrument_ids: list[InstrumentId], filters: dict | None = None) None¶
Load requested instruments and preserve previously loaded instruments.
- async load_async(instrument_id: InstrumentId, filters: dict | None = None) None¶
Load one instrument if it is not already present.
- load_all(filters: dict | None = None) Task[object] | None¶
Load instruments synchronously or schedule work through the owning client.
- load_ids(instrument_ids: list[InstrumentId], filters: dict | None = None) Task[object] | None¶
Load selected instruments synchronously or through the owning client.
- load(instrument_id: InstrumentId, filters: dict | None = None) Task[object] | None¶
Load one instrument synchronously or through the owning client.
- find(instrument_id: InstrumentId) object | None¶
Return a locally loaded instrument, or None.
- get_all() dict¶
Return a copy of the instrument mapping.
- list_all() list¶
Return the locally loaded instruments.
Importable adapter configuration¶
See ImportableConfig and ImportableFactoryConfig in the configuration API.