get_historical_liquidity
Retrieve historical liquidity data for any token on a specific chain to analyze swap availability. Use the token slug (e.g., 'usdt') as input for detailed insights.
Instructions
GET /api/historicalLiquidity/{token}
Provides the available liquidity for swapping from one token to another on a specific chain.
Parameters:
token: token slug (e.g., 'usdt')
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes |
Implementation Reference
- defillama_server.py:332-342 (handler)The handler function for the 'get_historical_liquidity' tool. It is decorated with @mcp.tool() which registers it as an MCP tool. The function takes a token parameter, makes an API request to DefiLlama's historicalLiquidity endpoint, and returns the result as a string.@mcp.tool() async def get_historical_liquidity(token: str) -> str: """GET /api/historicalLiquidity/{token} Provides the available liquidity for swapping from one token to another on a specific chain. Parameters: token: token slug (e.g., 'usdt') """ result = await make_request('GET', f'/api/historicalLiquidity/{token}') return str(result)