Skip to main content

1. Get an API key

Contact us to get an API key. Keys are prefixed with pn_live_.

2. Connect via WebSocket

import WebSocket from "ws";

const ws = new WebSocket("wss://hyper.polynode.dev/ws?key=YOUR_KEY");

ws.on("open", () => {
  // Subscribe to all events (firehose)
  ws.send(JSON.stringify({ action: "subscribe" }));
});

ws.on("message", (raw) => {
  const event = JSON.parse(raw.toString());
  console.log(`[${event.block}] ${event.type} | ${event.user} | ${event.asset}`);
});

3. Apply filters

Don’t need every event? Subscribe with filters.
{
  "action": "subscribe",
  "filters": {
    "action_types": ["order", "cancel"],
    "assets": ["BTC", "ETH"]
  }
}
This delivers only BTC and ETH order/cancel events. See Filters for all options.

4. Check it’s working

You should see events flowing immediately. On mainnet, expect 500-1000 actions per second. Each event looks like:
{
  "block": 70785135,
  "timestamp": 1774926476708,
  "type": "cancelByCloid",
  "user": "0xadca00000001ad3fb20000000002b67426c04500",
  "asset": "FLY",
  "asset_id": 187,
  "data": {
    "cancels": [{"asset": 187, "cloid": "0x000000334e474c3733393636484b5355"}]
  },
  "network": "mainnet"
}

Next steps

Subscriptions

Subscribe, unsubscribe, and manage multiple streams

Action Types

All 53 decoded action types with example payloads

Prediction Markets

HIP-4 prediction market enrichment

Authentication

Tiers, rate limits, and error codes