Skip to main content

INTX WebSocket Channels

INSTRUMENTS Channel

The INSTRUMENTS channel sends information about the tradable instruments. If product_ids is not specified, then updates to all instruments are returned.

// Request
{
"type": "SUBSCRIBE",
"product_ids": ["BTC-PERP", "ETH-PERP"],
"channels": [
"INSTRUMENTS"
],
"time": "1683730727",
"key": "key",
"passphrase": "passphrase",
"signature": "1BM6nwNBLHAkLLs81qcKEKAAPoYIzxTuDIX9DpE0/EM="
}
// Responses
{
"sequence": 0,
"product_id": "BTC-PERP",
"instrument_type": "PERP",
"base_asset_name": "BTC",
"quote_asset_name": "USDC",
"base_increment": "0.0001",
"quote_increment": "0.1",
"avg_daily_quantity": "12.0", // 30 day average daily traded vol, updated daily
"avg_daily_volume": "345446.4", // 30 day avg daily traded notional amt in USDC, updated daily
"total_30_day_quantity":"360.0", // 30 day total traded vol, updated daily
"total_30_day_volume":"10363392.0", // 30 day total traded notional amt in USDC, updated daily
"total_24_hour_quantity":"11.2", // 24 hr total traded vol, updated hourly
"total_24_hour_volume":"297731.9", // 24 hr total traded notional amt in USDC, updated hourly
"base_imf": "0.2", // Minimum initial margin requirement
"min_quantity": "0.0001", // Smallest qty allowed to place an order
"position_size_limit": "32", // Max size allowed for a position
"funding_interval": "60000000000", // Time in nanoseconds between funding intervals
"trading_state": "trading", // ALLOWED: offline, trading, paused
"last_update_time": "2023-05-04T11:16:35.016Z",
"time": "2023-05-10T14:58:47.000Z", // Gateway timestamp
"channel":"INSTRUMENTS",
"type":"SNAPSHOT"
}
{
"sequence": 1,
"product_id": "ETH-PERP",
"instrument_type": "PERP",
"base_asset_name": "ETH",
"quote_asset_name": "USDC",
"base_increment": "0.0001",
"quote_increment": "0.01",
"avg_daily_quantity": "43.0",
"avg_daily_volume": "80245.2",
"total_30_day_quantity":"1443.0",
"total_30_day_volume":"3040449.0",
"total_24_hour_quantity":"48.1",
"total_24_hour_volume":"101348.3",
"base_imf": "0.2",
"min_quantity": "0.0001",
"position_size_limit": "500",
"funding_interval": "60000000000",
"trading_state": "trading",
"last_update_time": "2023-05-04T11:16:33.016Z",
"time": "2023-05-10T14:58:47.000Z",
"channel":"INSTRUMENTS",
"type":"SNAPSHOT"
}
{
"sequence": 2,
"product_id": "BTC-PERP",
"instrument_type": "PERP",
"base_asset_name": "BTC",
"quote_asset_name": "USDC",
"base_increment": "0.0001",
"quote_increment": "0.1",
"avg_daily_quantity": "12.0",
"avg_daily_volume": "345446.4",
"total_30_day_quantity":"336.0",
"total_30_day_volume":"8931957.0",
"total_24_hour_quantity":"11.2",
"total_24_hour_volume":"297731.9",
"base_imf": "0.21",
"min_quantity": "0.00001",
"position_size_limit": "32",
"funding_interval": "60000000000",
"trading_state": "trading",
"last_update_time": "2023-05-10T14:59:17.000Z",
"time": "2023-05-10T14:59:17.000Z",
"channel": "INSTRUMENTS",
"type": "UPDATE"
}

MATCH Channel

The MATCH channel provides real-time information every time a trade happens. No snapshot is provided in this channel upon subscription.

// Request
{
"type": "SUBSCRIBE",
"product_ids": ["BTC-PERP"],
"channels": [
"MATCH"
],
"time": "1683730727",
"key": "glK4uG8QRmh3aqnJ",
"passphrase": "passphrase",
"signature": "1BM6nwNBLHAkLLs81qcKEKAAPoYIzxTuDIX9DpE0/EM="
}
// Response
{
"sequence": 0,
"product_id": "BTC-PERP",
"time": "2023-05-10T14:58:47.002Z",
"match_id": "177101110052388865",
"trade_qty": "0.006",
"aggressor_side": "BUY",
"trade_price": "28833.1",
"channel": "MATCH",
"type": "UPDATE"
}

FUNDING Channel

The FUNDING channel provides information on predicted/last funding intervals. The first SNAPSHOT message includes the funding rate of the last funding interval.

If the field is_final is false, the message indicates the predicted funding rate for the next funding interval.

// Request
{
"type": "SUBSCRIBE",
"product_ids": ["BTC-PERP"],
"channels": [
"FUNDING"
],
"time": "1683730727",
"key": "glK4uG8QRmh3aqnJ",
"passphrase": "passphrase",
"signature": "1BM6nwNBLHAkLLs81qcKEKAAPoYIzxTuDIX9DpE0/EM="
}
// Responses
{
"sequence": 0,
"product_id": "BTC-PERP",
"time": "2023-05-10T14:58:47.000Z",
"funding_rate": "0.001387",
"is_final": true,
"channel": "FUNDING",
"type": "SNAPSHOT"
}
{
"sequence": 1,
"product_id": "BTC-PERP",
"time": "2023-05-10T15:00:00.000Z",
"funding_rate": "0.001487",
"is_final": false,
"channel": "FUNDING",
"type": "UPDATE"
}

RISK Channel

The RISK channel provides snapshots and updates on risk metrics of the markets.

// Request
{
"type": "SUBSCRIBE",
"product_ids": ["BTC-PERP"],
"channels": [
"RISK"
],
"time": "1683730727",
"key": "glK4uG8QRmh3aqnJ",
"passphrase": "passphrase",
"signature": "1BM6nwNBLHAkLLs81qcKEKAAPoYIzxTuDIX9DpE0/EM="
}
// Responses
{
"sequence": 0,
"product_id": "BTC-PERP",
"time": "2023-05-10T14:58:47.000Z",
"limit_up": "30226.3", // The maximum allowed price for a buy order
"limit_down": "27347.7", // The minimum allowed price for a sell order
// A calculated price based on market quotes used to determine funding for perpetual futures and calculate the fair value.
"index_price": "28787",
// The median of the best bid, best offer, and last trade which gets used in various risk calculations.
"mark_price": "28787",
// The price used to settle open positions which resets risk calculations for margin and unrealized P&L.
"settlement_price": "28787",
"open_interest": "32",
"channel": "RISK",
"type": "SNAPSHOT"
}
{
"sequence": 1,
"product_id": "BTC-PERP",
"time": "2023-05-10T14:59:17.000Z",
"limit_up": "31233.9",
"limit_down": "28259.3",
"index_price": "28788",
"mark_price": "29746.6",
"settlement_price": "29746.6",
"open_interest": "34",
"channel": "RISK",
"type": "UPDATE"
}

LEVEL1 Channel

The LEVEL1 channel provides real-time top of book updates.

// Request
{
"type": "SUBSCRIBE",
"product_ids": ["BTC-PERP"],
"channels": [
"LEVEL1"
],
"time": "1683730727",
"key": "glK4uG8QRmh3aqnJ",
"passphrase": "passphrase",
"signature": "1BM6nwNBLHAkLLs81qcKEKAAPoYIzxTuDIX9DpE0/EM="
}
// Response
{
"sequence": 0,
"product_id": "BTC-PERP",
"time": "2023-05-10T14:58:47.000Z",
"bid_price": "28787.8",
"bid_qty": "0.466", // One side book
"channel": "LEVEL1",
"type": "SNAPSHOT"
}
{
"sequence": 1,
"product_id": "BTC-PERP",
"time": "2023-05-10T14:58:47.547Z",
"bid_price": "28787.8",
"bid_qty": "0.466",
"ask_price": "28788.8",
"ask_qty": "1.566",
"channel": "LEVEL1",
"type": "UPDATE"
}

LEVEL2 Channel

The LEVEL2 channel provides real-time updates on the top 20 levels of the aggregated order book.

// Request
{
"type": "SUBSCRIBE",
"product_ids": ["BTC-PERP"],
"channels": [
"LEVEL2"
],
"time": "1683730727",
"key": "glK4uG8QRmh3aqnJ",
"passphrase": "passphrase",
"signature": "1BM6nwNBLHAkLLs81qcKEKAAPoYIzxTuDIX9DpE0/EM="
}
// Responses
{
"sequence": 0,
"product_id": "BTC-PERP",
"time": "2023-05-10T14:58:47.000Z",
"bids": [
["29100", "0.02"],
["28950", "0.01"],
["28900", "0.01"]
],
"asks": [
["29267.8", "18"],
["29747.6", "18"],
["30227.4", "9"]
],
"channel": "LEVEL2",
"type": "SNAPSHOT",
}
{
"sequence": 1,
"product_id": "BTC-PERP",
"time": "2023-05-10T14:58:47.375Z",
"changes": [
[
"BUY",
"28787.7",
"6"
]
],
"channel": "LEVEL2",
"type": "UPDATE"
}
info

The size property is the updated size at the price level, not a delta. A size of "0" indicates the price level can be removed.

Was this helpful?