Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

HyperGrok Hyperliquid Websocket

БесплатноБез исполняемых скриптовНе проверен

Subscribe to live Hyperliquid data over WebSocket from the desk computer - mids, order book, trades, candles, best bid/offer, and per-account fills, order…

galleonlabsот galleonlabs735 установок в других каталогах

Об этом скилле

Hyperliquid WebSocket

Read-only, no key. Endpoints: wss://api.hyperliquid.xyz/ws (mainnet), wss://api.hyperliquid-testnet.xyz/ws (testnet). Prefer WebSocket over polling for anything continuous: fills, order updates, book and price watches.

Protocol

Subscribe: {"method": "subscribe", "subscription": {...}}. Unsubscribe with "method": "unsubscribe". The server acknowledges with {"channel": "subscriptionResponse", ...} then streams {"channel": "<type>", "data": ...}. The server closes a connection it has not sent a message to for 60 seconds, so on quiet channels send {"method": "ping"} periodically (the SDKs do it for you) and expect {"channel": "pong"}.

Subscription types the desk uses:

Type Subscription JSON Data
Mids for all markets {"type":"allMids"} (optional "dex") {"mids": {"BTC": "97123.5", ...}}
Order book {"type":"l2Book","coin":"ETH"} (optional nSigFigs, mantissa, fast: true for 5 levels) {"coin","time","levels":[bids,asks]}, up to 20 levels a side, pushed on each block at least 0.5 s after the last push
Trades {"type":"trades","coin":"ETH"} array of {coin, side, px, sz, time, hash, tid, users}
Candles {"type":"candle","coin":"ETH","interval":"1m"} {t,T,s,i,o,c,h,l,v,n} updated in place until the bar closes
Best bid/offer {"type":"bbo","coin":"ETH"} {"coin","time","bbo":[bid, ask]}
Asset context {"type":"activeAssetCtx","coin":"ETH"} funding, OI, mark, oracle, premium, volume for one market
Account fills {"type":"userFills","user":"0x..."} {"user","isSnapshot","fills":[...]} (first message is a snapshot)
Order updates {"type":"orderUpdates","user":"0x..."} array of {order:{coin,side,limitPx,sz,oid,timestamp,origSz,cloid}, status, statusTimestamp}
Account events {"type":"userEvents","user":"0x..."} fills, funding, liquidation, non-user cancels; arrives on channel "user"
Account funding {"type":"userFundings","user":"0x..."} hourly funding payments
Per-market account data {"type":"activeAssetData","user":"0x...","coin":"ETH"} leverage setting, max trade sizes, available to trade, mark (perps only)
Account state stream {"type":"clearinghouseState","user":"0x..."} / {"type":"openOrders","user":"0x..."} {dex, user, clearinghouseState:{...REST shape...}} / {dex, user, orders:[...]} (order items carry the frontend fields: isTrigger, triggerPx, orderType, cloid), pushed
TWAP state {"type":"twapStates","user":"0x...","dex":""} / {"type":"userTwapSliceFills","user":"0x..."} running TWAPs and their slice fills
Frontend snapshot {"type":"webData3","user":"0x..."} positions, orders and context in one stream (heavy)

Limits per IP: up to 10 connections, 30 new connections per minute, 1000 subscriptions, 10 distinct users across user subscriptions, 2000 messages per minute, 100 in-flight posts. One connection per watch process is enough.

You can also send /info requests over the socket: {"method":"post","id":1,"request":{"type":"info","payload":{"type":"allMids"}}} returns {"channel":"post","data":{"id":1,"response":{"type":"info","payload":{"type":"allMids","data":{...}}}}}, so a watch need not mix REST and WS.

Python (official SDK)

import os, json, sys, time, signal
from hyperliquid.info import Info
from hyperliquid.utils import constants

NETWORK = os.environ.get("HYPERLIQUID_NETWORK", "testnet")
BASE = constants.MAINNET_API_URL if NETWORK == "mainnet" else constants.TESTNET_API_URL
ADDR = os.environ.get("HYPERLIQUID_ACCOUNT_ADDRESS")
LOG = open("/workspace/trading-desk/watch/ws.log", "a")

def on_msg(msg):
    line = json.dumps({"ts": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), "channel": msg.get("channel"), "data": msg.get("data")})
    LOG.write(line + "\n"); LOG.flush()
    if msg.get("channel") == "userFills" and not msg["data"].get("isSnapshot"):
        for f in msg["data"]["fills"]:
            print(f"FILL {f['coin']} {f['side']} {f['sz']} @ {f['px']} fee {f['fee']} oid {f['oid']} cloid {f.get('cloid')}", flush=True)

info = Info(BASE)                                   # skip_ws=False starts the socket thread
info.subscribe({"type": "allMids"}, on_msg)
info.subscribe({"type": "l2Book", "coin": "ETH"}, on_msg)
if ADDR:
    info.subscribe({"type": "userFills", "user": ADDR}, on_msg)
    info.subscribe({"type": "orderUpdates", "user": ADDR}, on_msg)   # one orderUpdates/userEvents subscription per Info

signal.signal(signal.SIGTERM, lambda *_: (info.disconnect_websocket(), sys.exit(0)))
while True:
    time.sleep(60)

The SDK's manager pings for you but does not reconnect on drop; run it under a supervisor (see below) and treat a silent log as a dead watch. It also only routes these subscription types to your callback: allMids, l2Book, trades, candle, bbo, userEvents, userFills, orderUpdates, userFundings, `userNonFundi

Полный SKILL.md на ClawHub

Установить HyperGrok Hyperliquid Websocket в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл HyperGrok Hyperliquid Websocket?

Subscribe to live Hyperliquid data over WebSocket from the desk computer - mids, order book, trades, candles, best bid/offer, and per-account fills, order updates and events - with raw JSON, Python SDK and TypeScript examples, plus how to run a supervised watch that logs to a file and alerts. Read-only. Use for monitoring, fill notifications and any watch that polling would make expensive.

Как установить скилл HyperGrok Hyperliquid Websocket?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл HyperGrok Hyperliquid Websocket запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить HyperGrok Hyperliquid Websocket с