historical_portfolio_value
Track daily portfolio value changes for a wallet address across tokens on a blockchain network. Analyze value trends over a specified timeframe with optional currency conversion.
Instructions
Commonly used to render a daily portfolio balance for an address broken down by the token. Required: chainName (blockchain network), walletAddress (wallet address). Optional: quoteCurrency for value conversion, days (timeframe to analyze, default 7). Returns portfolio value time series data showing value changes over the specified timeframe.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainName | Yes | The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet'). | |
| walletAddress | Yes | The wallet address to get portfolio history for. Passing in an ENS, RNS, Lens Handle, or an Unstoppable Domain resolves automatically. | |
| quoteCurrency | No | Currency to quote portfolio values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency. | |
| days | No | Number of days of historical data to retrieve. Default is 7 days. |
Implementation Reference
- src/services/BalanceService.ts:244-265 (handler)The handler for the historical_portfolio_value tool, which calls goldRushClient.BalanceService.getHistoricalPortfolioForWalletAddress.
async (params) => { try { const response = await goldRushClient.BalanceService.getHistoricalPortfolioForWalletAddress( params.chainName as Chain, params.walletAddress, { quoteCurrency: params.quoteCurrency as Quote, days: params.days, } ); return { content: [ { type: "text", text: stringifyWithBigInt(response.data), }, ], }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error}` }], - The Zod schema validation for the historical_portfolio_value tool parameters.
{ chainName: z .enum(Object.values(ChainName) as [string, ...string[]]) .describe( "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')." ), walletAddress: z .string() .describe( "The wallet address to get portfolio history for. Passing in an ENS, RNS, Lens Handle, or an Unstoppable Domain resolves automatically." ), quoteCurrency: z .enum(Object.values(validQuoteValues) as [string, ...string[]]) .optional() .describe( "Currency to quote portfolio values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency." ), days: z .number() .optional() .default(7) .describe( "Number of days of historical data to retrieve. Default is 7 days." ), }, - src/services/BalanceService.ts:213-243 (registration)The MCP tool registration for historical_portfolio_value.
server.tool( "historical_portfolio_value", "Commonly used to render a daily portfolio balance for an address broken down by the token. " + "Required: chainName (blockchain network), walletAddress (wallet address). " + "Optional: quoteCurrency for value conversion, days (timeframe to analyze, default 7). " + "Returns portfolio value time series data showing value changes over the specified timeframe.", { chainName: z .enum(Object.values(ChainName) as [string, ...string[]]) .describe( "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')." ), walletAddress: z .string() .describe( "The wallet address to get portfolio history for. Passing in an ENS, RNS, Lens Handle, or an Unstoppable Domain resolves automatically." ), quoteCurrency: z .enum(Object.values(validQuoteValues) as [string, ...string[]]) .optional() .describe( "Currency to quote portfolio values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency." ), days: z .number() .optional() .default(7) .describe( "Number of days of historical data to retrieve. Default is 7 days." ), },