Skip to main content

Module hyperliquid_ws

Module hyperliquid_ws 

Source
Expand description

WebSocket-based price feed from Hyperliquid.

Maintains a single persistent WebSocket connection to the Hyperliquid public API, subscribing to activeAssetCtx for configured coins. This replaces HTTP polling of metaAndAssetCtxs which isn’t available on self-hosted nodes and hits rate limits.

StructsΒ§

ActiveAssetCtxData πŸ”’
ActiveAssetCtxSub πŸ”’
AssetCtxWs πŸ”’
HyperliquidWsFeed
Shared WebSocket price feed for Hyperliquid oracle prices.
PriceEntry πŸ”’
A cached oracle price with its timestamp.
WsMessage πŸ”’
WsSubscription πŸ”’

ConstantsΒ§

DEFAULT_TESTNET_WS_URL
Default WebSocket URL for Hyperliquid testnet.
DEFAULT_WS_URL
Default WebSocket URL for Hyperliquid mainnet.