Skip to main content
Glama
covalenthq

GoldRush MCP Server

by covalenthq

pool_spot_prices

Retrieve real-time token pair prices from Uniswap V2/V3 and compatible DEX liquidity pools by specifying blockchain network and pool contract address.

Instructions

Get the spot token pair prices for a specified pool contract address. Supports pools on Uniswap V2, V3 and their forks. Required: chainName (blockchain network), contractAddress (pool contract address). Optional: quoteCurrency (price currency) for value conversion. Returns spot token pair prices with pool details and token metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNameYesThe blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet').
contractAddressYesThe liquidity pool contract address to get spot prices for. Must be a valid Uniswap V2/V3 or compatible DEX pool address.
quoteCurrencyNoCurrency to quote pool token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency.

Implementation Reference

  • The `pool_spot_prices` tool registration and handler implementation. It uses `zod` for input validation and `goldRushClient.PricingService.getPoolSpotPrices` to fetch the data.
    server.tool(
        "pool_spot_prices",
        "Get the spot token pair prices for a specified pool contract address. Supports pools on Uniswap V2, V3 and their forks.\n" +
            "Required: chainName (blockchain network), contractAddress (pool contract address).\n" +
            "Optional: quoteCurrency (price currency) for value conversion.\n" +
            "Returns spot token pair prices with pool details and token metadata.",
        {
            chainName: z
                .enum(Object.values(ChainName) as [string, ...string[]])
                .describe(
                    "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
                ),
            contractAddress: z
                .string()
                .describe(
                    "The liquidity pool contract address to get spot prices for. Must be a valid Uniswap V2/V3 or compatible DEX pool address."
                ),
            quoteCurrency: z
                .enum(Object.values(validQuoteValues) as [string, ...string[]])
                .optional()
                .describe(
                    "Currency to quote pool token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."
                ),
        },
        async (params) => {
            try {
                const response =
                    await goldRushClient.PricingService.getPoolSpotPrices(
                        params.chainName as Chain,
                        params.contractAddress,
                        {
                            quoteCurrency: params.quoteCurrency as Quote,
                        }
                    );
                return {
                    content: [
                        {
                            type: "text",
                            text: stringifyWithBigInt(response.data),
                        },
                    ],
                };
            } catch (error) {
                return {
                    content: [{ type: "text", text: `Error: ${error}` }],
                    isError: true,
                };
            }
        }
    );

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