pulse_trader_daily_stats
Retrieves a trader's daily PnL, trade count, win rate, and volume for each active day. Use for deep due diligence and consistency analysis.
Instructions
Get day-by-day performance breakdown for any trader. Returns daily PnL, trade count, win rate, and volume for each day the trader was active. Use for deep due diligence and identifying consistency patterns.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| useToonFormat | No | Return data in compact toon format (default: true). Set to false for standard JSON. | |
| address | Yes | Ethereum wallet address (0x...) |
Implementation Reference
- src/index.ts:726-738 (registration)Registration of the 'pulse_trader_daily_stats' MCP tool with its description, input schema (useToonFormat + Ethereum address), and handler that calls the API endpoint /pulse/trader/{address}/daily
// TOOL 17: Trader Daily Stats // ══════════════════════════════════════════════════════════ if (shouldRegister("pulse_trader_daily_stats")) server.registerTool( "pulse_trader_daily_stats", { description: "Get day-by-day performance breakdown for any trader. Returns daily PnL, trade count, win rate, and volume for each day the trader was active. Use for deep due diligence and identifying consistency patterns.", inputSchema: { useToonFormat: useToonFormatSchema, address: ethAddressSchema, }, }, async ({ useToonFormat, address }) => toolResult(await callAPI(useToonFormat, `/pulse/trader/${address}/daily`)) ); - src/index.ts:737-738 (handler)Handler function for pulse_trader_daily_stats - takes useToonFormat and address parameters, calls the backend API at /pulse/trader/{address}/daily to fetch the trader's daily stats, and formats the result
async ({ useToonFormat, address }) => toolResult(await callAPI(useToonFormat, `/pulse/trader/${address}/daily`)) ); - src/index.ts:732-735 (schema)Input validation schema for pulse_trader_daily_stats: useToonFormat boolean (default true) and address validated as Ethereum address (0x followed by 40 hex chars)
inputSchema: { useToonFormat: useToonFormatSchema, address: ethAddressSchema, }, - src/index.ts:94-166 (helper)The callAPI helper is used by the handler to make HTTP requests to the Coinversa API backend with timeout, retries, and error handling. The handler calls it with path `/pulse/trader/${address}/daily`.
async function callAPI(useToon: boolean, path: string, params?: Record<string, string>): Promise<any> { const url = new URL(`${BASE}${path}`); if (params) { Object.entries(params).forEach(([key, value]) => { if (value !== undefined && value !== "") { url.searchParams.set(key, value); } }); } let lastError: Error | null = null; for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) { try { const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS); const headers: Record<string, string> = {}; if (API_KEY) headers["X-API-Key"] = API_KEY; const response = await fetch(url.toString(), { headers, signal: controller.signal, }); clearTimeout(timeout); if (response.status === 429) { // Rate limited — retry after delay if (attempt < MAX_RETRIES) { await new Promise((r) => setTimeout(r, RETRY_DELAY_MS * (attempt + 1))); continue; } throw new Error("Rate limit exceeded. Please wait a moment and try again."); } if (response.status === 404) { throw new Error("Not found. The requested resource does not exist — check the address or symbol."); } if (response.status === 401) { throw new Error("Invalid API key. Check your COINVERSAA_API_KEY environment variable."); } if (!response.ok) { const body = await response.json().catch(() => null); const msg = body?.error || response.statusText; throw new Error(`Request failed (${response.status}): ${msg}`); } const data = await response.json(); return useToon ? toonEncode(data) : data; } catch (err: any) { if (err.name === "AbortError") { lastError = new Error("Request timed out after 30 seconds. The server may be under heavy load — try again."); } else if (err.cause?.code === "ECONNREFUSED" || err.cause?.code === "ENOTFOUND") { lastError = new Error("Cannot connect to the Coinversa API. Check your COINVERSAA_API_URL setting and network connection."); } else { lastError = err; } // Retry on transient network errors if (attempt < MAX_RETRIES && (err.name === "AbortError" || err.cause?.code === "ECONNRESET")) { await new Promise((r) => setTimeout(r, RETRY_DELAY_MS * (attempt + 1))); continue; } throw lastError; } } throw lastError || new Error("Request failed after retries"); }