01Conventions#
- All routes are
GETand return JSON. - Success:
{ ok: true, at, source, … }. Error:{ ok: false, error }with a 4xx/5xx status. - Responses are cached server-side (see each route) to respect Hyperliquid rate limits. Polling faster than the cache returns the same
at. - Types below are copied from
src/lib/types.ts, the contract the routes implement.
02GET /api/markets#
GET
/api/marketscache 15 sEvery Hyperliquid perp with live mark, 24 h change, open interest, funding and pricing volatility.
curl -s "/api/markets"
type Market = {
coin: string;
markPx: number;
change24h: number; // fraction, e.g. -0.031
oiUsd: number;
volume24hUsd: number;
funding1h: number; // fraction per hour
maxLeverage: number;
vol: number | null; // annualized realized vol, 168 hourly closes, NOT tail-adjusted
};
type MarketsRes = { ok: true; at: number; source: "Hyperliquid"; markets: Market[] };
GET /api/markets
Press "Send request" to call the route from this page.03GET /api/scan#
GET
/api/scan?address=0x…cache 5 sA wallet's open Hyperliquid perp positions with live risk numbers.
address0x… (40 hex)Hyperliquid account. Required.curl -s "/api/scan?address=0x…"
type ScanPosition = {
coin: string; side: "long" | "short";
size: number; entryPx: number; markPx: number;
liqPx: number | null; leverage: number;
marginType: "cross" | "isolated";
positionValueUsd: number; marginUsd: number; unrealizedPnlUsd: number;
distancePct: number | null;
vol: number | null; // annualized, not tail-adjusted
survival: { h24: number; h72: number; d7: number } | null;
};
type ScanRes = { ok: true; at: number; source: "Hyperliquid"; address: string;
accountValueUsd: number; withdrawableUsd: number; positions: ScanPosition[] };
04GET /api/ashes#
GET
/api/ashes?limit=100cache 10 sRecent Hyperliquid liquidations Phoenix has observed, with 24 h stats and an honest coverage note.
limitintegerMax rows (default 100).curl -s "/api/ashes?limit=100"
type Ash = { id: string; time: number; coin: string; side: "long" | "short";
user: string; sizeCoins: number; px: number; notionalUsd: number;
method: "market" | "backstop"; marginType: "cross" | "isolated" | "unknown"; hash: string };
type AshesRes = { ok: true; at: number; source: "Hyperliquid fills"; coverage: string;
stats24h: { count: number; notionalUsd: number; largestUsd: number;
byCoin: { coin: string; count: number; notionalUsd: number }[] };
ashes: Ash[] };
GET /api/ashes?limit=5
Press "Send request" to call the route from this page.05GET /api/radar#
GET
/api/radar?limit=50cache 60 sOpen positions closest to liquidation among tracked large accounts, plus per-coin liquidation heat bands.
limitintegerMax rows (default 50).curl -s "/api/radar?limit=50"
type RadarRow = { user: string; coin: string; side: "long" | "short";
positionValueUsd: number; leverage: number; markPx: number; liqPx: number;
distancePct: number; pLiq24h: number };
type RadarRes = { ok: true; at: number; source: "Hyperliquid"; coverage: string; rows: RadarRow[];
heat: { coin: string; markPx: number; bands: { px: number; longUsd: number; shortUsd: number }[] }[] };
GET /api/radar?limit=5
Press "Send request" to call the route from this page.06GET /api/candles#
GET
/api/candles?coin=BTC&interval=1h&hours=168cache 30 sPassthrough of Hyperliquid candles.
coinstringPerp name, e.g. BTC.intervalstringHyperliquid interval, e.g. 1m, 15m, 1h, 1d.hoursintegerLookback in hours.curl -s "/api/candles?coin=BTC&interval=1h&hours=168"
type Candle = { t: number; o: number; h: number; l: number; c: number; v: number };
type CandlesRes = { ok: true; at: number; source: "Hyperliquid"; coin: string; interval: string; candles: Candle[] };
GET /api/candles?coin=BTC&interval=1h&hours=6
Press "Send request" to call the route from this page.07GET /api/status#
GET
/api/statuscache 15 sLive chain and protocol status: Elysium block, Hyperliquid reachability, contract addresses, launch state.
curl -s "/api/status"
type StatusRes = { ok: true; at: number;
elysium: { ok: boolean; block: number | null; chainId: number };
hyperliquid: { ok: boolean };
contracts: { cover: string; nest: string; oracle: string; token: string };
live: boolean; version: string };
GET /api/status
Press "Send request" to call the route from this page.08Errors#
{ "ok": false, "error": "invalid address" }