> ## Documentation Index
> Fetch the complete documentation index at: https://hypernode-docs.polynode.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# hypernode

> Real-time HyperLiquid data stream and exchange API, by polynode

# hypernode

Every order, fill, and cancellation on HyperLiquid, streamed in real-time through one WebSocket. Two consensus layers merged into a single feed.

<CardGroup cols={3}>
  <Card title="Two layers" icon="layer-group">
    Pre-consensus gossip + confirmed node data in one stream
  </Card>

  <Card title="100%" icon="check">
    Every order, fill, cancel, rejection — nothing missing
  </Card>

  <Card title="Filtered" icon="filter">
    Subscribe to exactly what you need by type, asset, or wallet
  </Card>
</CardGroup>

## One key, both chains

hypernode is the only HyperLiquid API that bundles data, trading, and infrastructure in one place.

| Capability                                              | hypernode | Alternatives               |
| ------------------------------------------------------- | :-------: | :------------------------- |
| Pre-consensus gossip (cancels/modifies \~1s early)      |  Included | Not available anywhere     |
| Confirmed order flow (every order, fill, rejection)     |  Included | Hydromancer (\$300+/mo)    |
| L4 order book (individual orders with wallet addresses) |  Included | Hydromancer (\$300+/mo)    |
| Trading execution (place, cancel, modify orders)        |  Included | Build it yourself          |
| EVM RPC (contract reads, tx submission, chain 999)      |  Included | HypeRPC (\$2,000/mo)       |
| 54 REST endpoints (market data, user state, DeFi)       |  Included | Partial coverage elsewhere |

Starts at \$50/mo. One `pn_live_` key works across everything.

## The unified stream

hypernode merges two data sources that nobody else combines:

* **Pre-consensus** — cancel and modify actions from the gossip protocol, before validators commit them. \~1 second ahead of the public API.
* **Confirmed** — every order placement, fill, cancellation, and rejection after a block commits.

Every event is tagged `consensus: "pre"` or `consensus: "confirmed"` so you always know what you're looking at.

\~6,500 events per second on mainnet. Filter down to exactly what you need.

## Quick start

```typescript theme={null}
import WebSocket from "ws";

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

ws.on("open", () => {
  ws.send(JSON.stringify({
    action: "subscribe",
    filters: { action_types: ["order", "fill"] }
  }));
});

ws.on("message", (raw) => {
  const event = JSON.parse(raw.toString());
  console.log(event.consensus, event.type, event.asset, event.data.px);
  // "confirmed" "order" "BTC" "74400.0"
  // "confirmed" "fill" "ETH" "2359.7"
});
```

## What's in the stream

| Type             | Layer     | What it tells you                                |
| ---------------- | --------- | ------------------------------------------------ |
| `order`          | confirmed | New resting limit order with price, size, wallet |
| `order_filled`   | confirmed | Order filled immediately                         |
| `order_canceled` | confirmed | Order was canceled                               |
| `order_rejected` | confirmed | Order rejected (margin, price, balance)          |
| `fill`           | confirmed | Trade execution with PnL, fees, direction        |
| `cancel`         | pre       | Cancel submitted before block commit             |
| `cancelByCloid`  | pre       | Cancel by client order ID                        |
| `batchModify`    | pre       | Order modification with new price/size           |

Subscribe to `"order"` to get all order lifecycle events. See [Event Format](/api/events) for the complete reference.

## Batch queries

Query position state, orders, or portfolios for up to **10,000 wallets** in a single request. Average latency: 0.12ms per wallet. Built for copy trading platforms, portfolio trackers, and whale monitoring.

```bash theme={null}
curl -X POST https://hyper.polynode.dev/v2/batch/clearinghouse-states \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"users": ["0x...","0x...","0x..."]}'
```

Four batch endpoints: `clearinghouse-states`, `spot-clearinghouse-states`, `open-orders`, `portfolios`. See [Batch Queries](/rest/user-data/batch-queries) for the full spec.

## REST API

54 endpoints for trading, market data, user state, and DeFi on HyperLiquid.

```bash theme={null}
# L4 order book — every individual order with wallet address
curl -H "x-api-key: YOUR_KEY" "https://hyper.polynode.dev/v2/l4book?coin=BTC"

# User positions and margin
curl -H "x-api-key: YOUR_KEY" "https://hyper.polynode.dev/v2/user/state?address=0x..."

# Cross-venue funding rate comparison
curl -H "x-api-key: YOUR_KEY" "https://hyper.polynode.dev/v2/funding-rates"
```

## Authentication

hypernode uses the same API keys as [polynode](https://polynode.dev). If you have a polynode account on the Growth plan or above, your `pn_live_` key works on hypernode automatically.

[Sign up at polynode.dev](https://polynode.dev) to get started.

<CardGroup cols={2}>
  <Card title="Stream Quickstart" icon="bolt" href="/quickstart">
    Connect and subscribe in 30 seconds
  </Card>

  <Card title="REST API" icon="code" href="/rest/overview">
    54 endpoints for market data, trading, and DeFi
  </Card>
</CardGroup>
