get_protocol_inflows
Retrieve inflow and outflow data for a specific DeFi protocol at a given timestamp to analyze capital movements and protocol activity.
Instructions
GET /api/inflows/{protocol}/{timestamp}
Lists the amount of inflows and outflows for a protocol at a given date.
Parameters:
protocol: protocol slug (e.g., 'compound-v3')
timestamp: unix timestamp (e.g., 1700006400)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| protocol | Yes | ||
| timestamp | Yes |
Implementation Reference
- defillama_server.py:52-62 (handler)The main handler function for the get_protocol_inflows MCP tool. It is registered via the @mcp.tool() decorator and implements the logic to fetch inflows/outflows data for a protocol at a specific timestamp from the DefiLlama API, returning the result as a string. The function signature and docstring define the input schema.async def get_protocol_inflows(protocol: str, timestamp: int) -> str: """GET /api/inflows/{protocol}/{timestamp} Lists the amount of inflows and outflows for a protocol at a given date. Parameters: protocol: protocol slug (e.g., 'compound-v3') timestamp: unix timestamp (e.g., 1700006400) """ result = await make_request('GET', f'/api/inflows/{protocol}/{timestamp}') return str(result)