Appearance
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.
What We Store
| Channel | Table | Origin | Cadence / granularity | Purpose |
|---|---|---|---|---|
| Mid prices | hyperliquid_mid_prices | Source | allMids stream bucketed at 5s | Short-horizon price context |
| OHLC candles | hyperliquid_candles | Source | candle WebSocket at 1m | Real OHLC rows for chart/context reads |
| OHLC rollups | hyperliquid_candles | Derived | 1h from 1m candles | Larger windows without extra source subscriptions |
| Liquidity profile | hyperliquid_liquidity_profiles | Source-derived from L2 snapshots | 5m | Spread, depth, and imbalance |
| Funding pressure | hyperliquid_funding_pressure | Source-derived from perp context | 5m | Funding, open interest, crowding |
| Volatility profile | hyperliquid_volatility_profiles | Derived | 5m | Realized volatility and jumpiness |
| Positioning pressure | hyperliquid_positioning_pressure | Derived | 5m | Composite direction/crowding signal |
Price Policy
Use two price paths:
text
allMids stream
-> 5-second midpoint buckets
-> hyperliquid_mid_prices
1m candle WebSocket subscriptions
-> real OHLC rows
-> hyperliquid_candles
-> local 1h rollupsThis avoids the REST candleSnapshot rate-limit problem for the full asset universe. Larger chart intervals should be derived locally from 1-minute candles instead of subscribing to every interval.
How We Fetch Data
Configured endpoints:
| Config | Default |
|---|---|
HYPERLIQUID_WS_URL | wss://api.hyperliquid.xyz/ws |
HYPERLIQUID_INFO_URL | https://api.hyperliquid.xyz/info |
Streaming price data uses one WebSocket connection:
json
{
"method": "subscribe",
"subscription": { "type": "allMids" }
}That message returns all midpoint prices in one stream payload. We parse channel: "allMids" messages and store compact 5-second buckets in hyperliquid_mid_prices.
For OHLC, 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 are derived locally from those rows.
Registry and feature inputs use HTTP POST to HYPERLIQUID_INFO_URL:
| Request body | Used 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 |
{ "type": "l2Book", "coin": "BTC" } | L2 book snapshot for liquidity profile |
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:
| Data | Retention |
|---|---|
| 5s mid-price buckets | 30 minutes |
| 1m OHLC source candles | 24 hours |
| 1h OHLC rollups | 7 days |
| 5m feature profiles | 7 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 prices, candles, profiles, 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.
Trading Context
Trading prompts can request Hyperliquid context per enabled asset:
- Recent mids for the freshest short-horizon move.
- OHLC candles for chart structure.
- Liquidity profile for tradability and slippage risk.
- Funding pressure for crowded perp positioning.
- Volatility profile for regime and sizing.
- Positioning pressure for composite market state.
Local Commands
bash
cd services/market-backend
npm run hyperliquid:assets
npm run hyperliquid:candles -- --duration-ms=70000
npm run hyperliquid:features
npm run hyperliquid:maintain