get_unique_traders_by_collection
Retrieve unique buyer and seller counts for NFT collections to analyze trading activity and market participation.
Instructions
Retrieve count of unique buyers and sellers for NFT collections.
Args:
limit (int, optional): Maximum number of rows to fetch from the query. Defaults to 1000.
Returns:
str: Markdown table of unique traders by collection, or error message if the query fails.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_unique_traders_by_collection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- main.py:105-121 (handler)The handler function decorated with @mcp.tool() that implements the logic for get_unique_traders_by_collection. It fetches the latest results from Dune query ID 5140464, processes the data into a pandas DataFrame, and returns it as a Markdown table.
@mcp.tool() def get_unique_traders_by_collection(limit: int = 1000) -> str: """ Retrieve count of unique buyers and sellers for NFT collections. Args: limit (int, optional): Maximum number of rows to fetch from the query. Defaults to 1000. Returns: str: Markdown table of unique traders by collection, or error message if the query fails. """ try: data = get_latest_result(5140464, limit=limit) df = pd.DataFrame(data) return df.to_markdown() except Exception as e: return str(e)