pm_micro_depth
Analyze Polymarket order book depth to view bid-ask spreads, liquidity levels, and price distribution for specific markets.
Instructions
Get market depth and bid-ask spread analysis for Polymarket markets. Shows order book depth, spread width, and liquidity at various price levels. Cost: $0.003 per query. Source: Polymarket order book analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market_id | No | Market ID to analyze | |
| min_liquidity | No | Minimum liquidity in USD | |
| limit | No | Maximum results (default 25) |
Implementation Reference
- src/tools/pm_micro.ts:57-84 (handler)The async handler function that executes the pm_micro_depth tool, calling the API endpoint and processing the result.
async ({ market_id, min_liquidity, limit }) => { const res = await apiGet<PmMicroQueryResponse>("/api/v1/pm/micro/depth", { market_id, min_liquidity, limit: limit ?? 25, }); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const warn = stalenessWarning(res); const summary = `${warn}Found ${count} market depth record(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, - src/tools/pm_micro.ts:31-56 (registration)Registration of the pm_micro_depth tool, including its schema and name.
server.registerTool( "pm_micro_depth", { title: "Polymarket Market Depth", description: "Get market depth and bid-ask spread analysis for Polymarket markets. Shows " + "order book depth, spread width, and liquidity at various price levels. " + "Cost: $0.003 per query. Source: Polymarket order book analysis.", inputSchema: { market_id: z .string() .optional() .describe("Market ID to analyze"), min_liquidity: z .number() .optional() .describe("Minimum liquidity in USD"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, },