defillama-pro-openapi-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDefiLlama Pro API Skill
DefiLlama Pro API Skill
Use this skill to run DefiLlama Pro API operations through + OpenAPI.
uxcReuse the skill for shared execution, auth, and error-handling guidance.
uxc使用该技能通过 + OpenAPI执行DefiLlama Pro API操作。
uxc复用技能以获取共享的执行、认证和错误处理指引。
uxcPrerequisites
前提条件
- is installed and available in
uxc.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.
- 已安装并可在
uxc中访问。PATH - 可访问的网络权限。
https://pro-api.llama.fi - 可访问精选OpenAPI schema的URL:
https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-pro-openapi-skill/references/defillama-pro.openapi.json
- 拥有DefiLlama Pro API密钥。
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
该技能覆盖优先只读的分析功能:
- 协议TVL列表及单个协议详情
- 链概览查询
- 当前代币价格查询
- 收益池发现
- 收益图表历史
- 稳定币占比查询
该技能不覆盖:
- 写入操作或账户管理
- 公开无认证的主机变体
- DefiLlama Pro的完整端点范围
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:
bash
uxc auth credential set defillama-pro \
--auth-type api_key \
--secret-env DEFILLAMA_PRO_API_KEY \
--path-prefix-template "/{{secret}}"
uxc auth binding add \
--id defillama-pro \
--host pro-api.llama.fi \
--scheme https \
--credential defillama-pro \
--priority 100Validate the active mapping when auth looks wrong:
bash
uxc auth binding match https://pro-api.llama.fiDefiLlama Pro将API密钥置于请求路径中,位于主机和端点路径之间。
使用请求路径前缀模板配置一个API密钥凭证:
bash
uxc auth credential set defillama-pro \
--auth-type api_key \
--secret-env DEFILLAMA_PRO_API_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.fiCore Workflow
核心工作流
-
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 defillama-pro-openapi-cli -h
-
Inspect operation schema first:
defillama-pro-openapi-cli get:/api/protocols -hdefillama-pro-openapi-cli get:/coins/prices/current/{coins} -hdefillama-pro-openapi-cli get:/yields/chart/{pool} -h
-
Prefer narrow read validation before broader reads:
defillama-pro-openapi-cli get:/api/v2/chainsdefillama-pro-openapi-cli get:/api/protocol/{protocol} protocol=aavedefillama-pro-openapi-cli get:/yields/pools
-
Execute with key/value parameters:
defillama-pro-openapi-cli get:/api/protocol/{protocol} protocol=aavedefillama-pro-openapi-cli get:/coins/prices/current/{coins} coins=ethereum:0x0000000000000000000000000000000000000000 searchWidth=4hdefillama-pro-openapi-cli get:/stablecoins/stablecoindominance/{chain} chain=ethereum
-
默认使用固定链接命令:
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
-
先查看操作schema:
defillama-pro-openapi-cli get:/api/protocols -hdefillama-pro-openapi-cli get:/coins/prices/current/{coins} -hdefillama-pro-openapi-cli get:/yields/chart/{pool} -h
-
在执行大范围查询前优先进行窄范围只读验证:
defillama-pro-openapi-cli get:/api/v2/chainsdefillama-pro-openapi-cli get:/api/protocol/{protocol} protocol=aavedefillama-pro-openapi-cli get:/yields/pools
-
使用键值参数执行操作:
defillama-pro-openapi-cli get:/api/protocol/{protocol} protocol=aavedefillama-pro-openapi-cli get:/coins/prices/current/{coins} coins=ethereum:0x0000000000000000000000000000000000000000 searchWidth=4hdefillama-pro-openapi-cli get:/stablecoins/stablecoindominance/{chain} chain=ethereum
Operation Groups
操作分组
Protocol And Chain Analytics
协议与链分析
get:/api/protocolsget:/api/protocol/{protocol}get:/api/v2/chains
get:/api/protocolsget:/api/protocol/{protocol}get:/api/v2/chains
Prices, Yields, And Stablecoins
价格、收益与稳定币
get:/coins/prices/current/{coins}get:/yields/poolsget:/yields/chart/{pool}get:/stablecoins/stablecoindominance/{chain}
get:/coins/prices/current/{coins}get:/yields/poolsget:/yields/chart/{pool}get:/stablecoins/stablecoindominance/{chain}
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 or
--secret-env, not shell history literals, when possible.--secret-op - Avoid sharing raw daemon logs when troubleshooting this integration. The key is part of the request path, so if you inspect , sanitize, rotate, or delete the log after debugging and avoid verbose logging unless necessary.
~/.uxc/daemon/daemon.log - is equivalent to
defillama-pro-openapi-cli <operation> ....uxc https://pro-api.llama.fi --schema-url <defillama_pro_openapi_schema> <operation> ...
- 自动化操作仅使用JSON输出格式;请勿使用参数。
--text - 优先解析固定字段:、
ok、kind、protocol、data。error - 将该v1技能视为只读工具。请勿暗示其支持钱包、交易或管理功能。
- 该技能基于Pro主机和路径中带密钥的认证模型。若未先查看上游文档,请勿将同一凭证绑定到不同的路径结构。
- API密钥属于敏感信息,因为它会出现在请求路径中。尽可能使用或
--secret-env,而非直接在shell历史中输入明文。--secret-op - 排查该集成问题时,避免共享原始守护进程日志。密钥会出现在请求路径中,因此若你查看,调试后请清理、轮换或删除日志,除非必要否则避免启用 verbose 日志。
~/.uxc/daemon/daemon.log - 等价于
defillama-pro-openapi-cli <operation> ...。uxc https://pro-api.llama.fi --schema-url <defillama_pro_openapi_schema> <operation> ...
References
参考资料
- Usage patterns:
references/usage-patterns.md - Curated OpenAPI schema:
references/defillama-pro.openapi.json - DefiLlama API docs: https://defillama.com/docs/api
- DefiLlama Pro docs: https://defillama.com/pro-api/docs
- 使用模式:
references/usage-patterns.md - 精选OpenAPI schema:
references/defillama-pro.openapi.json - DefiLlama API文档:https://defillama.com/docs/api
- DefiLlama Pro文档:https://defillama.com/pro-api/docs