Skip to main content

query.subscription.list

List active subscriptions.

Method

query.subscription.list

Description

Returns a list of active data subscriptions for the current user. Subscriptions include market data (order books) and trading account updates.

Parameters

FieldTypeRequiredDescription
tradingAccountIdstringNoFilter by trading account
instrumentIdstringNoFilter by instrument
limitintegerNoMaximum results (default: 100)
offsetintegerNoPagination offset
cursorstringNoPagination cursor

Result

Returns an array of subscription objects.

Subscription Object

FieldTypeDescription
subscriptionIdstringUnique subscription identifier
typestringSubscription type (ORDER_BOOK, TRADING_ACCOUNT)
channelstringCentrifugo channel name
instrumentIdstringInstrument (for market subscriptions)
tradingAccountIdstringAccount (for trading subscriptions)
statusstringSubscription status
createdAtintegerCreation timestamp (ms)

Subscription Status Values

StatusDescription
ACTIVESubscription is active
PENDINGSubscription is being set up
TERMINATEDSubscription has ended

Usage

# List all subscriptions
result = await client.rpc("query.subscription.list", {})

# List subscriptions for a specific account
result = await client.rpc("query.subscription.list", {
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000"
})

Example Response

{
"data": [
{
"subscriptionId": "sub-001",
"type": "ORDER_BOOK",
"channel": "market:orderBook:BINANCE:BTC/USDT",
"instrumentId": "BINANCE:BTC/USDT",
"status": "ACTIVE",
"createdAt": 1703052635110
},
{
"subscriptionId": "sub-002",
"type": "TRADING_ACCOUNT",
"channel": "tradingAccount:550e8400-e29b-41d4-a716-446655440000",
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"status": "ACTIVE",
"createdAt": 1703052635110
}
],
"pagination": {
"offset": 0,
"limit": 100,
"total": 5
}
}