get_trader_profile
Retrieve a trader's complete profile from on-chain data, including trade count, volume, fees, PnL, and activity timestamps across both simple and negrisk markets.
Instructions
Get a trader's profile across both simple and negrisk markets. Shows trade count, volume, fees, PnL, and first/last trade timestamps from on-chain data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Trader wallet address |
Implementation Reference
- mcp-server/src/index.ts:270-325 (handler)The get_trader_profile tool is registered and implemented directly in mcp-server/src/index.ts. It queries both simple and negrisk market subgraphs using a provided user address and combines the results.
server.registerTool( "get_trader_profile", { description: "Get a trader's profile across both simple and negrisk markets. Shows trade count, volume, fees, PnL, and first/last trade timestamps from on-chain data.", inputSchema: { address: z.string().describe("Trader wallet address"), }, }, async ({ address }) => { try { const addr = address.toLowerCase(); const userQuery = `{ user(id: "${addr}") { id tradesCount totalVolumeUSD totalFeesUSD realizedPnlUSD firstTradeAt lastTradeAt } }`; const { simple, negrisk } = await queryBoth(userQuery, userQuery); const s = simple.user; const n = negrisk.user; if (!s && !n) { return textResult({ found: false, message: "No trading activity found for this address" }); } const combined = { address: addr, tradesCount: parseInt(s?.tradesCount || "0") + parseInt(n?.tradesCount || "0"), totalVolumeUSD: parseFloat(s?.totalVolumeUSD || "0") + parseFloat(n?.totalVolumeUSD || "0"), totalFeesUSD: parseFloat(s?.totalFeesUSD || "0") + parseFloat(n?.totalFeesUSD || "0"), realizedPnlUSD: parseFloat(s?.realizedPnlUSD || "0") + parseFloat(n?.realizedPnlUSD || "0"), firstTradeAt: [s?.firstTradeAt, n?.firstTradeAt] .filter(Boolean) .sort()[0] || null, lastTradeAt: [s?.lastTradeAt, n?.lastTradeAt] .filter(Boolean) .sort() .reverse()[0] || null, }; return textResult({ combined, simpleMarkets: s || null, negriskMarkets: n || null, }); } catch (e) { return errorResult(e); } } );