pm_micro_thin
Identify markets with thin order books that risk slippage or manipulation by detecting liquidity below specified thresholds and analyzing spread metrics.
Instructions
Detect markets with thin order books that may be susceptible to slippage or manipulation. Shows markets below a liquidity threshold with spread metrics. Cost: $0.005 per query. Source: Polymarket order book analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threshold | No | Liquidity threshold in USD (markets below this are flagged) | |
| limit | No | Maximum results (default 25) |
Implementation Reference
- src/tools/pm_micro.ts:89-138 (handler)The 'pm_micro_thin' tool is registered and implemented within 'src/tools/pm_micro.ts'. The handler makes an API call to '/api/v1/pm/micro/thin' and processes the result.
server.registerTool( "pm_micro_thin", { title: "Polymarket Thin Book Detection", description: "Detect markets with thin order books that may be susceptible to slippage or " + "manipulation. Shows markets below a liquidity threshold with spread metrics. " + "Cost: $0.005 per query. Source: Polymarket order book analysis.", inputSchema: { threshold: z .number() .optional() .describe("Liquidity threshold in USD (markets below this are flagged)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, }, async ({ threshold, limit }) => { const res = await apiGet<PmMicroQueryResponse>("/api/v1/pm/micro/thin", { threshold: threshold ?? 50, 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} thin book market(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, );