Trades Perps

trades_perp

Taker executions on perpetual instruments. One message per trade — the taker's side only (no duplicate for the maker).

Channel: trades_perp:{instrument} Example: trades_perp:BTC_USDC-PERPETUAL

Payload

["2251.50", "1.5", 1704067200000]
IndexTypeDescription
0stringPrice (always positive)
1stringSigned size — positive = taker bought (lifted ask), negative = taker sold (hit bid)
2integerTrade execution timestamp (ms)

Subscribe — Protobuf SDK

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

const client = new Centrifuge("wss://staging.kyan.sh/stream/websocket?format=protobuf");
const sub = client.newSubscription("trades_perp:BTC_USDC-PERPETUAL");

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

  const [price, signedSize, timestamp] = data;
  const side = Number(signedSize) >= 0 ? "buy" : "sell";
});

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

History

Last 100 trades available via the history API on bidirectional transports. See Transports & Connection for subscribe examples with history fetch.

On reconnect, the SDK automatically recovers missed trades using the last known stream position.

Related channels

Channels providing related data.

ChannelWhy
Perps BBOCurrent best bid/ask at time of trade.
Perps L2Full depth context for the book these trades executed against.
Index PriceSpot price at time of trade. Trade price minus index = basis.
Funding RateFunding rate for the instrument.
Order LifecycleYour private fills with fee breakdown, liquidity indicator, and index_price at fill.