Skip to main content
Glama

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
NameRequiredDescriptionDefault
sortNoSort order (default: pnl)
market_idNoFilter by specific market ID
limitNoMaximum 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)"),
        },
      },
  • 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}` }],
        };
      },
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/carrierone/verilexdata-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server