get_spot_pair
Retrieve detailed information for a Hyperliquid spot trading pair by its dashed canonical symbol, including base and quote assets, wire symbol, asset index, decimals, latest mark and mid price, and active status.
Instructions
Get details for a single Hyperliquid Spot pair by dashed canonical symbol (e.g. 'HYPE-USDC'). Returns base/quote asset, wire symbol, asset index, decimals, latest mark/mid price, and active status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | Hyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |
Implementation Reference
- src/index.ts:1322-1329 (handler)The handler for the 'get_spot_pair' tool. Uses the registerCurrentTool helper which wraps the SDK call api().spot.pairs.get(coin) with the SpotCoinParam schema and normalizeSpotCoin normalization. Returns details for a single Hyperliquid Spot pair by dashed canonical symbol (e.g. 'HYPE-USDC').
// Spot Pair (single) registerCurrentTool( "get_spot_pair", "Get details for a single Hyperliquid Spot pair by dashed canonical symbol (e.g. 'HYPE-USDC'). Returns base/quote asset, wire symbol, asset index, decimals, latest mark/mid price, and active status.", (coin) => api().spot.pairs.get(coin), SpotCoinParam, normalizeSpotCoin ); - src/index.ts:77-81 (schema)The SpotCoinParam Zod schema used as the input schema for get_spot_pair. It accepts a string describing a Hyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available.
const SpotCoinParam = z .string() .describe( "Hyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all." ); - src/index.ts:320-322 (helper)The normalizeSpotCoin helper function used to normalize the coin symbol to uppercase before passing to the SDK.
function normalizeSpotCoin(coin: string): string { return coin.toUpperCase(); } - src/index.ts:328-357 (registration)The registerCurrentTool helper is the generic registration mechanism used by get_spot_pair. It accepts a name, description, coinSchema, normFn, and SDK call, and registers the tool via registerTool which handles API key checks, error formatting, and delegating to the SDK.
function registerTool( name: string, description: string, inputSchema: ZodRawShape, outputSchema: ZodRawShape, handler: (params: any) => Promise<McpContent> ): void { server.registerTool( name, { description, inputSchema, outputSchema, annotations: TOOL_ANNOTATIONS, }, async (params: any) => { if (!client) { return { content: [{ type: "text" as const, text: MISSING_KEY_MESSAGE }], isError: true, }; } try { return await handler(params); } catch (err) { const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500); return formatError(error); } } );