get_trades
Retrieve trade history for your team in the Trading Simulator, with options to filter by token address, blockchain type, and manage pagination using limit and offset parameters.
Instructions
Get trade history for your team
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Filter by blockchain type | |
| limit | No | Maximum number of trades to retrieve (default: 20) | |
| offset | No | Offset for pagination | |
| token | No | Filter by token address |
Implementation Reference
- src/index.ts:476-492 (handler)The handler function for the 'get_trades' tool within the CallToolRequestSchema switch statement. It validates input arguments, constructs TradeHistoryParams, calls tradingClient.getTradeHistory(), and returns the response as JSON.case "get_trades": { if (!args || typeof args !== "object") { throw new Error("Invalid arguments for get_trades"); } const tradeParams: TradeHistoryParams = {}; if ("limit" in args) tradeParams.limit = args.limit as number; if ("offset" in args) tradeParams.offset = args.offset as number; if ("token" in args) tradeParams.token = args.token as string; if ("chain" in args) tradeParams.chain = args.chain as BlockchainType; const response = await tradingClient.getTradeHistory(tradeParams); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }], isError: false }; }
- src/index.ts:130-157 (registration)Registration of the 'get_trades' tool in the TRADING_SIM_TOOLS array, including name, description, and input schema. This array is returned by ListToolsRequestSchema handler.{ name: "get_trades", description: "Get trade history for your team", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of trades to retrieve (default: 20)" }, offset: { type: "number", description: "Offset for pagination" }, token: { type: "string", description: "Filter by token address" }, chain: { type: "string", enum: ["svm", "evm"], description: "Filter by blockchain type" } }, additionalProperties: false, $schema: "http://json-schema.org/draft-07/schema#" } },
- src/types.ts:84-89 (schema)TypeScript interface definition for TradeHistoryParams, used to type the parameters passed to tradingClient.getTradeHistory in the get_trades handler.export interface TradeHistoryParams { limit?: number; offset?: number; token?: string; chain?: BlockchainType; }