---
name: defillama-28feee788f71
description: Query DeFiLlama for TVL, protocol analytics, yield pools, and stablecoin data.
metadata: { "cryptoclaw": { "emoji": "🦙", "always": true } }
---

# DeFiLlama API

Query DeFi protocol TVL, yield farming opportunities, chain analytics, and stablecoin data via the free DeFiLlama API.

## Base URLs

- **TVL & Protocols**: `https://api.llama.fi`
- **Yields**: `https://yields.llama.fi`
- **Stablecoins**: `https://stablecoins.llama.fi`
- **Coins (prices)**: `https://coins.llama.fi`

No API key required. No strict rate limits, but be respectful.

## Endpoints

### Protocol List

```
GET https://api.llama.fi/v2/protocols
```

Returns all tracked protocols with current TVL, chain breakdown, category, and URL. **Large payload** — always filter or limit output to top N results.

### Protocol TVL History

```
GET https://api.llama.fi/v2/tvl/{protocol}
```

- `protocol`: slug from protocols list (see table below)
- Returns daily TVL data points

### Protocol Detail

```
GET https://api.llama.fi/protocol/{protocol}
```

Returns full protocol info: TVL per chain, token breakdown, governance token, audits.

### Chain TVL

```
GET https://api.llama.fi/v2/chains
```

Returns TVL for every tracked chain. Useful for chain comparison.

### Yield Pools

```
GET https://yields.llama.fi/pools
```

Returns all tracked yield pools. **Very large payload** — always filter by chain or project in your output.

Useful fields per pool: `chain`, `project`, `symbol`, `tvlUsd`, `apy`, `apyBase`, `apyReward`, `stablecoin`.

### Stablecoins

```
GET https://stablecoins.llama.fi/stablecoins?includePrices=true
```

Returns all stablecoins with circulating supply, peg data, and chain breakdown.

### Token Prices

```
GET https://coins.llama.fi/prices/current/{coins}
```

- `coins`: comma-separated in format `{chain}:{address}` (e.g., `bsc:0x0E09...`)
- Chain keys: `bsc`, `ethereum`, `polygon`, `arbitrum`, `optimism`, `base`

## Common Protocol Slugs

| Protocol       | Slug             |
| -------------- | ---------------- |
| PancakeSwap    | pancakeswap      |
| Uniswap        | uniswap          |
| Aave V3        | aave-v3          |
| Lido           | lido             |
| Curve          | curve-finance    |
| MakerDAO       | makerdao         |
| Compound       | compound-finance |
| GMX            | gmx              |
| Convex         | convex-finance   |
| Rocket Pool    | rocket-pool      |
| Venus          | venus            |
| Alpaca Finance | alpaca-finance   |
| Biswap         | biswap           |
| Radiant        | radiant-v2       |

## Usage Notes

- **Large payloads**: The `/v2/protocols` and `/pools` endpoints return massive JSON arrays. Always extract and present only the top N items relevant to the user's query.
- Combine with CoinGecko for token price context and with `read_contract` for on-chain verification of TVL claims.
- When presenting yield data, always note that APY is historical and not guaranteed.
- Sort pools by TVL to surface safer opportunities first.

## Example Queries

User: "What's the TVL of PancakeSwap?"
→ Fetch `https://api.llama.fi/v2/tvl/pancakeswap`, report latest TVL

User: "Top yield pools on BSC"
→ Fetch `/pools`, filter `chain === "BSC"`, sort by `tvlUsd` desc, show top 10 with APY

User: "Compare TVL across chains"
→ Fetch `/v2/chains`, sort by `tvl` desc, present top 10


---
Source attribution: TermiX-official
Original project: https://github.com/TermiX-official/cryptoclaw/blob/9e1c91b188d36639f8bb44028138605b1827d696/skills/defillama/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 Peter Steinberger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: TermiX-official
Original project: https://github.com/TermiX-official/cryptoclaw/blob/9e1c91b188d36639f8bb44028138605b1827d696/skills/defillama/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Finance & Accounting, Marketing
Roles: Data Analyst, Financial Analyst, Marketing Analyst
Specialties: API
Tools: Defillama
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: c6c69ac2b521901d89cd25ce91f772f0f6f973de79515ff86976bb63f6bc40e3
