FAQs
1. How do we connect to your feed and gateway to Hyperliquid?
-
Feed (market & account data)
-
HTTP (REST): the Info endpoint — POST
https://<endpoint>/v1/hl/info— for snapshots & queries (mids, L2 book, trades, user fills, etc.). - WebSocket: low-latency, real-time streams and request/response over a single connection.
-
HTTP (REST): the Info endpoint — POST
-
Gateway (trading/actions)
-
HTTP (REST): the Exchange endpoint — POST
https://<endpoint>/v1/hl/exchange— for signed actions (place/modify/cancel orders, leverage, transfers, etc.). - WebSocket: you can also send signed actions over WS using:
-
HTTP (REST): the Exchange endpoint — POST
- Subscribe to trades over WS (feed):
- Fetch L2 snapshot over REST (feed):
- Place an order over REST (gateway):
- Use API wallets (“agent wallets”) approved by the master account to sign on behalf of master/sub-accounts; nonces are tracked per signer and must be within a moving time window.
- Don’t reuse pruned agents; prefer one API wallet per process/sub-account to avoid nonce clashes.
- Two signing schemes exist; minor serialization mistakes will break signatures — the docs strongly suggest starting from the Python SDK.
2. Should I use WebSocket or REST API for order placement in Hyperliquid?
Both are supported (same action payloads, same signatures). Choose based on latency profile & traffic pattern: Use WebSocket when you need:- Lowest latency & fewer TLS handshakes (long-lived connection).
- High throughput / batching (many orders/cancels per second) while staying within WS limits (e.g., up to 2000 messages/min, 100 inflight posts across connections).
- Unified pipe for both streaming fills/order updates and sending actions (method: “post”), simplifying coordination.
- Simplicity/reliability (stateless requests, easy retries, fits typical HTTP infra).
- Lower request volume or cron/ops scenarios (e.g., scheduled rebalances) where WS overhead isn’t justified.
- Note: IP-based rate weights - REST has ~1200 weight/min with per-endpoint weights (e.g., exchange weight ≈ 1 + floor(batch_length/40)). Address-based limits for actions still apply regardless of transport.
- Market-making / fast bots → WebSocket for both streaming & posting actions.
- Back-office, dashboards, low-frequency trading → REST for actions; WS optional for real-time UX.
- Respect both IP-based (per minute) and address-based (per user) limits.
- Leverage batched actions to cut IP weight while minding address-based limits.
- Use cloid for idempotency and reconciliation.