get_hip3_order_flow
Get aggregated order placement, cancellation, and fill metrics for HIP-3 coins. Specify a case-sensitive symbol like 'km:US500' and optional time range and interval.
Instructions
Get HIP-3 order flow aggregation (Build+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns aggregated order placement, cancellation, and fill metrics.
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 | |
| interval | No | Aggregation interval (default '1h') |
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:1187-1202 (handler)Handler function for the 'get_hip3_order_flow' tool. Extracts coin, start, end, limit, cursor, and interval params, resolves the time range, builds SDK params, calls api().hyperliquid.hip3.orders.flow() with the normalized HIP-3 coin, and returns formatted cursor response.
async (params) => { const { coin, start, end, limit, cursor, interval } = params; const timeRange = resolveTimeRange(start, end); const sdkParams: Record<string, unknown> = { ...timeRange, limit: resolveLimit(limit), }; if (cursor) sdkParams.cursor = cursor; if (interval) sdkParams.interval = interval; const result = await api().hyperliquid.hip3.orders.flow( normalizeHip3Coin(coin), sdkParams as any ); return formatCursorResponse(result); } ); - src/index.ts:1180-1186 (schema)Input schema for get_hip3_order_flow: coin (HIP-3 case-sensitive symbol), HistoryParams (start, end, limit, cursor), and optional interval (1m, 5m, 15m, 30m, 1h, 4h, 1d). Uses ListOutputSchema for output.
{ coin: Hip3CoinParam, ...HistoryParams, interval: z.enum(["1m", "5m", "15m", "30m", "1h", "4h", "1d"]).optional() .describe("Aggregation interval (default '1h')"), }, ListOutputSchema, - src/index.ts:1177-1202 (registration)Registration of the 'get_hip3_order_flow' tool using registerTool() with description, input schema (coin, HistoryParams, interval), output schema (ListOutputSchema), and the handler function.
registerTool( "get_hip3_order_flow", "Get HIP-3 order flow aggregation (Build+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns aggregated order placement, cancellation, and fill metrics.", { coin: Hip3CoinParam, ...HistoryParams, interval: z.enum(["1m", "5m", "15m", "30m", "1h", "4h", "1d"]).optional() .describe("Aggregation interval (default '1h')"), }, ListOutputSchema, async (params) => { const { coin, start, end, limit, cursor, interval } = params; const timeRange = resolveTimeRange(start, end); const sdkParams: Record<string, unknown> = { ...timeRange, limit: resolveLimit(limit), }; if (cursor) sdkParams.cursor = cursor; if (interval) sdkParams.interval = interval; const result = await api().hyperliquid.hip3.orders.flow( normalizeHip3Coin(coin), sdkParams as any ); return formatCursorResponse(result); } ); - src/index.ts:300-302 (helper)Helper normalizeHip3Coin used by the handler to pass the coin symbol through as-is (HIP-3 symbols are case-sensitive).
function normalizeHip3Coin(coin: string): string { return coin; // Case-sensitive } - src/index.ts:147-154 (helper)Helper toUnixMs converts timestamps (number or ISO string) to Unix milliseconds, used by resolveTimeRange in the handler.
function toUnixMs(ts: number | string): number { if (typeof ts === "number") return ts; // MCP/JSON-RPC may deliver numeric timestamps as strings if (/^\d+$/.test(ts)) return Number(ts); const parsed = Date.parse(ts); if (isNaN(parsed)) throw new Error(`Invalid timestamp: "${ts}"`); return parsed; }