# DefiLlama MCP for AI Agents MCP

> DefiLlama provides your AI agent direct access to real-time and historical decentralized finance data. Query Total Value Locked (TVL), token prices, APY rates, and cross-chain bridge volumes across every major DeFi protocol and blockchain.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** defi, tvl, crypto-prices, yield-farming, on-chain-data

## Description

Need deep market insights but hate spending hours manually scraping data from ten different dashboards? This MCP connects your AI agent to DefiLlama, the leading source for decentralized finance metrics. You can query complex questions—like tracking how a specific yield pool's performance changed during a bear cycle—using natural conversation.

Your agent handles all the complexity: it pulls historical TVL data across global ecosystems, fetches current token prices, and analyzes volume shifts on major bridges. This means your AI client doesn't just answer; it executes deep research protocols for you. When you connect this MCP through Vinkius, you gain a central hub that lets any compatible client run advanced financial modeling without writing complex API calls. You simply ask what data you need, and the system delivers the full picture of the DeFi market.

## Tools

### get_all_chains_tvl
Retrieves the current Total Value Locked (TVL) for all major blockchains supported by DefiLlama.

### get_all_pools
Gets the current Annual Percentage Yield (APY) and TVL figures for every monitored liquidity pool.

### get_all_stablecoins
Provides a list of all stablecoin assets tracked by the system.

### get_bridge_volume_chain
Calculates and retrieves the total bridge volume for a specified blockchain.

### get_current_prices
Fetches the current market price of any token given its chain and contract address.

### get_current_tvl_chain
Gathers the aggregate TVL for a specific blockchain network right now.

### get_historical_prices
Retrieves the price of any token at an exact historical timestamp you specify.

### get_historical_tvl_global
Accesses time-series data showing the overall TVL growth of the entire DeFi market.

### get_percentage_change
Calculates how much a token's price has changed over any defined period.

### get_pool_historical_data
Tracks the historical APY and TVL performance for a specific liquidity pool over time.

### get_price_chart
Generates a visual chart showing the price movements of a token over a specified period.

### get_protocol
Retrieves historical TVL data specifically for one designated DeFi protocol.

### get_protocols
Lists all tracked protocols and their current total value locked (TVL) status.

### get_stablecoin_historical_data
Gathers time-series data detailing the historical metrics of stablecoins.

### get_stablecoin_market_cap_chain
Determines the current market capitalization for stablecoins on a specific chain network.

### get_all_bridges
Lists and provides data points regarding all monitored cross-chain bridges.

### get_dex_volume_chain
Calculates the total trading volume for Decentralized Exchanges (DEX) on a specific chain network.

### get_dex_volumes_global
Aggregates global data to show the total DEX trading volumes across all chains.

### get_historical_tvl_chain
Pulls historical TVL data for a specific blockchain network over time.

## Prompt Examples

**Prompt:** 
```
What were the biggest capital movements in DeFi last month?
```

**Response:** 
```
**DeFi Capital Flow Analysis (Last 30 Days)**

| Metric | Value |
| :--- | :--- |
| **Global TVL Change** | +$12.5B |
| **Leading Protocol** | Aave (+8%) |
| **Top Bridge Activity** | Polygon to Arbitrum ($4.1B) |

*Insight:* The increase in bridge volume suggests significant migration of funds to multi-chain architectures, favoring the bridging mechanisms between these two networks.
```

**Prompt:** 
```
Show me a comparison of ETH and SOL's performance over the last year.
```

**Response:** 
```
**Token Price Comparison (ETH vs. SOL)**

**Chart: 1 Year Performance**
(Visual chart showing both lines)

* Key Finding:
* **Ethereum:** Showed steady, moderate growth with a notable dip in Q2.
* **Solana:** Exhibited higher volatility but maintained stronger momentum during the last quarter. 

Please note that this comparison excludes stablecoin performance.
```

**Prompt:** 
```
What are the best yield farming opportunities on Ethereum right now?
```

**Response:** 
```
**Top 5 Yield Opportunities (Ethereum)**

1. **Aave Pool:** APY: 7.2% | TVL: $6B |
2. **Curve LP:** APY: 6.8% | TVL: $4.5B |
3. **Uniswap V3:** APY: 5.9% | TVL: $3.1B |

*Recommendation:* The current metrics suggest that liquidity pools with deep, established history offer the most reliable yields right now.
```

## Capabilities

### Track Total Value Locked (TVL)
Get current or historical TVL figures for entire blockchains, individual protocols, or specific asset pools.

### Analyze Token Pricing and Changes
Retrieve the current price of thousands of tokens and calculate their percentage change over any specified time period.

### Identify Yield Farming Opportunities
Monitor APY and TVL for liquidity pools across different chains, helping you pinpoint optimal yield strategies.

### Assess Cross-Chain Activity
Analyze bridge volume activity and track stablecoin market capitalization across multiple ecosystems.

### Model Market Trends Over Time
Access time-series data to understand long-term protocol growth, DEX volumes, and historical DeFi cycles.

## Use Cases

### Investigating Protocol Resilience During Downturns
A PM needs to know if a protocol can survive a bear market. They ask the agent: 'Show me how a specific protocol's TVL changed over the last three years.' The agent uses get_protocol and get_historical_tvl_chain to provide a clear trend line, identifying when capital started flowing out.

### Comparing Cross-Chain Capital Efficiency
A developer wants to know which bridge is moving the most value. They prompt: 'Compare the current bridge volume on Ethereum versus Polygon.' The agent executes get_all_bridges and get_bridge_volume_chain, giving immediate comparative data.

### Optimizing Yield Farming Strategies
An analyst needs to find a better yield. They ask: 'What are the top five pools with APY over 10% right now?' The agent calls get_all_pools, filtering out low-performing assets and presenting actionable opportunities.

### Forecasting Token Value Changes
A researcher needs to understand how a token's price has reacted historically. They ask: 'What was the price of ETH exactly 6 months ago?' The agent uses get_historical_prices, providing the precise data point needed for their model.

## Benefits

- Track market shifts instantly: Use get_historical_tvl_global to see how the entire DeFi ecosystem grew or shrank during a specific market cycle.
- Pinpoint best yields: Check liquidity pools using get_all_pools to compare current APY and TVL across dozens of competing protocols in minutes.
- Deep dive into protocol health: Use get_protocol alongside get_historical_tvl_chain to assess the long-term stability of specific lending or DEX platforms.
- Map cross-chain flow: Analyze bridge activity with get_bridge_volume_chain and global volume data from get_dex_volumes_global to understand capital movement.
- Model price changes accurately: Use get_historical_prices and get_percentage_change to calculate token value shifts at specific, critical historical moments.

## How It Works

The bottom line is that your AI client handles all the data plumbing; you just ask the question in plain English.

1. First, subscribe to this MCP. If you're using a pro account, enter your DefiLlama API Key; otherwise, leave it blank for public data access.
2. Next, tell your AI client exactly what you need—for example, 'What was the global TVL on June 1st?'
3. The MCP executes the query, pulls the raw metrics from DefiLlama, and presents the structured data back to your agent.

## Frequently Asked Questions

**How can I use DefiLlama to track historical DeFi TVL data?**
You can query specific timeframes for total value locked (TVL) across the entire market or for individual protocols. This helps you visualize how capital has flowed into or out of certain sectors during major market cycles.

**Does DefiLlama help me compare token prices across different chains?**
Yes, it lets you fetch the current price and historical data for tokens on multiple blockchains. You can see if a token maintains consistent value whether it's traded on Ethereum or another network.

**What kind of yield farming information does DefiLlama provide?**
The MCP monitors liquidity pools and provides both the current Annual Percentage Yield (APY) and the total value locked (TVL) for those pools. This lets you quickly compare which opportunities offer the best returns.

**Can I analyze how much money is moving between chains?**
You can track cross-chain activity by analyzing bridge volumes and global DEX trading volumes. This gives you a clear picture of where capital is migrating within the wider crypto ecosystem.

**Is DefiLlama useful for understanding market trends over time?**
Absolutely. By providing historical data, you can build price charts and see macro-level shifts in total value locked (TVL). This is critical for any deep market analysis or research.