get_etf_price_by_symbol
Retrieve current ETF price data from Paloma DEX using token symbols like PAGOLD or PABTC2X for cross-chain trading analysis.
Instructions
Get ETF price by token symbol from Paloma DEX.
Args:
symbol: ETF token symbol (e.g., PAGOLD, PABTC2X, PACBOA)
Returns:
JSON string with ETF price data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes |
Implementation Reference
- padex.py:956-989 (handler)The main handler function decorated with @mcp.tool() that implements the get_etf_price_by_symbol tool. It fetches ETF price data from the Paloma DEX API using an HTTP GET request to the /price endpoint with the symbol parameter and returns formatted JSON.@mcp.tool() async def get_etf_price_by_symbol(ctx: Context, symbol: str) -> str: """Get ETF price by token symbol from Paloma DEX. Args: symbol: ETF token symbol (e.g., PAGOLD, PABTC2X, PACBOA) Returns: JSON string with ETF price data. """ try: paloma_ctx = ctx.request_context.lifespan_context # Call Paloma DEX API to get price by symbol api_url = f"https://api.palomadex.com/etfapi/v1/price?symbol={symbol}" response = await paloma_ctx.http_client.get(api_url) if response.status_code == 200: price_data = response.json() result = { "symbol": symbol, "pricing": price_data, "timestamp": asyncio.get_event_loop().time(), "source": "paloma_dex_api_symbol" } return json.dumps(result, indent=2) else: return f"Error: Failed to fetch ETF price for symbol {symbol}. Status: {response.status_code}" except Exception as e: logger.error(f"Error getting ETF price by symbol: {e}") return f"Error getting ETF price by symbol: {str(e)}"