DefiLlama Pro API Skill
Use this skill to run DefiLlama Pro API operations through uxc + OpenAPI.
Reuse the uxc skill for shared execution, auth, and error-handling guidance.
Prerequisites
- -
uxc is installed and available in PATH. - Network access to
https://pro-api.llama.fi. - Access to the curated OpenAPI schema URL:
-
https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-pro-openapi-skill/references/defillama-pro.openapi.json
- - A DefiLlama Pro API key.
Scope
This skill covers a read-first analytics surface:
- - protocol TVL list and per-protocol detail
- chain overview reads
- current token price lookups
- yield pool discovery
- yield chart history
- stablecoin dominance reads
This skill does not cover:
- - write operations or account management
- the public unauthenticated host variants
- the full DefiLlama Pro endpoint surface
Authentication
DefiLlama Pro places the API key in the request path, between the host and the endpoint path.
Configure one API-key credential with a request path prefix template:
CODEBLOCK0
Validate the active mapping when auth looks wrong:
CODEBLOCK1
Core Workflow
- 1. Use the fixed link command by default:
-
command -v defillama-pro-openapi-cli
- If missing, create it:
uxc link defillama-pro-openapi-cli https://pro-api.llama.fi --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-pro-openapi-skill/references/defillama-pro.openapi.json
- INLINECODE8
- 2. Inspect operation schema first:
-
defillama-pro-openapi-cli get:/api/protocols -h
-
defillama-pro-openapi-cli get:/coins/prices/current/{coins} -h
- INLINECODE11
- 3. Prefer narrow read validation before broader reads:
-
defillama-pro-openapi-cli get:/api/v2/chains
-
defillama-pro-openapi-cli get:/api/protocol/{protocol} protocol=aave
- INLINECODE14
- 4. Execute with key/value parameters:
-
defillama-pro-openapi-cli get:/api/protocol/{protocol} protocol=aave
-
defillama-pro-openapi-cli get:/coins/prices/current/{coins} coins=ethereum:0x0000000000000000000000000000000000000000 searchWidth=4h
- INLINECODE17
Operation Groups
Protocol And Chain Analytics
- - INLINECODE18
- INLINECODE19
- INLINECODE20
Prices, Yields, And Stablecoins
- - INLINECODE21
- INLINECODE22
- INLINECODE23
- INLINECODE24
Guardrails
- - Keep automation on the JSON output envelope; do not use
--text. - Parse stable fields first:
ok, kind, protocol, data, error. - Treat this v1 skill as read-only. Do not imply wallet, trading, or admin support.
- This skill assumes the Pro host and key-in-path auth model. Do not bind the same credential to a different path shape without checking the upstream docs first.
- API keys are sensitive because they appear in the request path. Use
--secret-env or --secret-op, not shell history literals, when possible. - Avoid sharing raw daemon logs when troubleshooting this integration. The key is part of the request path, so if you inspect
~/.uxc/daemon/daemon.log, sanitize, rotate, or delete the log after debugging and avoid verbose logging unless necessary. - INLINECODE34 is equivalent to
uxc https://pro-api.llama.fi --schema-url <defillama_pro_openapi_schema> <operation> ....
References
- - Usage patterns: INLINECODE36
- Curated OpenAPI schema: INLINECODE37
- DefiLlama API docs: https://defillama.com/docs/api
- DefiLlama Pro docs: https://defillama.com/pro-api/docs
DefiLlama Pro API 技能
使用此技能通过 uxc + OpenAPI 运行 DefiLlama Pro API 操作。
复用 uxc 技能以获取共享执行、认证和错误处理指南。
先决条件
- - uxc 已安装并位于 PATH 中。
- 可访问 https://pro-api.llama.fi 网络。
- 可访问精选的 OpenAPI 模式 URL:
- https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-pro-openapi-skill/references/defillama-pro.openapi.json
- - 拥有 DefiLlama Pro API 密钥。
范围
此技能涵盖以读取为主的分析功能:
- - 协议 TVL 列表及每个协议的详细信息
- 链概览读取
- 当前代币价格查询
- 收益池发现
- 收益图表历史
- 稳定币主导地位读取
此技能不涵盖:
- - 写入操作或账户管理
- 公共未认证的主机变体
- 完整的 DefiLlama Pro 端点功能
认证
DefiLlama Pro 将 API 密钥放置在请求路径中,位于主机和端点路径之间。
使用请求路径前缀模板配置一个 API 密钥凭证:
bash
uxc auth credential set defillama-pro \
--auth-type api_key \
--secret-env DEFILLAMAPROAPI_KEY \
--path-prefix-template /{{secret}}
uxc auth binding add \
--id defillama-pro \
--host pro-api.llama.fi \
--scheme https \
--credential defillama-pro \
--priority 100
当认证出现问题时,验证活动映射:
bash
uxc auth binding match https://pro-api.llama.fi
核心工作流程
- 1. 默认使用固定链接命令:
- command -v defillama-pro-openapi-cli
- 如果缺失,创建它:
uxc link defillama-pro-openapi-cli https://pro-api.llama.fi --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-pro-openapi-skill/references/defillama-pro.openapi.json
- defillama-pro-openapi-cli -h
- 2. 首先检查操作模式:
- defillama-pro-openapi-cli get:/api/protocols -h
- defillama-pro-openapi-cli get:/coins/prices/current/{coins} -h
- defillama-pro-openapi-cli get:/yields/chart/{pool} -h
- 3. 在进行更广泛的读取之前,优先进行窄范围读取验证:
- defillama-pro-openapi-cli get:/api/v2/chains
- defillama-pro-openapi-cli get:/api/protocol/{protocol} protocol=aave
- defillama-pro-openapi-cli get:/yields/pools
- 4. 使用键/值参数执行:
- defillama-pro-openapi-cli get:/api/protocol/{protocol} protocol=aave
- defillama-pro-openapi-cli get:/coins/prices/current/{coins} coins=ethereum:0x0000000000000000000000000000000000000000 searchWidth=4h
- defillama-pro-openapi-cli get:/stablecoins/stablecoindominance/{chain} chain=ethereum
操作组
协议与链分析
- - get:/api/protocols
- get:/api/protocol/{protocol}
- get:/api/v2/chains
价格、收益与稳定币
- - get:/coins/prices/current/{coins}
- get:/yields/pools
- get:/yields/chart/{pool}
- get:/stablecoins/stablecoindominance/{chain}
防护措施
- - 保持自动化在 JSON 输出格式上;不要使用 --text。
- 首先解析稳定字段:ok、kind、protocol、data、error。
- 将此 v1 技能视为只读。不要暗示支持钱包、交易或管理功能。
- 此技能假设使用 Pro 主机和密钥路径认证模型。在未先检查上游文档的情况下,不要将同一凭证绑定到不同的路径格式。
- API 密钥很敏感,因为它们出现在请求路径中。尽可能使用 --secret-env 或 --secret-op,而不是 shell 历史记录中的文字。
- 在排查此集成问题时,避免共享原始守护进程日志。密钥是请求路径的一部分,因此如果您检查 ~/.uxc/daemon/daemon.log,请在调试后清理、轮换或删除日志,并避免不必要的详细日志记录。
- defillama-pro-openapi-cli ... 等同于 uxc https://pro-api.llama.fi --schema-url proopenapi_schema> ...。
参考资料
- - 使用模式:references/usage-patterns.md
- 精选的 OpenAPI 模式:references/defillama-pro.openapi.json
- DefiLlama API 文档:https://defillama.com/docs/api
- DefiLlama Pro 文档:https://defillama.com/pro-api/docs