get_trader_usdc_flows
Retrieve USDC deposit and withdrawal history for a trader on Polymarket, showing inbound and outbound transfers to track when traders fund or withdraw from the platform.
Instructions
Get USDC deposit/withdrawal history for a trader. Shows inbound and outbound USDC transfers, useful for tracking when traders fund or withdraw from Polymarket.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Ethereum address of the trader | |
| direction | No | Filter by transfer direction | both |
| first | No | Number of transfers to return |
Implementation Reference
- src/index.ts:925-935 (registration)Registration of the 'get_trader_usdc_flows' tool with input schema (address, direction, first)
server.registerTool( "get_trader_usdc_flows", { description: "Get USDC deposit/withdrawal history for a trader. Shows inbound and outbound USDC transfers, useful for tracking when traders fund or withdraw from Polymarket.", inputSchema: { address: z.string().describe("Ethereum address of the trader"), direction: z.enum(["inbound", "outbound", "both"]).default("both").describe("Filter by transfer direction"), first: z.number().min(1).max(100).default(50).describe("Number of transfers to return"), }, }, - src/index.ts:936-959 (handler)Handler function that queries the Traders subgraph for USDC transfer history based on address and direction filter
async ({ address, direction, first }) => { try { const addr = address.toLowerCase(); const dirFilter = direction === "both" ? `trader: "${addr}"` : `trader: "${addr}", isInbound: ${direction === "inbound"}`; const query = `{ usdctransfers(first: ${first}, orderBy: timestamp, orderDirection: desc, where: { ${dirFilter} }) { id from to amount isInbound blockNumber timestamp } }`; const data = await querySubgraph(SUBGRAPHS.traders.ipfsHash, query); return textResult(data); } catch (error) { return errorResult(error); } }