market_historical_oi
Retrieve historical hourly open interest snapshots (notional USD) for a specific coin or the global exchange aggregate, with a maximum range of 30 days.
Instructions
Get historical hourly open interest snapshots (notional USD). Supports per-coin filtering or global exchange aggregation. Max range is 30 days.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| useToonFormat | No | Return data in compact toon format (default: true). Set to false for standard JSON. | |
| coin | No | Filter by coin symbol (e.g. BTC, ETH, SOL). For builder dex: prefix:COIN (e.g. xyz:SILVER). Omit for global exchange aggregate. | |
| since | No | Time window for history (max 30d). e.g. '24h', '7d', '30d' | |
| startTime | No | Explicit start time (ISO string or timestamp). Overrides 'since'. | |
| endTime | No | Explicit end time (ISO string or timestamp). Defaults to now. |
Implementation Reference
- src/index.ts:919-937 (registration)Registration of the market_historical_oi tool on the MCP server. Uses server.tool() (not server.registerTool()), meaning it's always registered regardless of API key presence. The tool fetches historical hourly open interest snapshots from the /market/historical-oi API endpoint.
if (shouldRegister("market_historical_oi")) server.tool( "market_historical_oi", "Get historical hourly open interest snapshots (notional USD). Supports per-coin filtering or global exchange aggregation. Max range is 30 days.", { useToonFormat: useToonFormatSchema, coin: z.string().optional().describe("Filter by coin symbol (e.g. BTC, ETH, SOL). For builder dex: prefix:COIN (e.g. xyz:SILVER). Omit for global exchange aggregate."), since: sinceSchema.optional().describe("Time window for history (max 30d). e.g. '24h', '7d', '30d'"), startTime: z.string().optional().describe("Explicit start time (ISO string or timestamp). Overrides 'since'."), endTime: z.string().optional().describe("Explicit end time (ISO string or timestamp). Defaults to now."), }, async ({ useToonFormat, coin, since, startTime, endTime }) => { const params: Record<string, string> = {}; if (since) params.since = since; if (startTime) params.startTime = startTime; if (endTime) params.endTime = endTime; if (coin) params.coin = normalizeCoin(coin); return toolResult(await callAPI(useToonFormat, "/market/historical-oi", params)); } ); - src/index.ts:922-928 (schema)Input schema for the market_historical_oi tool. Accepts: useToonFormat (bool), coin (optional symbol filter), since (optional time window string like '24h'), startTime (optional ISO override for since), endTime (optional end bound, defaults to now).
{ useToonFormat: useToonFormatSchema, coin: z.string().optional().describe("Filter by coin symbol (e.g. BTC, ETH, SOL). For builder dex: prefix:COIN (e.g. xyz:SILVER). Omit for global exchange aggregate."), since: sinceSchema.optional().describe("Time window for history (max 30d). e.g. '24h', '7d', '30d'"), startTime: z.string().optional().describe("Explicit start time (ISO string or timestamp). Overrides 'since'."), endTime: z.string().optional().describe("Explicit end time (ISO string or timestamp). Defaults to now."), }, - src/index.ts:929-936 (handler)Handler function for market_historical_oi. Builds query params from inputs (since, startTime, endTime, coin with normalizeCoin), then calls the API helper to GET /market/historical-oi on the Coinversa API.
async ({ useToonFormat, coin, since, startTime, endTime }) => { const params: Record<string, string> = {}; if (since) params.since = since; if (startTime) params.startTime = startTime; if (endTime) params.endTime = endTime; if (coin) params.coin = normalizeCoin(coin); return toolResult(await callAPI(useToonFormat, "/market/historical-oi", params)); }