live_official_oi
Retrieve official per-dex open interest from Hyperliquid's Info API. Get hourly snapshots with open interest, mark price, and 24h volume to cross-check computed OI with venue-reported ground truth.
Instructions
Official per-dex open interest for a coin, sourced from Hyperliquid's Info API (not derived from live_positions). Returns hourly snapshots with open interest, mark price, and 24h notional volume. Use when an agent needs venue-reported ground truth, per-dex breakdown, or wants to cross-check computed OI against official numbers. Default 7 days, max 30 days.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| useToonFormat | No | Return data in compact toon format (default: true). Set to false for standard JSON. | |
| coin | Yes | Coin symbol (e.g. BTC, ETH, SOL). Use the bare ticker — dex is supplied via the 'dex' parameter, not prefix. | |
| hours | No | Number of hours of history (default 168 = 7 days, max 720 = 30 days) | |
| dex | No | Which dex's official OI to return. Defaults to 'hl' (native Hyperliquid). | hl |
Implementation Reference
- src/index.ts:1029-1045 (registration)Registration of the 'live_official_oi' tool with its schema (coin, hours, dex params) and handler that calls the /live/official-oi/{COIN} API endpoint.
if (shouldRegister("live_official_oi")) server.registerTool( "live_official_oi", { description: "Official per-dex open interest for a coin, sourced from Hyperliquid's Info API (not derived from live_positions). Returns hourly snapshots with open interest, mark price, and 24h notional volume. Use when an agent needs venue-reported ground truth, per-dex breakdown, or wants to cross-check computed OI against official numbers. Default 7 days, max 30 days.", inputSchema: { useToonFormat: useToonFormatSchema, coin: z.string().min(1).max(40).describe("Coin symbol (e.g. BTC, ETH, SOL). Use the bare ticker — dex is supplied via the 'dex' parameter, not prefix."), hours: z.number().min(1).max(720).default(168).describe("Number of hours of history (default 168 = 7 days, max 720 = 30 days)"), dex: z.enum(["hl", "xyz", "flx", "vntl", "hyna", "km", "abcd", "cash"]).optional().default("hl").describe("Which dex's official OI to return. Defaults to 'hl' (native Hyperliquid)."), }, }, async ({ useToonFormat, coin, hours, dex }) => { const params: Record<string, string> = { hours: String(hours) }; if (dex) params.dex = dex; return toolResult(await callAPI(useToonFormat, `/live/official-oi/${coin.toUpperCase()}`, params)); } ); - src/index.ts:1040-1044 (handler)Handler function for live_official_oi that constructs API request to /live/official-oi/{COIN} with hours and dex parameters, then returns the result.
async ({ useToonFormat, coin, hours, dex }) => { const params: Record<string, string> = { hours: String(hours) }; if (dex) params.dex = dex; return toolResult(await callAPI(useToonFormat, `/live/official-oi/${coin.toUpperCase()}`, params)); } - src/index.ts:1033-1039 (schema)Input schema for live_official_oi: useToonFormat (boolean), coin (string 1-40 chars), hours (number 1-720, default 168), dex (enum of dex names, default 'hl').
inputSchema: { useToonFormat: useToonFormatSchema, coin: z.string().min(1).max(40).describe("Coin symbol (e.g. BTC, ETH, SOL). Use the bare ticker — dex is supplied via the 'dex' parameter, not prefix."), hours: z.number().min(1).max(720).default(168).describe("Number of hours of history (default 168 = 7 days, max 720 = 30 days)"), dex: z.enum(["hl", "xyz", "flx", "vntl", "hyna", "km", "abcd", "cash"]).optional().default("hl").describe("Which dex's official OI to return. Defaults to 'hl' (native Hyperliquid)."), }, },