get_daily_trading_volume_by_telegram_bot
Fetch daily trading volume for Telegram bots via a Dune Analytics query, presenting data in a pivot table with dates and bot names for clear analysis.
Instructions
Retrieve daily trading volume by Telegram bot.
This tool fetches daily trading volume data for Telegram bots from a Dune Analytics query and returns it in a markdown-formatted pivot table, with dates as the index and bot names as columns.
Args:
limit (int, optional): Maximum number of rows to retrieve from the query. Defaults to 1000.
Returns:
str: A markdown-formatted pivot table of trading volume data, or an error message if the query fails.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- main.py:241-263 (handler)The @mcp.tool()-decorated handler function that implements the tool logic: fetches data from Dune query ID 2687239 using the helper get_latest_result, processes it into a pivot table with pandas (date as index, bot as columns, volumeUSD as values), sorts by date descending, and returns a markdown table or error message.@mcp.tool() def get_daily_trading_volume_by_telegram_bot(limit: int = 1000) -> str: """ Retrieve daily trading volume by Telegram bot. This tool fetches daily trading volume data for Telegram bots from a Dune Analytics query and returns it in a markdown-formatted pivot table, with dates as the index and bot names as columns. Args: limit (int, optional): Maximum number of rows to retrieve from the query. Defaults to 1000. Returns: str: A markdown-formatted pivot table of trading volume data, or an error message if the query fails. """ try: data = get_latest_result(2687239, limit=limit) df = pd.DataFrame(data) df["date"] = pd.to_datetime(df["block_date"]).dt.date pivot_df = df.pivot(index="date", columns="bot", values="volumeUSD") pivot_df = pivot_df.sort_index(ascending=False) return pivot_df.to_markdown() except Exception as e: return str(e)