Skip to main content
Glama
covalenthq

GoldRush MCP Server

by covalenthq

historical_token_prices

Retrieve historical ERC20 and native token price data for specified date ranges across multiple blockchain networks. Query token price history in various currencies to analyze market trends and performance.

Instructions

Get the historical prices of one (or many) large cap ERC20 tokens between specified date ranges. Also supports native tokens. Required: chainName (blockchain network), quoteCurrency (price currency), contractAddress (token contract), from (start date YYYY-MM-DD), to (end date YYYY-MM-DD). Optional: pricesAtAsc (set to true for chronological ascending order, default is false for descending order). Returns historical token prices for the specified time range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNameYesThe blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet').
quoteCurrencyYesCurrency to quote token prices in (e.g., 'USD', 'EUR'). This determines the currency for historical price data.
contractAddressYesThe token contract address to get historical prices for. Use the native token address for native token prices. Supports ENS, RNS, Lens Handle, and Unstoppable Domain resolution.
fromYesStart date for historical price data in YYYY-MM-DD format (e.g., '2023-01-01').
toYesEnd date for historical price data in YYYY-MM-DD format (e.g., '2023-12-31').
pricesAtAscNoSort prices in ascending chronological order. Default is false (descending order, newest first).

Implementation Reference

  • Handler function for historical_token_prices tool.
    async (params) => {
        try {
            const response =
                await goldRushClient.PricingService.getTokenPrices(
                    params.chainName as Chain,
                    params.quoteCurrency as Quote,
                    params.contractAddress,
                    {
                        from: params.from,
                        to: params.to,
                        pricesAtAsc: params.pricesAtAsc,
                    }
                );
            return {
                content: [
                    {
                        type: "text",
                        text: stringifyWithBigInt(response.data),
                    },
                ],
            };
        } catch (error) {
            return {
                content: [{ type: "text", text: `Error: ${error}` }],
                isError: true,
            };
        }
    }
  • Zod schema definition for historical_token_prices inputs.
    {
        chainName: z
            .enum(Object.values(ChainName) as [string, ...string[]])
            .describe(
                "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
            ),
        quoteCurrency: z
            .enum(Object.values(validQuoteValues) as [string, ...string[]])
            .describe(
                "Currency to quote token prices in (e.g., 'USD', 'EUR'). This determines the currency for historical price data."
            ),
        contractAddress: z
            .string()
            .describe(
                "The token contract address to get historical prices for. Use the native token address for native token prices. Supports ENS, RNS, Lens Handle, and Unstoppable Domain resolution."
            ),
        from: z
            .string()
            .describe(
                "Start date for historical price data in YYYY-MM-DD format (e.g., '2023-01-01')."
            ),
        to: z
            .string()
            .describe(
                "End date for historical price data in YYYY-MM-DD format (e.g., '2023-12-31')."
            ),
        pricesAtAsc: z
            .boolean()
            .optional()
            .describe(
                "Sort prices in ascending chronological order. Default is false (descending order, newest first)."
            ),
    },
  • Tool registration for historical_token_prices.
    server.tool(
        "historical_token_prices",
        "Get the historical prices of one (or many) large cap ERC20 tokens between specified date ranges. Also supports native tokens.\n" +
            "Required: chainName (blockchain network), quoteCurrency (price currency), contractAddress (token contract), from (start date YYYY-MM-DD), to (end date YYYY-MM-DD).\n" +
            "Optional: pricesAtAsc (set to true for chronological ascending order, default is false for descending order).\n" +
            "Returns historical token prices for the specified time range.",

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/covalenthq/goldrush-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server