get_hip3_l4_diffs
Retrieve raw order-level changes (diffs) for HIP-3 L4 orderbooks over a specified time range. Supports case-sensitive coin symbols across 125+ markets.
Instructions
Get HIP-3 L4 orderbook diffs (Pro+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns raw order-level changes over a time range.
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:1241-1248 (handler)Registration & handler for 'get_hip3_l4_diffs' tool. Uses the registerHistoryTool helper pattern. The actual handler is an inline arrow function that calls api().hyperliquid.hip3.l4Orderbook.diffs(coin, params).
registerHistoryTool( "get_hip3_l4_diffs", "Get HIP-3 L4 orderbook diffs (Pro+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns raw order-level changes over a time range.", (coin, params) => api().hyperliquid.hip3.l4Orderbook.diffs(coin, params as any), Hip3CoinParam, normalizeHip3Coin ); - src/index.ts:1241-1248 (registration)Registration via registerHistoryTool helper. The tool is registered under the name 'get_hip3_l4_diffs' with description, input schema (Hip3CoinParam + HistoryParams), output schema (ListOutputSchema), and async handler.
registerHistoryTool( "get_hip3_l4_diffs", "Get HIP-3 L4 orderbook diffs (Pro+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns raw order-level changes over a time range.", (coin, params) => api().hyperliquid.hip3.l4Orderbook.diffs(coin, params as any), Hip3CoinParam, normalizeHip3Coin ); - src/index.ts:57-62 (schema)Input schema for the 'coin' parameter — a case-sensitive HIP-3 coin symbol string.
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:95-96 (schema)Input schema for optional pagination cursor, included via HistoryParams spread.
.optional() .describe("Pagination cursor from previous response's nextCursor"); - src/index.ts:408-438 (helper)Generic helper 'registerHistoryTool' used by get_hip3_l4_diffs. It builds the combined input schema (coin + history params + extra), constructs SDK params with time range resolution, and calls the provided sdkCall function.
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); }); }