微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📊

链上数据专业分析工具

DefiLlama Pro OpenAPI Skill · v1.0.0
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
专业技能 安全 B 级 作者 jolestar 公开目录收录
622 下载 0 安装 2.4k 收藏 13 浏览

简介

通过UXC调用DefiLlama Pro分析API,支持TVL、收益、稳定币等链上数据查询,采用路径模板API密钥认证。

原始描述

Operate DefiLlama Pro analytics APIs through UXC with a curated OpenAPI schema, path-templated API-key auth, and read-first guardrails.

通过你的 Agent 添加

安装目录:defillama-pro-openapi-skill/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/defillama-pro-openapi-skill/
Codex CLI~/.codex/skills/defillama-pro-openapi-skill/
DeepSeek Harness~/.agents/skills/defillama-pro-openapi-skill/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

DefiLlama Pro API Skill 是一套基于 uxc 命令行工具的链上数据分析接口封装,专为 DeFi 研究者、量化分析师和协议开发者设计。用户通过预置的 OpenAPI Schema 调用 DefiLlama Pro 的只读分析端点,涵盖协议 TVL 列表与详情、链级概览、实时代币价格、收益矿池发现与历史图表、稳定币市场份额等核心数据维度。

显著优点

  1. 结构化查询体验:基于 OpenAPI 的强类型接口,支持参数自动补全与校验,降低手工构造 URL 的错误率。
  2. 安全认证模型:采用路径模板(path-templated)API 密钥注入,密钥通过环境变量或密钥管理器(如 1Password)传入,避免硬编码泄露。
  3. 只读安全边界:明确排除写操作、账户管理、钱包交互等高敏感功能,降低误操作风险。
  4. 生态整合:与 uxc 生态共享执行引擎、统一错误处理和日志体系,便于多技能组合使用。

潜在局限

  • 功能覆盖有限:仅封装 Pro 版本的 curated 端点子集,未覆盖完整 API 表面,复杂查询可能需要直接调用底层 REST。
  • 密钥暴露风险:由于 DefiLlama Pro 将 API key 嵌入请求路径,密钥可能出现在 URL、日志或代理服务器访问记录中,需严格遵循 --secret-env 或 --secret-op 最佳实践,并定期清理 ~/.uxc/daemon/daemon.log。
  • 网络依赖:依赖 pro-api.llama.fi 的可用性,无本地缓存或离线模式。

适合人群

  • DeFi 协议分析师、数据科学家、量化交易研究员
  • 需要自动化获取链上 TVL/收益率/稳定币数据的开发者
  • 已通过 DefiLlama Pro 订阅获取 API key 的机构用户

常规风险

  • 密钥泄露:路径中的 API key 可能被日志系统、CDN、浏览器历史记录捕获,建议使用专用只读 key 并启用轮转。
  • 数据准确性:DefiLlama 数据依赖链上聚合,可能存在协议误分类或 TVL 计算偏差,关键决策建议交叉验证。
  • 速率限制:Pro API 通常有请求配额,高频自动化需关注官方限流策略。
  • 供应链安全:OpenAPI Schema 托管于 GitHub 仓库,需验证 references/defillama-pro.openapi.json 的完整性与签名。

技能正文


name: defillama-pro-openapi-skill description: Operate DefiLlama Pro analytics APIs through UXC with a curated OpenAPI schema, path-templated API-key auth, and read-first guardrails.

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:

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:

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

Operation Groups

Protocol And Chain Analytics

  • 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}

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> ....

References

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

defillamadefi-analyticstvlyield-farmingstablecoinapi-clientuxcpro-api

同类 Skill