Unauthenticated channels

Top Of Book

Channel for sending changes on the top of book. These updates are real-time and happen whenever there is a change to the top of the book. The time is a timestamp of the last order update in the top of book price levels. Top of book change update might deliver changes in multiple markets at the same time.

// Request
// Subscribe to BTC.USD.P Top Of Book market data feed.
{
	"op":"subscribe",
  "channel": "topOfBooksPerps",
  "markets": ["AVAX-USD.P"]
}

// Response
// First will be confirmation about operation success/failure.
{
  "channel": "topOfBooksPerps",
  "type": "subscribed",
  "data": ...
}

// Next will be the appropriate feed events.
{
  "channel": "topOfBooksPerps",
  "type": "update",
  "data": [{
    "market": "AVAX-USD.P",
    "asks": [["21","1"]],
    "bids": [["20","1"]],
		"time": "2022-06-16T12:35:11.123456Z"
	}]
}

Depth

Channel for sending book snapshots every 250ms at most 100 levels deep. The update might deliver changes in multiple markets at the same time.

// Request
// Subscribe to AVAX-USDC depth market data feed.
{
	"op":"subscribe",
  "channel": "depthBooksPerps",
  "markets": ["AVAX-USD.P"]
}

// Response
// First will be confirmation about operation success/failure.
{
  "channel": "depthBooksPerps",
  "type": "subscribed",
  "data": ...
}

// Next will be the appropriate feed events.
{
  "channel": "depthBooksPerps",
  "type": "update",
  "data": [{
    "market": "AVAX-USD.P",
		"asks": [["21","1"],["22","1"],["23","1"]],
		"bids": [["20","1"],["19","1"],["18","1"]],
		"time": "2022-06-16T12:35:11.123456Z"
	}]
}

Trades

Channel for getting trades.

// Request
// Subscribe to all trades
{
	"op": "subscribe",
  "channel": "tradesPerps",
  "markets": ["AVAX-USD.P"]
}

// Response
// First will be confirmation about operation success/failure.
{
  "channel": "tradesPerps",
  "type": "subscribed",
  "data": ...
}

// Next will be the appropriate feed events.
{
  "type": "update",
  "channel": "tradesPerps",
  "data": [{
    "market":"AVAX-USD.P",
    "price":"20.0",
    "size":"10", // base currency
		"aggressor_side": "buy",
    "time": "2022-06-16T12:35:11.123456Z",
    "id": "aaa",
  }]
}

Mark Prices

Channel for mark prices per-market. Doesn’t require authentication.

// Request
// Subscribe to mark price updates.
{
	"op": "subscribe",
  "channel": "markPricesPerps",
	"markets": ["BTC-USD.P"]
}

// Response
// First will be confirmation about operation success/failure.
{
  "channel": "markPricesPerps",
  "type":"subscribed",
  "data": ...
}

{
  "type": "update",
  "channel":"markPricesPerps",
  "data": [{
		"market": "BTC-USD.P",
		"markPrice": "27005.54", // Mark price determined from oracle
	}]
}

Funding Rates

Channel for funding rate updates per-market. Doesn’t require authentication.

// Request
// Subscribe to funding rate updates.
{
	"op": "subscribe",
  "channel": "fundingRatesPerps",
	"markets": ["BTC-USD.P"]
}

// Response
// First will be confirmation about operation success/failure.
{
  "channel": "fundingRatesPerps",
  "type":"subscribed",
  "data": ...
}

{
  "type": "update",
  "channel":"fundingRatesPerps",
  "data": [{
		"market": "BTC-USD.P",
		"rate": "0.0005", // Estimated funding rate as a fraction
		"intervalEnds": "2022-06-16T12:35:11.123456Z", // ISO-8601 timestamp when the current interval ends
		"premiums": [
			... // Ignore, might be removed later
		]
	},
	...]
}

Authenticated channels

Additional authenticated channels are available for information specific to your account. These require authenticating as described here.