From e9629b698bb9da62c82b7d976036f501a6c59209 Mon Sep 17 00:00:00 2001 From: ramseshk Date: Wed, 5 Aug 2026 09:04:40 +0000 Subject: [PATCH] Fix Hyperliquid WebSocket subscribe format: type -> method --- dashboard-next/src/lib/hyperliquid-ws.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard-next/src/lib/hyperliquid-ws.ts b/dashboard-next/src/lib/hyperliquid-ws.ts index 77434d5..1255e02 100644 --- a/dashboard-next/src/lib/hyperliquid-ws.ts +++ b/dashboard-next/src/lib/hyperliquid-ws.ts @@ -86,9 +86,9 @@ export function useHyperliquidWebSocket(coin: string = "BTC"): HyperliquidData { setConnected(true); setError(null); subscribed.current = false; - // Subscribe - ws.send(JSON.stringify({ type: "subscribe", subscription: { type: "l2Book", coin } })); - ws.send(JSON.stringify({ type: "subscribe", subscription: { type: "trades", coin } })); + // Subscribe — Hyperliquid WebSocket uses "method" not "type" + ws.send(JSON.stringify({ method: "subscribe", subscription: { type: "l2Book", coin } })); + ws.send(JSON.stringify({ method: "subscribe", subscription: { type: "trades", coin } })); subscribed.current = true; };