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]| Index | Type | Description |
|---|---|---|
| 0 | string | Price (always positive) |
| 1 | string | Signed size — positive = taker bought (lifted ask), negative = taker sold (hit bid) |
| 2 | integer | Trade 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.
| Channel | Why |
|---|---|
| Perps BBO | Current best bid/ask at time of trade. |
| Perps L2 | Full depth context for the book these trades executed against. |
| Index Price | Spot price at time of trade. Trade price minus index = basis. |
| Funding Rate | Funding rate for the instrument. |
| Order Lifecycle | Your private fills with fee breakdown, liquidity indicator, and index_price at fill. |
Updated about 2 months ago
