get_hip3_open_interest
Get the current HIP-3 open interest for a coin, along with mark price and oracle price. Use the case-sensitive symbol (e.g., 'km:US500').
Instructions
Get the current HIP-3 open interest for a coin. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns OI, mark price, and oracle price.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | HIP-3 coin symbol (CASE-SENSITIVE). 125+ markets across 6 builders: xyz, flx, hyna, km, vntl, cash. Examples: 'km:US500', 'xyz:GOLD', 'hyna:BTC', 'vntl:SPACEX', 'flx:TSLA', 'cash:NVDA'. Use get_hip3_instruments to list all. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |
Implementation Reference
- src/index.ts:730-737 (registration)Registration of the get_hip3_open_interest tool via registerCurrentTool helper, which sets up name, description, input schema (Hip3CoinParam), output schema (ObjectOutputSchema), and handler that calls api().hyperliquid.hip3.openInterest.current(coin).
// 21. HIP-3 Open Interest Current registerCurrentTool( "get_hip3_open_interest", "Get the current HIP-3 open interest for a coin. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns OI, mark price, and oracle price.", (coin) => api().hyperliquid.hip3.openInterest.current(coin), Hip3CoinParam, normalizeHip3Coin ); - src/index.ts:57-62 (schema)Input schema (Hip3CoinParam) used by the tool — a case-sensitive string parameter for HIP-3 coin symbols.
const Hip3CoinParam = z .string() .describe( "HIP-3 coin symbol (CASE-SENSITIVE). 125+ markets across 6 builders: xyz, flx, hyna, km, vntl, cash. Examples: 'km:US500', 'xyz:GOLD', 'hyna:BTC', 'vntl:SPACEX', 'flx:TSLA', 'cash:NVDA'. Use get_hip3_instruments to list all." ); - src/index.ts:328-358 (helper)Generic registerTool helper that wraps tool registration with API key guard and error handling.
function registerTool( name: string, description: string, inputSchema: ZodRawShape, outputSchema: ZodRawShape, handler: (params: any) => Promise<McpContent> ): void { server.registerTool( name, { description, inputSchema, outputSchema, annotations: TOOL_ANNOTATIONS, }, async (params: any) => { if (!client) { return { content: [{ type: "text" as const, text: MISSING_KEY_MESSAGE }], isError: true, }; } try { return await handler(params); } catch (err) { const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500); return formatError(error); } } ); } - src/index.ts:372-384 (helper)registerCurrentTool helper pattern used to register get_hip3_open_interest — takes a coin parameter, normalizes it, calls the SDK, and formats the response.
// Pattern 2: Current snapshot (coin only) function registerCurrentTool( name: string, description: string, sdkCall: (coin: string) => Promise<unknown>, coinSchema: z.ZodString, normFn: (coin: string) => string ): void { registerTool(name, description, { coin: coinSchema }, ObjectOutputSchema, async (params) => { const data = await sdkCall(normFn(params.coin)); return formatResponse(data); }); } - src/index.ts:300-302 (helper)Normalization helper for HIP-3 coins (pass-through since HIP-3 symbols are case-sensitive).
function normalizeHip3Coin(coin: string): string { return coin; // Case-sensitive }