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., ['BTC-USD-PERP', 'ETH-USD-PERP', 'SOL-USD-PERP']) or empty array [] for all markets
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "trade",
"symbols": [
"ETH-USD-PERP"
]
},
"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": "BTC-USD-PERP",
"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
tickSize?numberOptional 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 base tick size if not specified.
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "book",
"symbol": "SOL-USD-PERP",
"tickSize": 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
feedIdstringFeed ID as a fixed 32-byte hex string (preserves leading zeros)
tickSizeintegerPrice tick size used for aggregation as raw u64 value
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
sequenceNumberintegerMonotonic sequence number for this feed's order updates
{
"type": "Book Snapshot",
"data": {
"feedId": "0x0000000000000000000000000000000000000000000000000000000000000001",
"tickSize": 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,
"sequenceNumber": 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., ['BTC-USD-PERP', 'ETH-USD-PERP']) or empty array [] for all markets
intervalstringCandle interval - accepts either string format or seconds
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "candle",
"symbols": [
"ETH-USD-PERP"
],
"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
fundingRatestringFunding rate for the candle period as signed decimal string
{
"type": "Candle Update",
"data": {
"symbol": "ETH-USD-PERP",
"open": "2498.123470",
"high": "2532.678942",
"low": "2487.234511",
"close": "2517.982130",
"volume": "987.543290",
"time": 1751932800000,
"fundingRate": "0.000125"
}
}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 price updates for one or more symbols#
Subscribe to real-time price updates for specified symbols. When subscribing to all symbols (empty symbols array), updates are batched at the configured throttle interval (`ws_price_update_throttle_interval_ms`). At each interval, the handler sends the latest price update for each symbol that has changed since the last batch. CASH_ASSET and CASH_DEBT feeds are excluded from price subscriptions as they are internal system feeds.
Request to subscribe to price updates
Parameters
sourcestringMust be 'price'
symbolsarrayArray of market symbols for which price data is desired (e.g., ['BTC-USD-PERP', 'ETH-USD-PERP']) or empty array [] for all markets. CASH_ASSET and CASH_DEBT feeds are excluded from subscriptions.
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "price",
"symbols": [
"BTC-USD-PERP",
"ETH-USD-PERP"
]
},
"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 on subscription with initial snapshots for all subscribed symbols, then updates as prices change. When subscribing to all symbols (empty symbols array), updates are batched at the configured throttle interval. At each interval, the handler sends the latest price update for each symbol that has changed since the last batch. CASH_ASSET and CASH_DEBT feeds are excluded from price subscriptions. Wrapped with type field to identify the message type.
Parameters
symbolstringMarket symbol for this price
bestBidstringBest bid price from order book as decimal string
midpointstringMidpoint price (average of best bid and best offer) as decimal string
bestOfferstringBest offer (ask) price from order book as decimal string
markstringDerived fair mark price used for execution and risk checks
indexstringReference index price (spot/EMA fallback) used for deviation and funding basis
timeintegerTimestamp when price was last updated in milliseconds
{
"type": "Price Snapshot",
"data": {
"symbol": "BTC-USD-PERP",
"bestBid": "105998.25",
"midpoint": "106001.125",
"bestOffer": "106004.00",
"mark": "106001.50",
"index": "106000.50",
"time": 1752798506000
}
}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 summary updates for one or more symbols#
Subscribe to real-time market summary updates (24h volume, open interest, funding rate, best bid/offer, etc.) for specified symbols. When subscribing to all symbols (empty symbols array), updates are batched at the same throttle interval as price (`ws_price_update_throttle_interval_ms`). CASH_ASSET and CASH_DEBT feeds are excluded.
Request to subscribe to summary updates
Parameters
sourcestringMust be 'summary'
symbolsarrayArray of market symbols for which summary data is desired (e.g. ['BTC-USD-PERP', 'ETH-USD-PERP']) or empty array [] for all markets. CASH_ASSET and CASH_DEBT feeds are excluded.
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "summary",
"symbols": [
"BTC-USD-PERP",
"ETH-USD-PERP"
]
},
"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 on subscription with initial snapshots for all subscribed symbols, then updates as feed/summary data changes. When subscribing to all symbols (empty symbols array), updates are batched at the same throttle interval as price. CASH_ASSET and CASH_DEBT feeds are excluded. Wrapped with type field to identify the message type.
Parameters
symbolstringMarket symbol for this summary
bestBidobjectbestOfferobjectprice24hAgostringMark price 24 hours ago (UFixed6 decimal string); empty when unavailable
fundingRatestringFunding rate as decimal string (positive = longs pay shorts, negative = shorts pay longs)
openIntereststringOpen interest for the market as decimal string
volumestringTrading activity in the past 24 hours as decimal string
timeintegerTimestamp of this snapshot in milliseconds
{
"type": "Summary Snapshot",
"data": {
"symbol": "ETH-USD-PERP",
"bestBid": {
"price": "3660.02",
"quantity": "0.12"
},
"bestOffer": {
"price": "3660.13",
"quantity": "0.075"
},
"price24hAgo": "3587.5",
"fundingRate": "-0.00032",
"openInterest": "1508712.3429",
"volume": "387267.23",
"time": 1752798506000
}
}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, supports delegation)#
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 or user must be a delegate)
subaccountIndicesarrayArray of subaccount indices. - Empty array []: Subscribes to ALL subaccounts (owner only - delegation not allowed) - Non-empty array: Subscribes to the 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": "position",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndices": []
},
"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
subaccountIndexintegerSubaccount index
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
upnlstringUnrealized profit and loss for this position as signed decimal string
updatedAtintegerTimestamp when position was last updated in milliseconds
{
"type": "Position",
"data": {
"account": "0xc2cbbb5bea8fdefb1f441feaf017a0df72e89c9f",
"subaccountIndex": 0,
"symbol": "ETH-USD-PERP",
"quantity": "1.5",
"basis": "3720.226",
"fees": "1.323667",
"funding": "87.382478",
"margin": "558.621108",
"upnl": "125.50",
"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, supports delegation)#
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 or user must be a delegate)
symbolsarrayArray of market symbols to filter orders (e.g., ['BTC-USD-PERP', 'ETH-USD-PERP']) or empty array [] for all markets
orderType?stringOptional order 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. Defaults to ALL if not specified.
subaccountIndicesarrayArray of subaccount indices. - Empty array []: Subscribes to ALL subaccounts (owner only - delegation not allowed) - Non-empty array: Subscribes to the 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": "order",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"symbols": [
"BTC-USD-PERP"
],
"orderType": "Limit",
"subaccountIndices": []
},
"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
subaccountIndexintegerSubaccount index
orderIdstringUnique 64-character hex identifier for this order
clientIdstringClient-provided identifier (empty string if not provided)
groupIdstringAssigned to conditional orders created in batch (such as TWAP). "0" means the order is not part of a group
orderTypestringDisambiguates regular limit orders from conditional orders
quantitystringSigned decimal string - positive for long/buy, negative for short/sell
expiresAtintegerOrder expiration timestamp in milliseconds
symbolstringMarket symbol
nonceintegerOrder nonce
lastUpdateSequenceNumberintegerLast update sequence number for the order
pricestringLimit price as decimal string
flagsobjectoriginatorstringAddress to whom the originator fee shall be awarded (may be zero address)
originatorFeeintegerAdditional priority fee to be paid to the originator (may be zero)
period?integerFor TWAP orders only, the time interval in milliseconds between submission of orders
triggerPrice?stringFor TakeProfit and StopLoss orders only, the price at which the order is activated
trailingPercent?stringFor TrailingStop orders only, the percentage by which the trigger price follows the market price
parentOrderId?stringOptional for TakeProfit and StopLoss orders, enables this order upon execution of the specified parent
statusstringOrder status: new (just submitted), open (active on order book), scheduled (conditional order scheduled for submission), submitted (conditional order triggered and submitted), filled (completely filled), pendingCancel (cancellation requested but not yet processed), 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)
reason?stringOptional text field giving reason for rejection or cancellation
{
"type": "Order",
"data": {
"account": "0xc2cbbb5bea8fdefb1f441feaf017a0df72e89c9f",
"subaccountIndex": 0,
"orderId": "a6e139432b47a2dece7734777fc6df8cab8a6a933daa26821c9185020f7f6a10",
"clientId": "20250709-3481323",
"groupId": "0",
"orderType": "limit",
"quantity": "-0.5",
"expiresAt": 1968707400000,
"symbol": "BTC-USD-PERP",
"nonce": 388,
"lastUpdateSequenceNumber": 12345,
"price": "109912.25",
"flags": {
"reduceOnly": false,
"postOnly": true,
"ioc": false,
"selfTradeExpire": null
},
"originator": "0x0000000000000000000000000000000000000000",
"originatorFee": 0,
"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)
subaccountIndexintegerSubaccount index to subscribe to fills for
symbolsarrayArray of market symbols to filter fills (e.g., ['BTC-USD-PERP', 'ETH-USD-PERP']) or empty array [] for all markets
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "fill",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndex": 0,
"symbols": [
"ETH-USD-PERP"
]
},
"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
orderIdstring64-character hex string identifying the order that was filled
realizedExposurestringRealized exposure from this fill as signed decimal string
realizedFundingstringRealized funding from this fill as signed decimal string
realizedPnlstringRealized PnL from this fill (exposure + funding - fees) as signed decimal string
{
"type": "Fill",
"data": {
"symbol": "ETH-USD-PERP",
"price": "2511.120000",
"quantity": "1.500000",
"time": 1751793781000,
"orderId": "a6e139432b47a2dece7734777fc6df8cab8a6a933daa26821c9185020f7f6a10",
"realizedExposure": "3766.680000",
"realizedFunding": "0.000000",
"realizedPnl": "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
}Subscribe to account stats (requires authentication, supports delegation)#
Subscribe to account statistics (UPnL, cross leverage, maintenance margin, account value, free collateral, etc.). Updates are published at a fixed interval (every 5 seconds). Supports delegation - users can subscribe to accounts they are delegated to access.
Request to subscribe to account stats (requires authentication, supports delegation)
Parameters
sourcestringMust be 'stats'
accountstringEthereum address of the account (must match authenticated user or user must be a delegate)
subaccountIndicesarrayArray of subaccount indices. - Empty array []: Subscribes to ALL subaccounts (owner only - delegation not allowed) - Non-empty array: Subscribes to the 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": "stats",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndices": [
0
]
},
"id": 10
}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 at a fixed interval (every 5 seconds) for the subscribed account and subaccount. Contains UPnL, cross leverage, maintenance margin, account value, free collateral, etc. Wrapped with type field to identify the message type.
Parameters
accountstringEthereum address of the account
subaccountIndexintegerSubaccount index
upnlstringTotal unrealized profit and loss across all positions
crossLeveragestringCross-margin leverage (cross notional / cross account equity)
crossMarginUsagestringCross-margin usage (cross initial margin requirement / cross account equity)
maintMarginstringTotal maintenance margin requirement across all positions
crossMarginRatiostringCross-margin ratio (cross account equity / cross maintenance margin requirement)
accountValuestringAccount value (balance + cross UPnL)
initialMarginRequirementstringTotal initial margin requirement for all positions and orders
freeCollateralstringAmount available for withdrawals
{
"type": "Stats",
"data": {
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndex": 0,
"upnl": "1234.567",
"crossLeverage": "2.5",
"crossMarginUsage": "0.38",
"maintMargin": "5000.123",
"crossMarginRatio": "0.4",
"accountValue": "10000.0",
"initialMarginRequirement": "5100.0",
"freeCollateral": "4500.0"
}
}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": "ETH-USD-PERP",
"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. Provide either orderId or both clientId and account (required if orderId is not provided).
Request to cancel an existing order (requires authentication)
Parameters
typestringMust be 'order'
orderId?stringIdentifies the order to be cancelled.
clientId?stringIdentifies the order to be cancelled, required if orderId is not provided.
account?stringIdentifies the account which owns the order to be cancelled, required with clientId.
{
"jsonrpc": "2.0",
"method": "cancel",
"params": {
"type": "order",
"orderId": "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
}Cancel a batch of orders (requires authentication)#
Uses the 'cancel' method with type 'batchOrders' to cancel multiple orders in one request. Provide either orderIds or both account and clientIds (required together). Cannot mix orderIds with account/clientIds.
Request to cancel a batch of orders (requires authentication)
Parameters
jsonrpcstringJSON-RPC version, must be '2.0'
methodstringMust be 'cancel'
paramsobject | objectProvide either orderIds or both account and clientIds. Cannot mix.
id?string | integer | nullOptional request identifier for matching responses (string, number, or null per JSON-RPC 2.0)
{
"jsonrpc": "2.0",
"method": "cancel",
"params": {
"type": "batchOrders",
"orderIds": [
"a6e139432b47a2dece7734777fc6df8cab8a6a933daa26821c9185020f7f6a10",
"b5cb9b814027f12334d1e02dec61a73f6ca1eab01049060c366f2d3ced11e0dd"
]
},
"id": 10
}Success response for batch cancel order requests
Parameters
message?stringSuccess message
{
"jsonrpc": "2.0",
"result": {
"message": "Batch orders cancelled successfully: 3 orders"
},
"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
}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": "ETH-USD-PERP",
"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": "ETH-USD-PERP",
"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": [
"ETH-USD-PERP"
]
},
"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
tickSize?numberOptional tick size (must match subscription if provided)
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "book",
"symbol": "SOL-USD-PERP",
"tickSize": 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": [
"BTC-USD-PERP"
],
"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 price updates#
Stops receiving price updates for the specified symbols
Request to unsubscribe from price updates
Parameters
sourcestringMust be 'price'
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": "price",
"symbols": [
"BTC-USD-PERP",
"ETH-USD-PERP"
]
},
"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 summary updates#
Stops receiving summary updates for the specified symbols
Request to unsubscribe from summary updates
Parameters
sourcestringMust be 'summary'
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": "summary",
"symbols": [
"BTC-USD-PERP",
"ETH-USD-PERP"
]
},
"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
}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 subscription)
subaccountIndicesarrayArray of subaccount indices. Must match the subscription (same indices; order does not matter). Use [] if unsubscribing from an "all subaccounts" subscription.
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "position",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndices": []
},
"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 subscription)
symbolsarrayArray of market symbols to unsubscribe from (must match the symbols used when subscribing) or empty array [] for all markets
orderType?stringOptional order type to match subscription - must match the orderType used when subscribing. Defaults to ALL if not specified.
subaccountIndicesarrayArray of subaccount indices. Must match the subscription (same indices; order does not matter). Use [] if unsubscribing from an "all subaccounts" subscription.
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "order",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"symbols": [
"BTC-USD-PERP"
],
"orderType": "Limit",
"subaccountIndices": []
},
"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)
subaccountIndexintegerSubaccount 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",
"subaccountIndex": 0,
"symbols": [
"ETH-USD-PERP"
]
},
"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
}Unsubscribe from stats updates (requires authentication)#
Stops receiving stats updates for the specified account and subaccount
Request to unsubscribe from stats updates
Parameters
sourcestringMust be 'stats'
accountstringEthereum address of the account (must match subscription)
subaccountIndicesarrayArray of subaccount indices. Must match the subscription (same indices; order does not matter). Use [] if unsubscribing from an "all subaccounts" subscription.
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "stats",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndices": [
0
]
},
"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 account transfer updates (requires authentication, supports delegation)#
Subscribe to real-time account transfer updates (deposits, withdrawals, transfers, fees, etc.) for GET account/transfers. Uses the Spacetime account_transfers table. Requires account and subaccount index.
Request to subscribe to account transfer updates (requires authentication, supports delegation)
Parameters
sourcestringMust be 'transfer'
accountstringEthereum address of the account (must match authenticated user or user must be a delegate)
subaccountIndexintegerSubaccount index to subscribe to transfer updates for
{
"jsonrpc": "2.0",
"method": "subscribe",
"params": {
"source": "transfer",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndex": 0
},
"id": 11
}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
}Real-time notification for a new account transfer (deposit, withdrawal, transfer, fee, etc.). Same shape as GET /account/transfers items. Wrapped with type field to identify the message type.
Parameters
transferTypestringamountstringSigned amount (positive = credit, negative = debit), fixed-point string
accountstringAccount address (hex)
subaccountIndexintegerSubaccount index
counterpartyAccountstringCounterparty account (zero address for external flows)
counterpartySubaccountIndexintegerCounterparty subaccount index
timestampMillisintegerBlock timestamp in milliseconds since Unix epoch
symbolstringMarket symbol (e.g. ETH-USD-PERP)
{
"type": "Transfer",
"data": {
"transferType": "Deposit",
"amount": "1000.000000",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndex": 0,
"counterpartyAccount": "0x0000000000000000000000000000000000000000",
"counterpartySubaccountIndex": 0,
"timestampMillis": 1752846925000,
"symbol": "ETH-USD-PERP"
}
}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 transfer updates (requires authentication)#
Stops receiving transfer updates for the specified account
Request to unsubscribe from transfer updates
Parameters
sourcestringMust be 'transfer'
accountstringEthereum address of the account (must match subscription)
subaccountIndexintegerSubaccount index (must match subscription)
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "transfer",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndex": 0
},
"id": 19
}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)
subaccountIndicesarrayArray of subaccount indices. - Empty array []: Subscribes to ALL subaccounts (owner only - delegation not allowed) - Non-empty array: Subscribes to the 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",
"subaccountIndices": []
},
"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
subaccountIndexintegerSubaccount index
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)
subaccountIndicesarrayArray of subaccount indices. Must match the subscription (same indices; order does not matter). Use [] if unsubscribing from an "all subaccounts" subscription.
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": {
"source": "balance",
"account": "0xe1c03ec3bcf509b3e8e63abcd03edc661ffe6a78",
"subaccountIndices": []
},
"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
}