API Reference
This page maps Python SDK methods to the underlying SignalR hub methods and payload models.
All SDK methods are async. The SDK raises MesoLiveApiException for any non-Success status code.
Control Hub now uses /hubs/control/v2. Prepared execution uses ExecPlanLegId for order and paper-fill identity. See Migrating to 2.0.
Control Hub (/hubs/control/v2)
Control Hub SignalR reference: Control Hub
SDK client: mesolive_sdk.MesoLiveControlHubClient
| Python SDK | Hub method | Args model | Notes |
|---|---|---|---|
get_idempotency_record | GetIdempotencyRecord | GetIdempotencyRecordArgs | Recover outcomes after unknown results |
list_agents | ListAgents | ListAgentsArgs | Connected providers/connectors |
list_accounts | ListAccounts | ListAccountsArgs | Paged; token is opaque |
get_account | GetAccount | GetAccountArgs | |
create_strategy | CreateStrategy | CreateStrategyArgs | Requires StrategyDefinition payload |
update_strategy | UpdateStrategy | UpdateStrategyArgs | |
rename_strategy | RenameStrategy | RenameStrategyArgs | |
delete_strategy | DeleteStrategy | DeleteStrategyArgs | |
list_strategies | ListStrategies | ListStrategiesArgs | Paged |
get_strategy | GetStrategy | GetStrategyArgs | |
list_positions | ListPositions | ListPositionsArgs | Supports account/strategy/exec-plan filters plus default-position filters |
get_position | GetPosition | GetPositionArgs | Detailed position view |
list_legs | ListLegs | ListLegsArgs | Paged |
get_leg | GetLeg | GetLegArgs | |
get_legs | GetLegs | GetLegsArgs | Batch get |
start_prepare_position_entry | StartPreparePositionEntry | PreparePositionEntryArgs | Idempotent; returns JobId |
get_prepare_position_entry_status | GetPreparePositionEntryStatus | GetPreparePositionEntryStatusArgs | Poll job status |
cancel_prepare_position_entry | CancelPreparePositionEntry | CancelPreparePositionEntryArgs | Idempotent best-effort cancel |
start_prepare_position_exit | StartPreparePositionExit | PreparePositionExitArgs | Idempotent; returns JobId |
get_prepare_position_exit_status | GetPreparePositionExitStatus | GetPreparePositionExitStatusArgs | Poll job status |
cancel_prepare_position_exit | CancelPreparePositionExit | CancelPreparePositionExitArgs | Idempotent best-effort cancel |
start_prepare_position_adjustment | StartPreparePositionAdjustment | PreparePositionAdjustmentArgs | Idempotent; returns JobId |
get_prepare_position_adjustment_status | GetPreparePositionAdjustmentStatus | GetPreparePositionAdjustmentStatusArgs | Poll job status |
cancel_prepare_position_adjustment | CancelPreparePositionAdjustment | CancelPreparePositionAdjustmentArgs | Idempotent best-effort cancel |
apply_paper_fills | ApplyPaperFills | ApplyPaperFillsArgs | Idempotent; uses PaperLegFill.ExecPlanLegId; AddPosition/AddLegs QtyMultiplier may override before execution starts |
get_execution_plan_fill_state | GetExecutionPlanFillState | GetExecutionPlanFillStateArgs | Per-leg and per-group fill progress for a prepared execution plan |
send_order | SendOrder | SendOrderArgs | Idempotent; LegGroupOrder.ExecPlanLegIds selects legs; AddPosition/AddLegs QtyMultiplier may override before execution starts |
cancel_order | CancelOrder | CancelOrderArgs | Idempotent |
get_order | GetOrder | GetOrderArgs | |
list_orders | ListOrders | ListOrdersArgs | Paged by ExecPlanId |
list_executions | ListExecutions | ListExecutionsArgs | |
get_execution | GetExecution | GetExecutionArgs | |
get_executions | GetExecutions | GetExecutionsArgs | Batch get |
Data Hub (/hubs/data/v1)
Data Hub SignalR reference: Data Hub
SDK client: mesolive_sdk.MesoLiveDataHubClient
| Python SDK | Hub method | Args model | Returns |
|---|---|---|---|
stream_position_data | StreamPositionData | StreamPositionDataArgs | AsyncIterator[PositionDataEntry] |
get_position_snapshot | GetPositionSnapshot | GetPositionSnapshotArgs | GetPositionSnapshotResult |
stream_leg_data | StreamLegData | StreamLegDataArgs | AsyncIterator[LegDataEntry] |
get_leg_snapshot | GetLegSnapshot | GetLegSnapshotArgs | GetLegSnapshotResult |
stream_legs_data | StreamLegsData | StreamLegsDataArgs | AsyncIterator[LegsDataEntry] |
get_legs_snapshot | GetLegsSnapshot | GetLegsSnapshotArgs | GetLegsSnapshotResult |
stream_combo_contracts_data | StreamComboContractsData | StreamComboContractsDataArgs | AsyncIterator[ComboContractsDataEntry] |
get_combo_contracts_snapshot | GetComboContractsSnapshot | GetComboContractsSnapshotArgs | GetComboContractsSnapshotResult |
stream_contract_data | StreamContractData | StreamContractDataArgs | AsyncIterator[ContractDataEntry] |
get_contract_snapshot | GetContractSnapshot | GetContractSnapshotArgs | GetContractSnapshotResult |
stream_underlying_data | StreamUnderlyingData | StreamUnderlyingDataArgs | AsyncIterator[UnderlyingDataEntry] |
get_underlying_snapshot | GetUnderlyingSnapshot | GetUnderlyingSnapshotArgs | GetUnderlyingSnapshotResult |
Risk Graph Hub (/hubs/riskgraph/v1)
Risk Graph Hub SignalR reference: Risk Graph Hub
SDK client: mesolive_sdk.MesoLiveRiskGraphHubClient
| Python SDK | Hub method | Args model | Returns |
|---|---|---|---|
stream_position_risk_graph_data | StreamPositionRiskGraphData | StreamPositionRiskGraphDataArgs | AsyncIterator[PositionRiskGraphDataEntry] |
get_position_risk_graph_snapshot | GetPositionRiskGraphSnapshot | GetPositionRiskGraphSnapshotArgs | GetPositionRiskGraphSnapshotResult |
stream_strategy_risk_graph_data | StreamStrategyRiskGraphData | StreamStrategyRiskGraphDataArgs | AsyncIterator[StrategyRiskGraphDataEntry] |
get_strategy_risk_graph_snapshot | GetStrategyRiskGraphSnapshot | GetStrategyRiskGraphSnapshotArgs | GetStrategyRiskGraphSnapshotResult |
stream_underlying_risk_graph_data | StreamUnderlyingRiskGraphData | StreamUnderlyingRiskGraphDataArgs | AsyncIterator[UnderlyingRiskGraphDataEntry] |
get_underlying_risk_graph_snapshot | GetUnderlyingRiskGraphSnapshot | GetUnderlyingRiskGraphSnapshotArgs | GetUnderlyingRiskGraphSnapshotResult |
stream_combo_contracts_risk_graph_data | StreamComboContractsRiskGraphData | StreamComboContractsRiskGraphDataArgs | AsyncIterator[ComboContractsRiskGraphDataEntry] |
get_combo_contracts_risk_graph_snapshot | GetComboContractsRiskGraphSnapshot | GetComboContractsRiskGraphSnapshotArgs | GetComboContractsRiskGraphSnapshotResult |
Decode RiskGraphPayload with mesolive_sdk.risk_graph.decode_risk_graph_payload or decode_risk_graph_data.
The runnable risk_graph_example can render decoded snapshots or finite streams as Plotly HTML with --plot-html.
Historical Data Hub (/hubs/historicaldata/v1)
Historical Data Hub SignalR reference: Historical Data Hub
SDK client: mesolive_sdk.MesoLiveHistoricalDataHubClient
| Python SDK | Hub method | Args model | Returns |
|---|---|---|---|
get_account_nav | GetAccountNav | GetAccountNavArgs | GetAccountNavResult |
get_position_metrics | GetPositionMetrics | GetPositionMetricsArgs | GetHistoricalMetricsResult |
get_strategy_metrics | GetStrategyMetrics | GetStrategyMetricsArgs | GetHistoricalMetricsResult |
get_underlying_metrics | GetUnderlyingMetrics | GetUnderlyingMetricsArgs | GetHistoricalMetricsResult |
get_leg_metrics | GetLegMetrics | GetLegMetricsArgs | GetHistoricalMetricsResult |
Decode HistoricalDataPayload with mesolive_sdk.historical_data.decode_account_nav_payload or decode_metric_payload.
The runnable historical_data_example can render decoded account NAV and metric pages as Plotly HTML with --plot-html.
Event Hub (/hubs/event/v1)
Event Hub SignalR reference: Event Hub
SDK client: mesolive_sdk.MesoLiveEventHubClient
| Python SDK | Hub method | Args model | Returns |
|---|---|---|---|
subscribe_to_strategies | SubscribeToStrategies | SubscribeToStrategiesArgs | SubscribeToStrategiesResult |
unsubscribe_from_strategies | UnsubscribeFromStrategies | UnsubscribeFromStrategiesArgs | UnsubscribeFromStrategiesResult |
get_latest_event_seq_id | GetLatestEventSeqId | GetLatestEventSeqIdArgs | GetLatestEventSeqIdResult |
get_events_since | GetEventsSince | GetEventsSinceArgs | GetEventsSinceResult |
Server-to-client callbacks are registered with on_entry_signal, on_exit_signal, on_adjustment_signal, on_order_update, on_position_update, on_leg_update, on_agent_status_change, on_error, and the preparation completion/failure callback helpers.