get_spot_trades_recent
Retrieve the latest Hyperliquid Spot trades for a dashed canonical pair (e.g., HYPE-USDC). Returns recent trades without needing a time range.
Instructions
Get the most recent Hyperliquid Spot trades for a pair. Symbols are dashed canonical (e.g. 'HYPE-USDC'). Returns the latest trades without needing a time range. Live since 2026-05-05.
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. | |
| limit | No | Max records to return (default 100, max 1000) |
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:1362-1378 (registration)Registration of the 'get_spot_trades_recent' tool on the MCP server via server.registerTool(). Defines name, description, input schema (coin + limit), and handler.
// Spot Recent Trades registerTool( "get_spot_trades_recent", "Get the most recent Hyperliquid Spot trades for a pair. Symbols are dashed canonical (e.g. 'HYPE-USDC'). Returns the latest trades without needing a time range. Live since 2026-05-05.", { coin: SpotCoinParam, limit: LimitParam, }, ListOutputSchema, async (params) => { const data = await api().spot.trades.recent( normalizeSpotCoin(params.coin), params.limit ); return formatResponse(data); } ); - src/index.ts:1366-1370 (schema)Input schema for get_spot_trades_recent: SpotCoinParam (dashed canonical pair, e.g. 'HYPE-USDC') and optional LimitParam.
{ coin: SpotCoinParam, limit: LimitParam, }, ListOutputSchema, - src/index.ts:1370-1370 (schema)Output schema: ListOutputSchema with records array, count, and optional nextCursor.
ListOutputSchema, - src/index.ts:1371-1377 (handler)Handler function that calls api().spot.trades.recent() with the normalized coin symbol and limit, then formats the response.
async (params) => { const data = await api().spot.trades.recent( normalizeSpotCoin(params.coin), params.limit ); return formatResponse(data); } - src/index.ts:320-322 (helper)Helper normalizeSpotCoin function that uppercases the coin symbol before API call.
function normalizeSpotCoin(coin: string): string { return coin.toUpperCase(); }