defillama-pro-openapi-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DefiLlama Pro API Skill

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.
使用该技能通过
uxc
+ OpenAPI执行DefiLlama Pro API操作。
复用
uxc
技能以获取共享的执行、认证和错误处理指引。

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.
  • 已安装
    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 100
Validate the active mapping when auth looks wrong:
bash
uxc auth binding match https://pro-api.llama.fi
DefiLlama 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.fi

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
    • defillama-pro-openapi-cli -h
  2. Inspect operation schema first:
    • 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. 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
    • defillama-pro-openapi-cli get:/yields/pools
  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
    • defillama-pro-openapi-cli get:/stablecoins/stablecoindominance/{chain} chain=ethereum
  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. 先查看操作schema:
    • 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

Operation Groups

操作分组

Protocol And Chain Analytics

协议与链分析

  • get:/api/protocols
  • get:/api/protocol/{protocol}
  • get:/api/v2/chains
  • get:/api/protocols
  • get:/api/protocol/{protocol}
  • get:/api/v2/chains

Prices, Yields, And Stablecoins

价格、收益与稳定币

  • get:/coins/prices/current/{coins}
  • get:/yields/pools
  • get:/yields/chart/{pool}
  • get:/stablecoins/stablecoindominance/{chain}
  • get:/coins/prices/current/{coins}
  • get:/yields/pools
  • get:/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
    --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.
  • defillama-pro-openapi-cli <operation> ...
    is equivalent to
    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
    --secret-op
    ,而非直接在shell历史中输入明文。
  • 排查该集成问题时,避免共享原始守护进程日志。密钥会出现在请求路径中,因此若你查看
    ~/.uxc/daemon/daemon.log
    ,调试后请清理、轮换或删除日志,除非必要否则避免启用 verbose 日志。
  • defillama-pro-openapi-cli <operation> ...
    等价于
    uxc https://pro-api.llama.fi --schema-url <defillama_pro_openapi_schema> <operation> ...

References

参考资料