Skip to main content

API Reference

This page maps Python SDK methods to the underlying SignalR hub methods and payload models.

note

All SDK methods are async. The SDK raises MesoLiveApiException for any non-Success status code.

2.0 breaking change

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 SDKHub methodArgs modelNotes
get_idempotency_recordGetIdempotencyRecordGetIdempotencyRecordArgsRecover outcomes after unknown results
list_agentsListAgentsListAgentsArgsConnected providers/connectors
list_accountsListAccountsListAccountsArgsPaged; token is opaque
get_accountGetAccountGetAccountArgs
create_strategyCreateStrategyCreateStrategyArgsRequires StrategyDefinition payload
update_strategyUpdateStrategyUpdateStrategyArgs
rename_strategyRenameStrategyRenameStrategyArgs
delete_strategyDeleteStrategyDeleteStrategyArgs
list_strategiesListStrategiesListStrategiesArgsPaged
get_strategyGetStrategyGetStrategyArgs
list_positionsListPositionsListPositionsArgsSupports account/strategy/exec-plan filters plus default-position filters
get_positionGetPositionGetPositionArgsDetailed position view
list_legsListLegsListLegsArgsPaged
get_legGetLegGetLegArgs
get_legsGetLegsGetLegsArgsBatch get
start_prepare_position_entryStartPreparePositionEntryPreparePositionEntryArgsIdempotent; returns JobId
get_prepare_position_entry_statusGetPreparePositionEntryStatusGetPreparePositionEntryStatusArgsPoll job status
cancel_prepare_position_entryCancelPreparePositionEntryCancelPreparePositionEntryArgsIdempotent best-effort cancel
start_prepare_position_exitStartPreparePositionExitPreparePositionExitArgsIdempotent; returns JobId
get_prepare_position_exit_statusGetPreparePositionExitStatusGetPreparePositionExitStatusArgsPoll job status
cancel_prepare_position_exitCancelPreparePositionExitCancelPreparePositionExitArgsIdempotent best-effort cancel
start_prepare_position_adjustmentStartPreparePositionAdjustmentPreparePositionAdjustmentArgsIdempotent; returns JobId
get_prepare_position_adjustment_statusGetPreparePositionAdjustmentStatusGetPreparePositionAdjustmentStatusArgsPoll job status
cancel_prepare_position_adjustmentCancelPreparePositionAdjustmentCancelPreparePositionAdjustmentArgsIdempotent best-effort cancel
apply_paper_fillsApplyPaperFillsApplyPaperFillsArgsIdempotent; uses PaperLegFill.ExecPlanLegId; AddPosition/AddLegs QtyMultiplier may override before execution starts
get_execution_plan_fill_stateGetExecutionPlanFillStateGetExecutionPlanFillStateArgsPer-leg and per-group fill progress for a prepared execution plan
send_orderSendOrderSendOrderArgsIdempotent; LegGroupOrder.ExecPlanLegIds selects legs; AddPosition/AddLegs QtyMultiplier may override before execution starts
cancel_orderCancelOrderCancelOrderArgsIdempotent
get_orderGetOrderGetOrderArgs
list_ordersListOrdersListOrdersArgsPaged by ExecPlanId
list_executionsListExecutionsListExecutionsArgs
get_executionGetExecutionGetExecutionArgs
get_executionsGetExecutionsGetExecutionsArgsBatch get

Data Hub (/hubs/data/v1)

Data Hub SignalR reference: Data Hub

SDK client: mesolive_sdk.MesoLiveDataHubClient

Python SDKHub methodArgs modelReturns
stream_position_dataStreamPositionDataStreamPositionDataArgsAsyncIterator[PositionDataEntry]
get_position_snapshotGetPositionSnapshotGetPositionSnapshotArgsGetPositionSnapshotResult
stream_leg_dataStreamLegDataStreamLegDataArgsAsyncIterator[LegDataEntry]
get_leg_snapshotGetLegSnapshotGetLegSnapshotArgsGetLegSnapshotResult
stream_legs_dataStreamLegsDataStreamLegsDataArgsAsyncIterator[LegsDataEntry]
get_legs_snapshotGetLegsSnapshotGetLegsSnapshotArgsGetLegsSnapshotResult
stream_combo_contracts_dataStreamComboContractsDataStreamComboContractsDataArgsAsyncIterator[ComboContractsDataEntry]
get_combo_contracts_snapshotGetComboContractsSnapshotGetComboContractsSnapshotArgsGetComboContractsSnapshotResult
stream_contract_dataStreamContractDataStreamContractDataArgsAsyncIterator[ContractDataEntry]
get_contract_snapshotGetContractSnapshotGetContractSnapshotArgsGetContractSnapshotResult
stream_underlying_dataStreamUnderlyingDataStreamUnderlyingDataArgsAsyncIterator[UnderlyingDataEntry]
get_underlying_snapshotGetUnderlyingSnapshotGetUnderlyingSnapshotArgsGetUnderlyingSnapshotResult

Risk Graph Hub (/hubs/riskgraph/v1)

Risk Graph Hub SignalR reference: Risk Graph Hub

SDK client: mesolive_sdk.MesoLiveRiskGraphHubClient

Python SDKHub methodArgs modelReturns
stream_position_risk_graph_dataStreamPositionRiskGraphDataStreamPositionRiskGraphDataArgsAsyncIterator[PositionRiskGraphDataEntry]
get_position_risk_graph_snapshotGetPositionRiskGraphSnapshotGetPositionRiskGraphSnapshotArgsGetPositionRiskGraphSnapshotResult
stream_strategy_risk_graph_dataStreamStrategyRiskGraphDataStreamStrategyRiskGraphDataArgsAsyncIterator[StrategyRiskGraphDataEntry]
get_strategy_risk_graph_snapshotGetStrategyRiskGraphSnapshotGetStrategyRiskGraphSnapshotArgsGetStrategyRiskGraphSnapshotResult
stream_underlying_risk_graph_dataStreamUnderlyingRiskGraphDataStreamUnderlyingRiskGraphDataArgsAsyncIterator[UnderlyingRiskGraphDataEntry]
get_underlying_risk_graph_snapshotGetUnderlyingRiskGraphSnapshotGetUnderlyingRiskGraphSnapshotArgsGetUnderlyingRiskGraphSnapshotResult
stream_combo_contracts_risk_graph_dataStreamComboContractsRiskGraphDataStreamComboContractsRiskGraphDataArgsAsyncIterator[ComboContractsRiskGraphDataEntry]
get_combo_contracts_risk_graph_snapshotGetComboContractsRiskGraphSnapshotGetComboContractsRiskGraphSnapshotArgsGetComboContractsRiskGraphSnapshotResult

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 SDKHub methodArgs modelReturns
get_account_navGetAccountNavGetAccountNavArgsGetAccountNavResult
get_position_metricsGetPositionMetricsGetPositionMetricsArgsGetHistoricalMetricsResult
get_strategy_metricsGetStrategyMetricsGetStrategyMetricsArgsGetHistoricalMetricsResult
get_underlying_metricsGetUnderlyingMetricsGetUnderlyingMetricsArgsGetHistoricalMetricsResult
get_leg_metricsGetLegMetricsGetLegMetricsArgsGetHistoricalMetricsResult

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 SDKHub methodArgs modelReturns
subscribe_to_strategiesSubscribeToStrategiesSubscribeToStrategiesArgsSubscribeToStrategiesResult
unsubscribe_from_strategiesUnsubscribeFromStrategiesUnsubscribeFromStrategiesArgsUnsubscribeFromStrategiesResult
get_latest_event_seq_idGetLatestEventSeqIdGetLatestEventSeqIdArgsGetLatestEventSeqIdResult
get_events_sinceGetEventsSinceGetEventsSinceArgsGetEventsSinceResult

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.