Perps L2

l2:perps

Full 20-level depth snapshot. Subscribe to a single channel and use tier tag filtering to select your update frequency.

Channel: l2:perps:{instrument} Example: l2:perps:BTC_USDC-PERPETUAL

Payload

{
  "timestamp": 1704067200000,
  "bids": [
    ["50000", "1000", "3"],
    ["49900", "500", "2"]
  ],
  "asks": [
    ["50100", "800", "2"],
    ["50200", "400", "1"]
  ]
}
FieldTypeDescription
timestampintegerUnix timestamp in milliseconds
bidsarrayBid levels, best (highest) first. Each: [price, amount, order_count]
asksarrayAsk levels, best (lowest) first. Each: [price, amount, order_count]

Level array elements:

IndexTypeDescription
0stringPrice
1stringAmount (notional USD)
2stringNumber of orders at this level

Tag Filtering

Each publication carries a tier tag. Filter by tier to select your update frequency.

Tag valueFrequencyUse case
no filterEvery 100ms (all tiers)HFT / algo trading
100Every 100msSame as no filter, explicit tier match
250Every 250msActive trading
500Every 500msDashboards / casual

Subscribe — Protobuf SDK

All updates (100ms — HFT)

No tag filter — receives every publication.

import { Centrifuge } from "centrifuge/build/protobuf";

const client = new Centrifuge("wss://staging.kyan.sh/stream/websocket?format=protobuf");
const sub = client.newSubscription("l2:perps:BTC_USDC-PERPETUAL", { since: {} });

sub.on("publication", (ctx) => {
  const data = ctx.data instanceof Uint8Array
    ? JSON.parse(new TextDecoder().decode(ctx.data))
    : ctx.data;

  const { timestamp, bids, asks } = data;
});

sub.subscribe();
client.connect();

Filtered: 250ms updates

const sub = client.newSubscription("l2:perps:BTC_USDC-PERPETUAL", {
  since: {},
  tagsFilter: { key: "tier", cmp: "eq", val: "250" }
});

Filtered: 500ms updates

const sub = client.newSubscription("l2:perps:BTC_USDC-PERPETUAL", {
  since: {},
  tagsFilter: { key: "tier", cmp: "eq", val: "500" }
});

Recovery

Subscribe with since: {} to receive the last known snapshot on subscribe. On reconnect, the SDK automatically recovers.

Related channels

Channels providing related data.

ChannelWhy
Index PriceSpot price for the underlying pair. Basis at each level = level price - index.
Funding RateFunding rate for the instrument. Derived from the basis (perp price - index).
Perps BBOTop-of-book summary extracted from this depth data.
L2 GroupedPrice-bucketed aggregation of the same orderbook.
Options BBOOptions market IV and skew data for the same underlying.
Order LifecycleYour order state, fills, and cancellations.
Trades (Perps)Public trade tape showing executions against this book.