get_hip3_l2_diffs
Retrieve HIP-3 L2 orderbook diffs showing price-level changes for case-sensitive coin symbols across 6 builders. Supports time range filters and pagination.
Instructions
Get HIP-3 L2 tick-level orderbook diffs (Pro+ tier). Symbols are CASE-SENSITIVE. Returns price-level changes.
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. | |
| start | No | Start timestamp (Unix ms or ISO). Defaults to 24h ago. | |
| end | No | End timestamp (Unix ms or ISO). Defaults to now. | |
| limit | No | Max records to return (default 100, max 1000) | |
| cursor | No | Pagination cursor from previous response's nextCursor |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | Array of result records | |
| count | Yes | Total number of records in the full result set | |
| nextCursor | No | Cursor for next page, if more results available |
Implementation Reference
- src/index.ts:1297-1305 (registration)Registration of the 'get_hip3_l2_diffs' tool using registerHistoryTool helper. It accepts a HIP-3 coin symbol (case-sensitive), time range params (start, end, limit, cursor), and calls api().hyperliquid.hip3.l2Orderbook.diffs(coin, params).
// HIP-3 L2 Diffs registerHistoryTool( "get_hip3_l2_diffs", "Get HIP-3 L2 tick-level orderbook diffs (Pro+ tier). Symbols are CASE-SENSITIVE. Returns price-level changes.", (coin, params) => api().hyperliquid.hip3.l2Orderbook.diffs(coin, params as any), Hip3CoinParam, normalizeHip3Coin ); - src/index.ts:1298-1305 (handler)The handler for 'get_hip3_l2_diffs' is an inline arrow function that takes (coin, params) and returns api().hyperliquid.hip3.l2Orderbook.diffs(coin, params as any). It is wrapped by the registerHistoryTool pattern which handles time range resolution, pagination via cursor, and formatting.
registerHistoryTool( "get_hip3_l2_diffs", "Get HIP-3 L2 tick-level orderbook diffs (Pro+ tier). Symbols are CASE-SENSITIVE. Returns price-level changes.", (coin, params) => api().hyperliquid.hip3.l2Orderbook.diffs(coin, params as any), Hip3CoinParam, normalizeHip3Coin ); - src/index.ts:57-61 (schema)The Hip3CoinParam Zod schema used as the coin parameter input schema for the HIP-3 tool. It describes the case-sensitive coin symbols (e.g. 'km:US500', 'xyz:GOLD').
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:129-136 (schema)The ListOutputSchema Zod schema used as the output schema for the tool. Defines the shape of responses: records array, count number, and optional nextCursor.
const ListOutputSchema: ZodRawShape = { records: z.array(z.record(z.unknown())).describe("Array of result records"), count: z.number().describe("Total number of records in the full result set"), nextCursor: z .string() .optional() .describe("Cursor for next page, if more results available"), }; - src/index.ts:408-438 (helper)The registerHistoryTool helper function that wires up the tool registration. It handles time range resolution (resolveTimeRange), limit defaults, cursor passthrough, and formats responses via formatCursorResponse. This is the pattern used to register get_hip3_l2_diffs.
function registerHistoryTool( name: string, description: string, sdkCall: (coin: string, params: Record<string, unknown>) => Promise<{ data: unknown; nextCursor?: string }>, coinSchema: z.ZodString, normFn: (coin: string) => string, extraSchema?: ZodRawShape ): void { const schema: ZodRawShape = { coin: coinSchema, ...HistoryParams }; if (extraSchema) Object.assign(schema, extraSchema); registerTool(name, description, schema, ListOutputSchema, async (params) => { const { coin, start, end, limit, cursor, ...extra } = params; const timeRange = resolveTimeRange(start, end); const sdkParams: Record<string, unknown> = { ...timeRange, limit: resolveLimit(limit), }; if (cursor) sdkParams.cursor = cursor; // Pass through extra params (interval, side, etc.) for (const [k, v] of Object.entries(extra)) { if (v !== undefined) sdkParams[k] = v; } const result = await sdkCall(normFn(coin), sdkParams); return formatCursorResponse(result); }); }