# DefiLlama (DeFi & crypto) data for AI agents

> ToolSocket gives Claude, ChatGPT, Cursor, Codex and any MCP or REST client live access to DefiLlama (DeFi & crypto) — token prices, protocol TVL, DEX volumes, fees and revenue, stablecoins, yields and hacks — free — through 26 ready-made tools. No DefiLlama (DeFi & crypto) account, scraper or API key of your own is needed: connect https://toolsocket.top/mcp once and pay per call (free).

ToolSocket 让 Claude、ChatGPT、Cursor、Codex 等任何支持 MCP 或 REST 的 AI 智能体，直接读取DefiLlama (DeFi & crypto)的实时数据：代币价格、协议 TVL、DEX 交易量、协议收入、稳定币、收益率和黑客事件，免费，共 26 个工具。不用注册DefiLlama (DeFi & crypto)账号、不用写爬虫，接入一个地址即可，按次计费（免费）。

## Connect

- MCP (Claude.ai, ChatGPT, Claude Code, Cursor, VS Code, Codex): `https://toolsocket.top/mcp` — OAuth sign-in or `Authorization: Bearer ts_live_…`
- Claude Code: `claude mcp add --transport http toolsocket https://toolsocket.top/mcp`
- Any agent that reads skills: `set up https://toolsocket.top/SKILL.md`
- Setup for every client: https://toolsocket.top/docs.md

## Example

Ask your agent: "Which chains gained the most TVL this month?" / 「这个月哪条链的 TVL 涨得最多？」

```bash
curl -s -X POST https://toolsocket.top/v1/run -H "Authorization: Bearer $TOOLSOCKET_API_KEY" \
  -H "content-type: application/json" -d '{"tool":"defillama#prices_current","input":{"coins":"ethereum,bitcoin,ethereum:0xdac17f958d2ee523a2206206994597c13d831ec7"},"wait":30}'
```

## Tools (26)

| Tool | ID | Price | What it does |
|---|---|---|---|
| DefiLlama · Token Prices (now) · DefiLlama · 代币实时价格 | `defillama#prices_current` | Free | Current USD price for any coin or on-chain token address, on 400+ chains. |
| DefiLlama · Token Prices at a Date · DefiLlama · 代币历史价格 | `defillama#prices_historical` | Free | USD price of coins at a past date or moment. |
| DefiLlama · Price Chart · DefiLlama · 价格走势 | `defillama#price_chart` | Free | Evenly spaced price points for coins over a window (e.g. 30 daily points). |
| DefiLlama · Price Change % · DefiLlama · 涨跌幅 | `defillama#price_change` | Free | Percent price change of coins over 1h / 24h / 7d / 30d. |
| DefiLlama · First Recorded Price · DefiLlama · 首个价格记录 | `defillama#price_first` | Free | Earliest price DefiLlama has for each coin, and when it was recorded. |
| DefiLlama · Block at Time · DefiLlama · 时间对应区块高度 | `defillama#block_at` | Free | The block number closest to a given time on a chain. |
| DefiLlama · DeFi Protocols by TVL · DefiLlama · DeFi 协议 TVL 排行 | `defillama#protocols` | Free | Rank and filter 8,000+ DeFi protocols by TVL, growth, chain or category. |
| DefiLlama · Protocol Detail · DefiLlama · 协议详情 | `defillama#protocol` | Free | One protocol: description, TVL by chain, TVL history, funding rounds, hacks, sub-protocols. |
| DefiLlama · Chains by TVL · DefiLlama · 公链锁仓排行 | `defillama#chains` | Free | Every blockchain ranked by DeFi TVL, with native token. |
| DefiLlama · Chain TVL History · DefiLlama · 公链锁仓历史 | `defillama#chain_tvl_history` | Free | Daily DeFi TVL of one chain, or of all chains combined. |
| DefiLlama · DEX Volume · DefiLlama · DEX 交易量 | `defillama#dex_volumes` | Free | Spot DEX trading volume: market totals and top protocols (24h / 7d / 30d). |
| DefiLlama · DEX Aggregator Volume · DefiLlama · 聚合器交易量 | `defillama#aggregator_volumes` | Free | Volume routed by DEX aggregators (1inch, Jupiter, CoW…): market totals and top protocols (24h / 7d / 30d). |
| DefiLlama · Fees & Revenue · DefiLlama · 协议收入 | `defillama#fees` | Free | Fees paid by users, or revenue kept by protocols: market totals and top protocols (24h / 7d / 30d). |
| DefiLlama · Options Volume · DefiLlama · 期权交易量 | `defillama#options_volumes` | Free | On-chain options notional and premium volume: market totals and top protocols (24h / 7d / 30d). |
| DefiLlama · Perps Open Interest · DefiLlama · 永续合约持仓量 | `defillama#open_interest` | Free | Open interest across on-chain perp exchanges: market totals and top protocols (24h / 7d / 30d). |
| DefiLlama · DEX Volume of a Protocol · DefiLlama · 协议 DEX 交易量 | `defillama#dex_summary` | Free | DEX Volume of a Protocol: totals, per-chain split and daily history. |
| DefiLlama · Fees & Revenue of a Protocol · DefiLlama · 协议收入明细 | `defillama#fees_summary` | Free | Fees & Revenue of a Protocol: totals, per-chain split and daily history. |
| DefiLlama · Options Volume of a Protocol · DefiLlama · 协议期权交易量 | `defillama#options_summary` | Free | Options Volume of a Protocol: totals, per-chain split and daily history. |
| DefiLlama · Stablecoins · DefiLlama · 稳定币排行 | `defillama#stablecoins` | Free | Every stablecoin ranked by supply, with peg price, growth and top chains. |
| DefiLlama · Stablecoin Detail · DefiLlama · 单个稳定币详情 | `defillama#stablecoin` | Free | One stablecoin: supply on every chain and supply history. |
| DefiLlama · Stablecoin Supply by Chain · DefiLlama · 各链稳定币总量 | `defillama#stablecoin_chains` | Free | Chains ranked by total stablecoin supply. |
| DefiLlama · Stablecoin Supply History · DefiLlama · 稳定币总量历史 | `defillama#stablecoin_history` | Free | Daily total stablecoin supply, market-wide or on one chain. |
| DefiLlama · Stablecoin Peg Prices · DefiLlama · 稳定币价格（脱锚监控） | `defillama#stablecoin_prices` | Free | Daily price history of stablecoins — spot de-pegs. |
| DefiLlama · Yield Pools (APY) · DefiLlama · 收益池 / 年化收益 | `defillama#yield_pools` | Free | Search 15,000+ yield pools by chain, project, token, APY and TVL. |
| DefiLlama · Yield Pool History · DefiLlama · 收益池历史 | `defillama#yield_pool_chart` | Free | Daily APY and TVL history of one yield pool. |
| DefiLlama · Hacks & Exploits · DefiLlama · 黑客攻击记录 | `defillama#hacks` | Free | 1,300+ crypto hacks: date, amount lost, technique, chain, funds returned. |
