get_historical_chain_tvl_by_chain
Retrieve historical Total Value Locked data for a specific blockchain, excluding liquid staking and double-counted TVL, to analyze DeFi ecosystem growth over time.
Instructions
GET /api/v2/historicalChainTvl/{chain}
Get historical TVL (excludes liquid staking and double counted tvl) of a chain.
Parameters:
chain: chain slug (e.g., 'Ethereum')
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes |
Implementation Reference
- defillama_server.py:103-113 (handler)Handler function for get_historical_chain_tvl_by_chain tool. Registered via @mcp.tool() decorator. Fetches historical TVL data for a specific chain from DefiLlama API using the shared make_request helper.@mcp.tool() async def get_historical_chain_tvl_by_chain(chain: str) -> str: """GET /api/v2/historicalChainTvl/{chain} Get historical TVL (excludes liquid staking and double counted tvl) of a chain. Parameters: chain: chain slug (e.g., 'Ethereum') """ result = await make_request('GET', f'/api/v2/historicalChainTvl/{chain}') return str(result)
- defillama_server.py:30-38 (helper)Shared utility function used by the tool (and others) to perform HTTP requests to the DefiLlama Pro API.async def make_request(method: str, endpoint: str, params: Optional[Dict[str, Any]] = None) -> Any: """Make a request to the DefiLlama API.""" try: response = await client.request(method, endpoint, params=params) response.raise_for_status() return response.json() except Exception as e: return f"Error: {str(e)}"