defillama
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeFiLlama API
DeFiLlama API
Query DeFi protocol TVL, yield farming opportunities, chain analytics, and stablecoin data via the free DeFiLlama API.
通过免费的DeFiLlama API查询DeFi协议的TVL、收益挖矿机会、链上分析以及稳定币数据。
Base URLs
基础URL
- 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.
- TVL与协议:
https://api.llama.fi - 收益:
https://yields.llama.fi - 稳定币:
https://stablecoins.llama.fi - 代币(价格):
https://coins.llama.fi
无需API密钥。没有严格的速率限制,但请合理调用。
Endpoints
接口端点
Protocol List
协议列表
GET https://api.llama.fi/v2/protocolsReturns all tracked protocols with current TVL, chain breakdown, category, and URL. Large payload — always filter or limit output to top N results.
GET https://api.llama.fi/v2/protocols返回所有被追踪的协议,包含当前TVL、链上分布、分类以及URL。返回数据量较大——请务必过滤结果或限制为前N条结果。
Protocol TVL History
协议TVL历史数据
GET https://api.llama.fi/v2/tvl/{protocol}- : slug from protocols list (see table below)
protocol - Returns daily TVL data points
GET https://api.llama.fi/v2/tvl/{protocol}- :协议列表中的slug(见下表)
protocol - 返回每日TVL数据点
Protocol Detail
协议详情
GET https://api.llama.fi/protocol/{protocol}Returns full protocol info: TVL per chain, token breakdown, governance token, audits.
GET https://api.llama.fi/protocol/{protocol}返回协议完整信息:各链TVL、代币分布、治理代币、审计情况。
Chain TVL
链上TVL
GET https://api.llama.fi/v2/chainsReturns TVL for every tracked chain. Useful for chain comparison.
GET https://api.llama.fi/v2/chains返回所有被追踪链的TVL数据,适用于链间对比。
Yield Pools
收益矿池
GET https://yields.llama.fi/poolsReturns all tracked yield pools. Very large payload — always filter by chain or project in your output.
Useful fields per pool: , , , , , , , .
chainprojectsymboltvlUsdapyapyBaseapyRewardstablecoinGET https://yields.llama.fi/pools返回所有被追踪的收益矿池。返回数据量极大——请务必在输出中按链或项目过滤。
矿池常用字段:、、、、、、、。
chainprojectsymboltvlUsdapyapyBaseapyRewardstablecoinStablecoins
稳定币
GET https://stablecoins.llama.fi/stablecoins?includePrices=trueReturns all stablecoins with circulating supply, peg data, and chain breakdown.
GET https://stablecoins.llama.fi/stablecoins?includePrices=true返回所有稳定币的流通供应量、锚定数据以及链上分布。
Token Prices
代币价格
GET https://coins.llama.fi/prices/current/{coins}- : comma-separated in format
coins(e.g.,{chain}:{address})bsc:0x0E09... - Chain keys: ,
bsc,ethereum,polygon,arbitrum,optimismbase
GET https://coins.llama.fi/prices/current/{coins}- :以逗号分隔,格式为
coins(例如:{chain}:{address})bsc:0x0E09... - 链标识:、
bsc、ethereum、polygon、arbitrum、optimismbase
Common Protocol Slugs
常见协议Slug
| 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 |
| 协议名称 | 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 and
/v2/protocolsendpoints return massive JSON arrays. Always extract and present only the top N items relevant to the user's query./pools - Combine with CoinGecko for token price context and with for on-chain verification of TVL claims.
read_contract - When presenting yield data, always note that APY is historical and not guaranteed.
- Sort pools by TVL to surface safer opportunities first.
- 大体积返回数据:和
/v2/protocols端点会返回非常大的JSON数组。请务必仅提取并展示与用户查询相关的前N项内容。/pools - 可结合CoinGecko获取代币价格背景信息,或结合对TVL声明进行链上验证。
read_contract - 展示收益数据时,请务必注明APY为历史数据,不代表未来收益保证。
- 可按TVL对矿池排序,优先展示更安全的机会。
Example Queries
示例查询
User: "What's the TVL of PancakeSwap?"
→ Fetch , report latest TVL
https://api.llama.fi/v2/tvl/pancakeswapUser: "Top yield pools on BSC"
→ Fetch , filter , sort by desc, show top 10 with APY
/poolschain === "BSC"tvlUsdUser: "Compare TVL across chains"
→ Fetch , sort by desc, present top 10
/v2/chainstvl用户:"PancakeSwap的TVL是多少?"
→ 调用,返回最新TVL数据
https://api.llama.fi/v2/tvl/pancakeswap用户:"BSC上的顶级收益矿池"
→ 调用,过滤,按降序排序,展示前10个带APY的矿池
/poolschain === "BSC"tvlUsd用户:"对比各链的TVL"
→ 调用,按降序排序,展示前10条链
/v2/chainstvl