get_open_interest
Retrieve cross-exchange open interest data for perpetual futures contracts to analyze market positioning and trend strength through OI changes and price movements.
Instructions
Get cross-exchange open interest data. Open interest is the total value of outstanding perpetual futures contracts. Rising OI with rising price = new money entering (trend continuation). Rising OI with falling price = new shorts opening (bearish). Falling OI = positions closing (deleveraging). Returns per-exchange OI in USD with 24h change percentages.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exchange | No | Filter by exchange name (e.g., 'binance', 'hyperliquid'). Omit for all exchanges. | |
| type | No | Market type filter (e.g., 'perps'). Omit for default. | |
| limit | No | Number of results to return. Default 250. |
Implementation Reference
- src/tools/open-interest.ts:27-33 (handler)The handler function for 'get_open_interest' tool which calls the API.
export async function handler(args: z.infer<typeof schema>) { return apiGet("/api/v1/market-intelligence/open-interest", { exchange: args.exchange, type: args.type, limit: args.limit, }); } - src/tools/open-interest.ts:12-25 (schema)Input schema definition for the 'get_open_interest' tool.
export const schema = z.object({ exchange: z .string() .optional() .describe("Filter by exchange name (e.g., 'binance', 'hyperliquid'). Omit for all exchanges."), type: z .string() .optional() .describe("Market type filter (e.g., 'perps'). Omit for default."), limit: z .number() .optional() .describe("Number of results to return. Default 250."), }); - src/index.ts:55-79 (registration)Registration loop that registers all imported tools, including 'get_open_interest', to the McpServer instance.
for (const tool of tools) { server.tool(tool.name, tool.description, tool.schema.shape, async (args: Record<string, unknown>) => { const result = await tool.handler(args as any); if (result.ok) { return { content: [ { type: "text" as const, text: JSON.stringify(result.data, null, 2), }, ], }; } else { return { content: [ { type: "text" as const, text: `API Error (${result.status}): ${result.error}`, }, ], isError: true, }; } }); }