pm_whales
Identify top Polymarket traders by analyzing on-chain data for PnL, volume, and position size to track smart money activity.
Instructions
Get top Polymarket wallets ranked by PnL, volume, or position size. Shows wallet address, total PnL, win rate, and active markets. Cost: $0.005 per query. Source: Polymarket on-chain data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort order (default: pnl) | |
| market_id | No | Filter by specific market ID | |
| limit | No | Maximum results (default 25) |
Implementation Reference
- src/tools/pm.ts:32-57 (registration)Registration and schema definition for the 'pm_whales' tool.
server.registerTool( "pm_whales", { title: "Polymarket Whale Wallets", description: "Get top Polymarket wallets ranked by PnL, volume, or position size. " + "Shows wallet address, total PnL, win rate, and active markets. " + "Cost: $0.005 per query. Source: Polymarket on-chain data.", inputSchema: { sort: z .enum(["pnl", "volume", "positions"]) .optional() .describe("Sort order (default: pnl)"), market_id: z .string() .optional() .describe("Filter by specific market ID"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, }, - src/tools/pm.ts:58-86 (handler)The handler function for the 'pm_whales' tool, which fetches data from the Polymarket API.
async ({ sort, market_id, limit }) => { const res = await apiGet<PmQueryResponse>("/api/v1/pm/whales", { sort: sort ?? "pnl", market_id, 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} Polymarket whale(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, );