Operations
All WebSocket request and reply payloads grouped by operation.
Authenticate the WebSocket connection#
Must be called before accessing protected subscriptions (position, order, createorder, cancelorder)
Authenticate the WebSocket connection with JWT token
Parameters
bearerstringJWT authentication token
{
"jsonrpc": "2.0",
"method": "auth",
"params": {
"bearer": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9..."
},
"id": 1
}Authentication success response
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Authenticated successfully"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 1
}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
}Subscribe to trade/fill notifications for a symbol#
Primary WebSocket channel for all market data and order management.
Request to subscribe to trade/fill notifications
Parameters
sourcestringMust be 'trade'
symbolsarrayArray of market symbols to subscribe to (e.g., ['BTCUSD', 'ETHUSD', 'SOLUSD']) or empty array [] for all markets
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "trade",
"symbols": [
"ETHUSD"
]
},
"id": 2
}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 in the specified market. 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
{
"type": "Trade",
"data": {
"symbol": "BTCUSD",
"price": "106012.450000",
"quantity": "0.050000",
"time": 1751793781000
}
}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
}Subscribe to order book updates at specified precision#
Primary WebSocket channel for all market data and order management.
Request to subscribe to order book updates
Parameters
sourcestringMust be 'book'
symbolstringMarket symbol for which order book data is desired
tick_sizenumberOptional price tick size for order aggregation (e.g., 0.01, 0.02, 0.05). Must be base_tick_size * multiplier (1x, 2x, 5x, 10x, 100x, 1000x). Defaults to 0.01 if not specified.
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "book",
"symbol": "SOLUSD",
"tick_size": 0.01
},
"id": 3
}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 on subscription with initial snapshot, then delta updates on changes. Wrapped with type field to identify the message type.
Parameters
symbolstringMarket symbol for this book
feed_idstringInternal feed identifier
tick_sizestringPrice tick size used for aggregation in UFixed6 format (e.g., "10000" = 0.01)
bidsarrayFor snapshots: All buy orders sorted by price descending. For deltas: Changed buy orders (quantity 0 means removed).
asksarrayFor snapshots: All sell orders sorted by price ascending. For deltas: Changed sell orders (quantity 0 means removed).
timeintegerTimestamp in milliseconds
sequence_numberintegerMonotonic sequence number for this feed's order updates
{
"type": "Book Snapshot",
"data": {
"symbol": "SOLUSD",
"feed_id": "1",
"tick_size": "10000",
"bids": [
{
"price": "150.371000",
"quantity": "0.581222"
},
{
"price": "150.370000",
"quantity": "0.250000"
}
],
"asks": [
{
"price": "150.372000",
"quantity": "0.450000"
},
{
"price": "150.373000",
"quantity": "0.333334"
}
],
"time": 1752798506000,
"sequence_number": 12345
}
}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
}Subscribe to OHLCV candle data at specified interval#
Primary WebSocket channel for all market data and order management.
Request to subscribe to OHLCV candle data
Parameters
sourcestringMust be 'candle'
symbolsarrayArray of market symbols for which OHLCV data is desired (e.g., ['BTCUSD', 'ETHUSD']) or empty array [] for all markets
intervalstringCandle interval - accepts either string format or seconds
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "candle",
"symbols": [
"ETHUSD"
],
"interval": "1m"
},
"id": 4
}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 once per interval for the subscribed symbol and interval. Wrapped with type field to identify the message type.
Parameters
symbolstringMarket symbol for this candle
openstringOpening price as decimal string
highstringHighest price during the candle period as decimal string
lowstringLowest price during the candle period as decimal string
closestringClosing price as decimal string
volumestringTotal volume traded during the candle period as decimal string
timeintegerStarting timestamp of the candle period in milliseconds
{
"type": "Candle Update",
"data": {
"symbol": "ETHUSD",
"open": "2498.123470",
"high": "2532.678942",
"low": "2487.234511",
"close": "2517.982130",
"volume": "987.543290",
"time": 1751932800000
}
}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
}Subscribe to position updates for an account (requires authentication)#
Primary WebSocket channel for all market data and order management.
Request to subscribe to position updates (requires authentication)
Parameters
sourcestringMust be 'position'
accountstringEthereum address of the account (must match authenticated user)
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "position",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78"
},
"id": 5
}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 position is created or updated for the subscribed account. Wrapped with type field to identify the message type.
Parameters
accountstringEthereum address of the account
subaccountIndexstringSubaccount index as string
symbolstringMarket symbol for this position
quantitystringSigned decimal string - positive for long, negative for short
basisstringSigned notional cost basis as decimal string
feesstringAccumulated trade fees as unsigned decimal string
fundingstringAccumulated funding fees as signed decimal string
marginstringCollateral amount reserved for this position as unsigned decimal string
updatedAtintegerTimestamp when position was last updated in milliseconds
{
"type": "Position",
"data": {
"account": "0xc2cbbb5bea8fdefb1f441feaf017a0df72e89c9f",
"subaccountIndex": "0",
"symbol": "ETHUSD",
"quantity": "1.5",
"basis": "3720.226",
"fees": "1.323667",
"funding": "87.382478",
"margin": "558.621108",
"updatedAt": 1752846925000
}
}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
}Subscribe to order updates for an account, symbol, and order type (requires authentication)#
Primary WebSocket channel for all market data and order management.
Request to subscribe to order updates (requires authentication)
Parameters
sourcestringMust be 'order'
accountstringEthereum address of the account (must match authenticated user)
symbolsarrayArray of market symbols to filter orders (e.g., ['BTCUSD', 'ETHUSD']) or empty array [] for all markets
order_typestringOrder type to filter subscriptions - 'Limit' for limit orders, 'TWAP' for time-weighted average price orders, 'TakeProfit' for take profit orders, 'StopLoss' for stop loss orders, or 'ALL' for all order types
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "order",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"symbols": [
"BTCUSD"
],
"order_type": "Limit"
},
"id": 6
}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 an order is created, updated, filled, or cancelled for the subscribed account and symbol. Wrapped with type field to identify the message type.
Parameters
accountstringEthereum address of the account
orderIdstringUnique 64-character hex identifier for this order
clientIdstringClient-provided identifier (empty string if not provided)
quantitystringSigned decimal string - positive for long/buy, negative for short/sell
expiresAtintegerOrder expiration timestamp in milliseconds
symbolstringMarket symbol
subaccountIndexstringSubaccount index as string
nonceintegerOrder nonce
pricestringLimit price as decimal string
statusstringOrder status: new (just submitted), open (active), filled (completely filled), cancelled (user cancelled), expired (past expiration), rejected (validation failed)
remainingstringUnfilled quantity as unsigned decimal string
settledstringFilled quantity as unsigned decimal string
createdAt?integerTimestamp when order was created in milliseconds (null for new orders not yet processed)
updatedAt?integerTimestamp when order was last updated in milliseconds (null for new orders not yet processed)
{
"type": "Order",
"data": {
"account": "0xc2cbbb5bea8fdefb1f441feaf017a0df72e89c9f",
"orderId": "a6e139432b47a2dece7734777fc6df8cab8a6a933daa26821c9185020f7f6a10",
"clientId": "20250709-3481323",
"quantity": "-0.5",
"expiresAt": 1968707400000,
"symbol": "BTCUSD",
"subaccountIndex": "0",
"nonce": 388,
"price": "109912.25",
"status": "filled",
"remaining": "0",
"settled": "0.5",
"createdAt": 1720615381000,
"updatedAt": 1720620000000
}
}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
}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
}Create a new order (requires authentication)#
Uses the 'create' method with type 'order' to submit a new order to the matching engine
Request to create a new order (requires authentication)
Parameters
typestringMust be 'order'
orderobject{
"jsonrpc": "2.0",
"method": "create",
"params": {
"type": "order",
"order": {
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"clientId": "order-12345",
"orderType": "Limit",
"quantity": "1.5",
"expiresAt": 1968686299000,
"symbol": "ETHUSD",
"subaccountIndex": "0",
"nonce": 387,
"price": "2511.12",
"flags": {
"reduceOnly": false,
"postOnly": true,
"ioc": false,
"selfTradeExpire": null
},
"signatures": [
"0x587244e256b155471bbb11d69edc1f039205411bf29e39209c6862e87735beb2..."
],
"originator": "0x0000000000000000000000000000000000000000",
"originatorFee": 0
}
},
"id": 7
}Success response for create order requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Order with ID a6e139432b47a2dece7734777fc6df8cab8a6a933daa26821c9185020f7f6a10 created successfully"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 7
}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
}Cancel an existing order (requires authentication)#
Uses the 'cancel' method with type 'order' to cancel an existing order by its order ID
Request to cancel an existing order (requires authentication)
Parameters
typestringMust be 'order'
order_idstring64-character hex string identifying the order to cancel
{
"jsonrpc": "2.0",
"method": "cancel",
"params": {
"type": "order",
"order_id": "a6e139432b47a2dece7734777fc6df8cab8a6a933daa26821c9185020f7f6a10"
},
"id": 8
}Success response for cancel order requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Order cancelled successfully"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 8
}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
}Create a batch of orders (requires authentication)#
Uses the 'create' method with type 'batchOrders' to submit multiple orders to the matching engine. Supports batch Limit orders, TWAP orders and Iceberg orders All orders in the batch must have the same: - account - subaccountIndex - symbol - orderType - period (if applicable) - side (buy or sell) For TWAP orders, the quantity of each order should be set such that the sum equals the total desired quantity. TWAPs must specify a nonzero period (in milliseconds) between orders. For Iceberg orders, the quantity of each order should be set to the desired display quantity.
Request to create a batch of orders (requires authentication)
Parameters
typestringMust be 'batchOrders'
ordersarrayArray of orders to create. All orders must have the same: - account - subaccountIndex - symbol - orderType - period (if applicable) - side (buy or sell) For TWAP orders, period must be nonzero and the same for all orders.
{
"jsonrpc": "2.0",
"method": "create",
"params": {
"type": "batchOrders",
"orders": [
{
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"clientId": "batch-order-1",
"orderType": "Limit",
"quantity": "-1.5",
"expiresAt": 1968686299000,
"symbol": "ETHUSD",
"subaccountIndex": 0,
"nonce": 387,
"price": "2511.12",
"flags": {
"reduceOnly": false,
"postOnly": true,
"ioc": false
},
"signatures": [
"0x587244e256b155471bbb11d69edc1f039205411bf29e39209c6862e87735beb2..."
],
"originator": "0x0000000000000000000000000000000000000000",
"originatorFee": 0
},
{
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"clientId": "batch-order-2",
"orderType": "Limit",
"quantity": "-1.5",
"expiresAt": 1968686299000,
"symbol": "ETHUSD",
"subaccountIndex": 0,
"nonce": 388,
"price": "2515.00",
"flags": {
"reduceOnly": false,
"postOnly": true,
"ioc": false
},
"signatures": [
"0x9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b..."
],
"originator": "0x0000000000000000000000000000000000000000",
"originatorFee": 0
}
]
},
"id": 9
}Success response for batch create order requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Batch orders created successfully: 3 orders"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 9
}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
}Unsubscribe from trade notifications#
Stops receiving trade updates for the specified symbol
Request to unsubscribe from trade notifications
Parameters
sourcestringMust be 'trade'
symbolsarrayArray of market symbols to unsubscribe from (must match the symbols used when subscribing) or empty array [] for all markets
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "trade",
"symbols": [
"ETHUSD"
]
},
"id": 10
}Success response for unsubscribe requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Unsubscribed from channel"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 10
}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
}Unsubscribe from order book updates#
Stops receiving order book updates for the specified symbol
Request to unsubscribe from order book updates
Parameters
sourcestringMust be 'book'
symbolstringMarket symbol to unsubscribe from
tick_size?numberOptional tick size (must match subscription if provided)
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "book",
"symbol": "SOLUSD",
"tick_size": 0.01
},
"id": 11
}Success response for unsubscribe requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Unsubscribed from channel"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 10
}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
}Unsubscribe from candle data#
Stops receiving candle data for the specified symbol and interval
Request to unsubscribe from candle data
Parameters
sourcestringMust be 'candle'
symbolsarrayArray of market symbols to unsubscribe from (must match the symbols used when subscribing) or empty array [] for all markets
intervalstringCandle interval - accepts either string format or seconds
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "candle",
"symbols": [
"BTCUSD"
],
"interval": "1m"
},
"id": 12
}Success response for unsubscribe requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Unsubscribed from channel"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 10
}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
}Unsubscribe from position updates (requires authentication)#
Stops receiving position updates for the specified account
Request to unsubscribe from position updates
Parameters
sourcestringMust be 'position'
accountstringEthereum address of the account (must match authenticated user)
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "position",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78"
},
"id": 13
}Success response for unsubscribe requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Unsubscribed from channel"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 10
}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
}Unsubscribe from order updates (requires authentication)#
Stops receiving order updates for the specified account, symbol, and order type
Request to unsubscribe from order updates
Parameters
sourcestringMust be 'order'
accountstringEthereum address of the account (must match authenticated user)
symbolsarrayArray of market symbols to unsubscribe from (must match the symbols used when subscribing) or empty array [] for all markets
order_typestringOrder type to match subscription - must match the order_type used when subscribing
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "order",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"symbols": [
"BTCUSD"
],
"order_type": "Limit"
},
"id": 14
}Success response for unsubscribe requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Unsubscribed from channel"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 10
}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
}Unsubscribe from fill updates (requires authentication)#
Stops receiving fill updates for the specified account, subaccount, and symbol
Request to unsubscribe from fill updates
Parameters
sourcestringMust be 'fill'
accountstringEthereum address of the account (must match subscription)
subaccount_indexintegerSubaccount index (must match subscription)
symbolsarrayArray of market symbols to unsubscribe from (must match the symbols used when subscribing) or empty array [] for all markets
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "fill",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccount_index": 0,
"symbols": [
"ETHUSD"
]
},
"id": 18
}Success response for unsubscribe requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Unsubscribed from channel"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 10
}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
}Subscribe to balance updates for an account (requires authentication, supports delegation)#
Subscribe to real-time balance updates for owned or delegated accounts. Can subscribe to all subaccounts or a specific subaccount.
Request to subscribe to balance updates (requires authentication, supports delegation)
Parameters
sourcestringMust be 'balance'
accountstringEthereum address of the account (must match authenticated user or user must be a delegate)
subaccount_indices?arrayOptional array of subaccount indices. - If OMITTED or EMPTY: Subscribes to ALL subaccounts (owner only - delegation not allowed) - If PROVIDED: Subscribes to specified subaccounts (delegation allowed) For delegated access, delegation is checked for ALL specified subaccounts. Subscription fails if user lacks delegation for any subaccount in the array.
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "balance",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78"
},
"id": 7
}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 an account balance is created or updated for the subscribed account. Supports delegation - users can receive updates for accounts they are delegated to access. Wrapped with type field to identify the message type.
Parameters
accountstringEthereum address of the account
subaccountIndexstringSubaccount index as string
balancestringCurrent account balance as Fixed6 decimal string
updatedAtintegerTimestamp when balance was last updated in milliseconds
{
"type": "Balance Update",
"data": {
"account": "0xc2cbbb5bea8fdefb1f441feaf017a0df72e89c9f",
"subaccountIndex": "0",
"balance": "1000.500000",
"updatedAt": 1752846925000
}
}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
}Unsubscribe from balance updates (requires authentication)#
Stops receiving balance updates for the specified account
Request to unsubscribe from balance updates
Parameters
sourcestringMust be 'balance'
accountstringEthereum address of the account (must match subscription)
subaccount_indices?arrayOptional array of subaccount indices. Must match the subscription if provided (same order not required, but same indices).
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "balance",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78"
},
"id": 15
}Success response for unsubscribe requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Unsubscribed from channel"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 10
}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
}