get_market_trades
Retrieve recent trades for a Polymarket prediction market, showing trader, side, size, price, and timestamp to analyze market activity.
Instructions
Get recent trades for a Polymarket market. Shows who traded, which side, size, price, and timestamp.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| condition_id | Yes | Market condition ID | |
| limit | No | Number of trades to return | |
| offset | No | Pagination offset |
Implementation Reference
- src/tools/data/trades.ts:6-29 (handler)The tool "get_market_trades" is defined and registered here. The handler logic uses dataApi.getTrades to fetch market trade information.
server.tool( "get_market_trades", "Get recent trades for a Polymarket market. Shows who traded, which side, size, price, and timestamp.", { condition_id: z.string().describe("Market condition ID"), limit: z.number().min(1).max(500).default(20).describe("Number of trades to return"), offset: z.number().min(0).default(0).describe("Pagination offset"), }, async (args) => { try { const data = await dataApi.getTrades({ conditionId: args.condition_id, limit: args.limit, offset: args.offset, }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${(error as Error).message}` }], isError: true, }; } }, );