Skip to content

Hyperliquid Data Source

Hyperliquid is the source of truth for the tradable asset universe and the main asset-level market context.

The backend stores all supported Hyperliquid assets, including perps and spot-style markets. Generic HIP-3 category exposure is intentionally out of scope for the product picker.

Hyperliquid ingestion flow

What We Store

ChannelTableOriginCadence / granularityPurpose
OHLCVhyperliquid_candlesSourcecandle WebSocket at 1mReal OHLCV rows for chart/context reads
OHLCV rollupshyperliquid_candlesDerived1h from 1m candlesLarger windows without extra source subscriptions
RSIhyperliquid_technical_indicatorsDerived5m from OHLCVWilder RSI 14 trading signal
Bollinger Bandshyperliquid_technical_indicatorsDerived5m from OHLCV20-period SMA plus/minus 2 standard deviations
Moving Averageshyperliquid_technical_indicatorsDerived5m from OHLCVSMA 20 and EMA 20
MACDhyperliquid_technical_indicatorsDerived5m from OHLCV12/26 EMA line, 9 EMA signal, histogram
Funding Rateshyperliquid_funding_pressureSource5m HTTP pollsCurrent and predicted perp funding context

Channel Definitions

Use the common market-data definitions for user-facing Hyperliquid channels:

  • OHLCV stores the exchange candle open, high, low, close, and base volume for the 1-minute bucket. One-hour rows are local rollups from closed 1-minute rows.
  • RSI is Wilder RSI 14. The first average gain/loss is a simple 14-period average, then subsequent rows use Wilder smoothing.
  • Bollinger Bands use a 20-period SMA as the middle band and 2 standard deviations for upper/lower bands.
  • Moving Averages expose SMA 20 and EMA 20. EMA uses the standard multiplier 2 / (period + 1) and seeds from the first period SMA.
  • MACD uses the standard 12-period EMA minus 26-period EMA line, a 9-period EMA signal, and line minus signal histogram.
  • Funding Rates are perp-only. They come from Hyperliquid perp asset context and predicted funding data; spot markets do not have funding rows.

Price Policy

Use one active price path:

text
1m candle WebSocket subscriptions
  -> real OHLCV rows
  -> hyperliquid_candles
  -> local 1h rollups
  -> 5m technical indicators
  -> hyperliquid_technical_indicators

This avoids the REST candleSnapshot rate-limit problem for the full asset universe. Larger chart intervals and technical indicators should be derived locally from 1-minute candles instead of subscribing to every interval.

How We Fetch Data

Configured endpoints:

ConfigDefault
HYPERLIQUID_WS_URLwss://api.hyperliquid.xyz/ws
HYPERLIQUID_INFO_URLhttps://api.hyperliquid.xyz/info

For OHLCV, we subscribe to 1-minute candle streams per active supported symbol:

json
{
  "method": "subscribe",
  "subscription": {
    "type": "candle",
    "coin": "BTC",
    "interval": "1m"
  }
}

We parse channel: "candle" messages and store 1-minute rows in hyperliquid_candles. Larger intervals and technical indicators are derived locally from those rows.

Registry and feature inputs use HTTP POST to HYPERLIQUID_INFO_URL:

Request bodyUsed for
{ "type": "meta" }Perp universe and symbols
{ "type": "spotMeta" }Spot-style universe, display names, search terms
{ "type": "metaAndAssetCtxs" }Perp contexts, active status, open interest inputs
{ "type": "predictedFundings" }Predicted funding rows

The client still has a candleSnapshot helper for probes/backfills, but the runtime price ingestor should not use it for the full universe because it becomes request-heavy.

Current hot retention:

DataRetention
1m OHLCV source candles24 hours
1h OHLC rollups7 days
5m technical indicators7 days
5m funding rates7 days

Asset Registry

hyperliquid_assets stores the supported-market registry:

  • Exchange symbol.
  • Display name and search terms.
  • Asset kind: perp, spot, or unknown.
  • Category/subcategory metadata for the picker.
  • Coverage flags for mid prices, OHLCV/candles, liquidity profile, funding pressure/rates, volatility profile, positioning pressure, and trading.

Runtime ingestion refreshes the registry from Hyperliquid metadata and stream-discovered symbols. Product selection should read this registry instead of inferring support from observation rows.

The compiler and workflow UI must respect these coverage flags when resolving data streams. For example, spot-style @... markets can support OHLCV and OHLC-derived technical indicators while not supporting funding rates, liquidity profile, or positioning pressure. Unsupported channel/asset pairs should be filtered from asset pickers and skipped from compiled read plans with a warning.

Trading Context

Trading prompts can request Hyperliquid context per enabled asset:

  • OHLCV candles for chart structure.
  • RSI, Bollinger Bands, Moving Averages, and MACD derived from OHLCV.
  • Funding rates for crowded perp positioning context.

In the strategy builder, Hyperliquid Data Stream Blocks are created by channel first, then configured with one associated Hyperliquid asset inside the block. The block should only connect to the matching Asset Block.

Local Commands

bash
cd backend
npm run hyperliquid:assets
npm run hyperliquid:ohlcv -- --duration-ms=70000
npm run hyperliquid:features
npm run hyperliquid:maintain