get_hip3_orderbook
Access real-time orderbook data for HIP-3 prediction market symbols. Get bids, asks, and mid price for case-sensitive symbols like km:US500.
Instructions
Get the current HIP-3 orderbook snapshot. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns bids, asks, mid price. Free tier: km:US500 only. Build+: all HIP-3 symbols.
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. | |
| depth | No | Orderbook depth — number of price levels per side |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |
Implementation Reference
- src/index.ts:652-659 (registration)Registration of the get_hip3_orderbook tool using the registerOrderbookTool helper. The handler calls api().hyperliquid.hip3.orderbook.get(coin, params) via the SDK, accepts Hip3CoinParam (case-sensitive) and optional DepthParam, and outputs ObjectOutputSchema.
// 17. HIP-3 Orderbook registerOrderbookTool( "get_hip3_orderbook", "Get the current HIP-3 orderbook snapshot. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns bids, asks, mid price. Free tier: km:US500 only. Build+: all HIP-3 symbols.", (coin, params) => api().hyperliquid.hip3.orderbook.get(coin, params), Hip3CoinParam, normalizeHip3Coin ); - src/index.ts:386-405 (handler)The generic registerOrderbookTool helper function used by get_hip3_orderbook. It wraps registerTool, normalizes the coin via normFn, passes optional depth, and formats the response.
// Pattern 3: Orderbook snapshot (coin + optional depth) function registerOrderbookTool( name: string, description: string, sdkCall: (coin: string, params?: { depth?: number }) => Promise<unknown>, coinSchema: z.ZodString, normFn: (coin: string) => string ): void { registerTool( name, description, { coin: coinSchema, depth: DepthParam }, ObjectOutputSchema, async (params) => { const sdkParams = params.depth ? { depth: params.depth } : undefined; const data = await sdkCall(normFn(params.coin), sdkParams); return formatResponse(data); } ); } - src/index.ts:57-61 (schema)Input schema for HIP-3 coin parameter — a case-sensitive string. Used by get_hip3_orderbook as the coin input.
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:98-101 (schema)Optional depth parameter for the orderbook, controlling the number of price levels per side.
const DepthParam = z .number() .optional() .describe("Orderbook depth — number of price levels per side"); - src/index.ts:300-302 (helper)Normalization helper for HIP-3 coins — returns the coin as-is (case-sensitive, unlike Hyperliquid coins which are uppercased).
function normalizeHip3Coin(coin: string): string { return coin; // Case-sensitive }