SignalR Reference: Risk Graph Hub
Risk Graph Hub: position, strategy, underlying, and ad hoc combo Risk Graph snapshots and streams.
- Hub URL:
/hubs/riskgraph/v1
Snapshot methods return an API envelope (MesoLiveApiResponse<T>). Stream methods yield items until cancelled or disconnected.
Envelope fields: MesoLiveApiResponse
Risk Graph entries carry a compressed RiskGraphPayload. Decode Payload.Bytes according to Payload.Compression before reading RiskGraphData.
StreamPositionRiskGraphData
Stream Risk Graph updates for a position.
Args model: StreamPositionRiskGraphDataArgs
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
PositionId | int | Yes | No | Live position id to stream. | |
Options | RiskGraphQueryOptions | No | No | new() | Risk Graph query options. |
StreamOptions | RiskGraphStreamOptions | No | No | new() | Risk Graph stream timing options. |
Yields (stream): PositionRiskGraphDataEntry
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Payload | RiskGraphPayload | Yes | No | Compressed Risk Graph payload envelope. | |
Diagnostics | list[RiskGraphDiagnostic] | No | No | [] | Diagnostics exposed outside the compressed payload for clients that need status before decoding. |
GetPositionRiskGraphSnapshot
Get a point-in-time Risk Graph snapshot for a position.
Args model: GetPositionRiskGraphSnapshotArgs
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
PositionId | int | Yes | No | Live position id to snapshot. | |
Options | RiskGraphQueryOptions | No | No | new() | Risk Graph query options. |
Returns (payload): GetPositionRiskGraphSnapshotResult
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Payload | RiskGraphPayload | Yes | No | Compressed Risk Graph payload envelope. | |
Diagnostics | list[RiskGraphDiagnostic] | No | No | [] | Diagnostics exposed outside the compressed payload for clients that need status before decoding. |
StreamStrategyRiskGraphData
Stream Risk Graph updates for strategy exposure on one underlying.
Args model: StreamStrategyRiskGraphDataArgs
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
StrategyId | int | Yes | No | Live strategy id to stream. | |
UnderlyingId | int | Yes | No | Underlying live contract id within the strategy. | |
BrokerAccountIds | list[str] | No | Yes | Optional broker account ids to include. | |
Options | RiskGraphQueryOptions | No | No | new() | Risk Graph query options. |
StreamOptions | RiskGraphStreamOptions | No | No | new() | Risk Graph stream timing options. |
Yields (stream): StrategyRiskGraphDataEntry
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Payload | RiskGraphPayload | Yes | No | Compressed Risk Graph payload envelope. | |
Diagnostics | list[RiskGraphDiagnostic] | No | No | [] | Diagnostics exposed outside the compressed payload for clients that need status before decoding. |
GetStrategyRiskGraphSnapshot
Get a point-in-time Risk Graph snapshot for strategy exposure on one underlying.
Args model: GetStrategyRiskGraphSnapshotArgs
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
StrategyId | int | Yes | No | Live strategy id to snapshot. | |
UnderlyingId | int | Yes | No | Underlying live contract id within the strategy. | |
BrokerAccountIds | list[str] | No | Yes | Optional broker account ids to include. | |
Options | RiskGraphQueryOptions | No | No | new() | Risk Graph query options. |
Returns (payload): GetStrategyRiskGraphSnapshotResult
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Payload | RiskGraphPayload | Yes | No | Compressed Risk Graph payload envelope. | |
Diagnostics | list[RiskGraphDiagnostic] | No | No | [] | Diagnostics exposed outside the compressed payload for clients that need status before decoding. |
StreamUnderlyingRiskGraphData
Stream Risk Graph updates for default-position exposure on one underlying.
Args model: StreamUnderlyingRiskGraphDataArgs
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
UnderlyingId | int | Yes | No | Underlying live contract id to stream. | |
BrokerAccountIds | list[str] | No | Yes | Optional broker account ids to include. | |
Options | RiskGraphQueryOptions | No | No | new() | Risk Graph query options. |
StreamOptions | RiskGraphStreamOptions | No | No | new() | Risk Graph stream timing options. |
Yields (stream): UnderlyingRiskGraphDataEntry
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Payload | RiskGraphPayload | Yes | No | Compressed Risk Graph payload envelope. | |
Diagnostics | list[RiskGraphDiagnostic] | No | No | [] | Diagnostics exposed outside the compressed payload for clients that need status before decoding. |
GetUnderlyingRiskGraphSnapshot
Get a point-in-time Risk Graph snapshot for default-position exposure on one underlying.
Args model: GetUnderlyingRiskGraphSnapshotArgs
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
UnderlyingId | int | Yes | No | Underlying live contract id to snapshot. | |
BrokerAccountIds | list[str] | No | Yes | Optional broker account ids to include. | |
Options | RiskGraphQueryOptions | No | No | new() | Risk Graph query options. |
Returns (payload): GetUnderlyingRiskGraphSnapshotResult
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Payload | RiskGraphPayload | Yes | No | Compressed Risk Graph payload envelope. | |
Diagnostics | list[RiskGraphDiagnostic] | No | No | [] | Diagnostics exposed outside the compressed payload for clients that need status before decoding. |
StreamComboContractsRiskGraphData
Stream Risk Graph updates for caller-specified combo contracts.
Args model: StreamComboContractsRiskGraphDataArgs
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
ComboLegs | dict[str, ComboContractsRiskGraphLegSpec] | Yes | No | Combo legs keyed by caller-provided leg name. | |
RealizedPnlOffset | Decimal | No | No | 0m | Realized PnL offset included in aggregate PnL. |
Options | RiskGraphQueryOptions | No | No | new() | Risk Graph query options. |
StreamOptions | RiskGraphStreamOptions | No | No | new() | Risk Graph stream timing options. |
Yields (stream): ComboContractsRiskGraphDataEntry
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Payload | RiskGraphPayload | Yes | No | Compressed Risk Graph payload envelope. | |
Diagnostics | list[RiskGraphDiagnostic] | No | No | [] | Diagnostics exposed outside the compressed payload for clients that need status before decoding. |
GetComboContractsRiskGraphSnapshot
Get a point-in-time Risk Graph snapshot for caller-specified combo contracts.
Args model: GetComboContractsRiskGraphSnapshotArgs
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
ComboLegs | dict[str, ComboContractsRiskGraphLegSpec] | Yes | No | Combo legs keyed by caller-provided leg name. | |
RealizedPnlOffset | Decimal | No | No | 0m | Realized PnL offset included in aggregate PnL. |
Options | RiskGraphQueryOptions | No | No | new() | Risk Graph query options. |
Returns (payload): GetComboContractsRiskGraphSnapshotResult
| Field | Type | Required | Nullable | Default | Description |
|---|---|---|---|---|---|
Payload | RiskGraphPayload | Yes | No | Compressed Risk Graph payload envelope. | |
Diagnostics | list[RiskGraphDiagnostic] | No | No | [] | Diagnostics exposed outside the compressed payload for clients that need status before decoding. |