The DeFi index an analyst already trusts, reached the way an agent works: one request, one payment header, no account. Protocol TVL, TVL by chain, every tracked yield pool with its APY, and token prices by identifier.
DefiLlama API capabilities: TVL, yields and token prices
DefiLlama API pricing: per request, priced per endpoint
Per request, and not one flat rate: a token-price lookup is cheaper than an index read, and the table below prices each row from the router's own registry rather than from a number typed on this page.
DefiLlama API reference: five DeFi TVL and yield endpoints
Base URL: https://blockrun.ai/api/v1/defillama/
Send any request without a payment header to get a 402 carrying the exact price for that call. Attach an x402 payment header to receive the data.
| Endpoint | Method | Price | What it returns |
|---|---|---|---|
| /protocols | GET | $0.006 | List of every DeFi protocol DefiLlama tracks, with current and historical TVL across chains. |
| /protocol/{slug} e.g. /protocol/aave | GET | $0.006 | Detailed TVL + breakdown for a single protocol. Pass slug as `/v1/defillama/protocol/{slug}` (e.g. `aave`, `uniswap`). |
| /chains | GET | $0.006 | TVL by chain — every chain DefiLlama tracks with current TVL totals. |
| /yields | GET | $0.006 | Every tracked yield pool across DeFi (lending, LPs, staking, vaults) with current APY/TVL. |
| /prices/{coins} e.g. /prices/coingecko:bitcoin | GET | $0.002 | Token price lookup. Pass coin identifiers as `/v1/defillama/prices/{coins}` (e.g. `coingecko:bitcoin`, `ethereum:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`). Supports comma-separated lists. |
Quick start: how to call the DefiLlama API with curl
The two reads that take an argument take it as a path segment, not a query parameter. That is the detail a first integration gets wrong.
# TVL by chain — no argument
curl https://blockrun.ai/api/v1/defillama/chains
# One protocol — slug is a path segment
curl https://blockrun.ai/api/v1/defillama/protocol/aave
# Token prices — comma-separated identifiers, each namespaced
curl https://blockrun.ai/api/v1/defillama/prices/coingecko:ethereum
# Unpaid, every one of them answers 402 with the exact price first.From an agent, the same reads are one MCP tool call: blockrun_defi.
What the DefiLlama API is not: no live chain reads, no execution
These are reads of an index, at that index's refresh cadence — not a live chain read. For state that must be current to the block, query a node: the multi-chain RPC endpoints serve that. For a spot close on a crypto pair, an FX cross or a metal, the market-data endpoint is free. For an executable swap price, the DEX aggregator returns a transaction to sign.
Nothing on this service writes, quotes or executes. The yields response is large by design — it is the whole pool set, unfiltered — so an agent calling it in a loop should cache on its own side.
DefiLlama API questions: TVL, yields, protocol slugs, chains, cost
- What is the DefiLlama API on BlockRun?
- The DefiLlama index reached through a payment header instead of a separate base URL per product family. Protocol TVL, one protocol's history with a per-chain breakdown, TVL by chain, every tracked yield pool with its APY, and token prices by identifier.
- Do I need an API key for DefiLlama data here?
- No. Payment rides on the request, so there is no account, no dashboard and no key to rotate. An agent funds a wallet once and each call settles itself.
- How do I look up one protocol's TVL?
- The slug is a path segment, not a query parameter — protocol/{slug}, with a slug like aave or uniswap. That is the detail a first integration usually gets wrong, so the reference table on this page shows a working example beside each endpoint that takes one.
- Can I get yield pools and APY for the whole of DeFi?
- Yes, and unfiltered on purpose. The yields read returns the entire tracked pool set — lending markets, liquidity pools, staking and vaults — so you rank and filter in your own process rather than learning a server-side filter first. It is the heaviest call here and the one worth caching.
- How much does a DefiLlama call cost?
- Per request, and not one flat rate: a token-price lookup is cheaper than an index read. Every row in the reference table is priced from the router's own registry rather than from a figure typed on the page.
- Is the TVL data realtime?
- It is the index's own refresh cadence, not a live chain read. For state that must be current to the block, query a node through the multi-chain RPC endpoints; this service serves the aggregate view.
- Which chains and protocols are covered?
- Whatever the upstream index tracks, which is most of DeFi across several hundred chains. The chains read enumerates them, so coverage is something an agent discovers rather than guesses.
- DefiLlama through BlockRun vs calling DefiLlama directly?
- Same data, same source. What differs is the reach: one payment header and one request shape sitting beside the model, search and market endpoints the same agent already calls, instead of a separate base URL per product family. A service already talking to it directly and happy has nothing to gain.
- Can an AI agent read DeFi TVL without an account?
- Yes, and that is the shape's whole point. No signup and no key — the agent pays per request from its wallet and reads the number it came for.