Subscribe Fill
Primary WebSocket channel for all market data and order management.
Subscribe to fill updates for an account, subaccount, and symbol (requires authentication, supports delegation)#
Primary WebSocket channel for all market data and order management.
Request to subscribe to fill updates (requires authentication, supports delegation)
Parameters
sourcestringMust be 'fill'
accountstringEthereum address of the account (must match authenticated user or user must be a delegate)
subaccount_indexintegerSubaccount index to subscribe to fills for
symbolsarrayArray of market symbols to filter fills (e.g., ['BTCUSD', 'ETHUSD']) or empty array [] for all markets
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "fill",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccount_index": 0,
"symbols": [
"ETHUSD"
]
},
"id": 8
}Generic success response for subscription requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Subscribed to trades"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 2
}Published each time a fill occurs for the subscribed account and subaccount. Includes realized PnL, exposure, and funding. Wrapped with type field to identify the message type.
Parameters
symbolstringMarket symbol for this fill
pricestringFill price as decimal string
quantitystringSigned quantity - positive indicates buy, negative indicates sell, as decimal string
timeintegerTimestamp when fill occurred in milliseconds
order_idstring64-character hex string identifying the order that was filled
realized_exposurestringRealized exposure from this fill as signed decimal string
realized_fundingstringRealized funding from this fill as signed decimal string
realized_pnlstringRealized PnL from this fill (exposure + funding - fees) as signed decimal string
{
"type": "Fill",
"data": {
"symbol": "ETHUSD",
"price": "2511.120000",
"quantity": "1.500000",
"time": 1751793781000,
"order_id": "a6e139432b47a2dece7734777fc6df8cab8a6a933daa26821c9185020f7f6a10",
"realized_exposure": "3766.680000",
"realized_funding": "0.000000",
"realized_pnl": "3766.680000"
}
}Error response for failed requests
Parameters
jsonrpcstringJSON-RPC version
errorobjectusInintegerRequest received timestamp in milliseconds
usOutintegerResponse sent timestamp in milliseconds
usDiffintegerProcessing time in milliseconds
id?string | integer | nullRequest identifier (if provided in request, otherwise null)
{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "Invalid subscription params"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 2
}