get_hip3_order_history
Fetch HIP-3 order history with user attribution for case-sensitive coin symbols. Filter by status, type, time range, and user address.
Instructions
Get HIP-3 order history with user attribution (Build+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns order lifecycle events with user addresses.
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 | |
| user | No | User wallet address filter (e.g., '0x1234...') | |
| status | No | Filter orders by status | |
| order_type | No | Filter orders by type |
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:1161-1174 (registration)Registration of the 'get_hip3_order_history' tool via registerHistoryTool. It uses the SDK call api().hyperliquid.hip3.orders.history with Hip3CoinParam, normalizeHip3Coin, and extra schema params for user, status, and order_type.
// HIP-3 Order History registerHistoryTool( "get_hip3_order_history", "Get HIP-3 order history with user attribution (Build+ tier). Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns order lifecycle events with user addresses.", (coin, params) => api().hyperliquid.hip3.orders.history(coin, params as any), Hip3CoinParam, normalizeHip3Coin, { user: UserParam, status: OrderStatusParam, order_type: OrderTypeParam, } ); - src/index.ts:407-438 (handler)The registerHistoryTool helper function that serves as the handler for get_hip3_order_history. It constructs the SDK call parameters (coin, time range, limit, cursor, and extra params like user/status/order_type) and delegates to the SDK's hip3.orders.history method.
// Pattern 4: History with cursor pagination (coin + time range) 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); }); } - src/index.ts:82-97 (schema)The CoinParam, Hip3CoinParam, and other shared schema definitions used by get_hip3_order_history's input validation. Hip3CoinParam defines the CASE-SENSITIVE HIP-3 coin symbols. HistoryParams defines start/end/limit/cursor for time range queries.
const TimestampParam = z .union([z.number(), z.string()]) .optional() .describe("Timestamp as Unix milliseconds or ISO 8601 string"); const LimitParam = z .number() .optional() .describe("Max records to return (default 100, max 1000)"); const CursorParam = z .string() .optional() .describe("Pagination cursor from previous response's nextCursor"); - src/index.ts:299-303 (helper)The normalizeHip3Coin helper function used by get_hip3_order_history to pass through the coin symbol as-is (case-sensitive).
function normalizeHip3Coin(coin: string): string { return coin; // Case-sensitive }