defillama-openapi-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DefiLlama Public API Skill

DefiLlama 公开API Skill

Use this skill to run DefiLlama public API operations through
uxc
+ OpenAPI.
Reuse the
uxc
skill for shared execution, auth, and error-handling guidance.
使用本Skill通过
uxc
+ OpenAPI执行DefiLlama公开API操作。
复用
uxc
Skill以获取共享的执行、认证和错误处理指引。

Prerequisites

前置条件

  • uxc
    is installed and available in
    PATH
    .
  • Network access to
    https://api.llama.fi
    .
  • Access to the curated OpenAPI schema URL:
    • https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-openapi-skill/references/defillama-public.openapi.json
  • uxc
    已安装且可在
    PATH
    中访问。
  • 可访问
    https://api.llama.fi
    的网络权限。
  • 可访问精心整理的OpenAPI架构URL:
    • https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-openapi-skill/references/defillama-public.openapi.json

Scope

适用范围

This skill covers a public read-only analytics surface on
api.llama.fi
:
  • protocol TVL list
  • per-protocol detail
  • chain overview reads
This skill does not cover:
  • write operations or account management
  • DefiLlama Pro key-in-path auth
  • split-host public services such as
    coins.llama.fi
    and
    yields.llama.fi
  • the full DefiLlama public API surface
本Skill覆盖
api.llama.fi
上的公开只读分析接口:
  • 协议TVL列表
  • 单协议详情
  • 链概览读取
本Skill覆盖:
  • 写入操作或账户管理
  • DefiLlama Pro的路径中密钥认证方式
  • 拆分主机的公开服务,如
    coins.llama.fi
    yields.llama.fi
  • DefiLlama公开API的完整接口范围

Authentication

认证

This public skill does not require authentication.
本公开Skill无需认证。

Core Workflow

核心工作流程

  1. Use the fixed link command by default:
    • command -v defillama-openapi-cli
    • If missing, create it:
      uxc link defillama-openapi-cli https://api.llama.fi --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-openapi-skill/references/defillama-public.openapi.json
    • defillama-openapi-cli -h
  2. Inspect operation schema first:
    • defillama-openapi-cli get:/protocols -h
    • defillama-openapi-cli get:/protocol/{protocol} -h
    • defillama-openapi-cli get:/v2/chains -h
  3. Prefer narrow read validation before broader reads:
    • defillama-openapi-cli get:/v2/chains
    • defillama-openapi-cli get:/protocols
    • defillama-openapi-cli get:/protocol/{protocol} protocol=aave
  4. Execute with key/value parameters:
    • defillama-openapi-cli get:/protocol/{protocol} protocol=aave
    • defillama-openapi-cli get:/v2/chains
  1. 默认使用固定链接命令:
    • command -v defillama-openapi-cli
    • 若缺失,创建链接:
      uxc link defillama-openapi-cli https://api.llama.fi --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/defillama-openapi-skill/references/defillama-public.openapi.json
    • defillama-openapi-cli -h
  2. 先检查操作架构:
    • defillama-openapi-cli get:/protocols -h
    • defillama-openapi-cli get:/protocol/{protocol} -h
    • defillama-openapi-cli get:/v2/chains -h
  3. 在执行大范围读取前,优先进行窄范围读取验证:
    • defillama-openapi-cli get:/v2/chains
    • defillama-openapi-cli get:/protocols
    • defillama-openapi-cli get:/protocol/{protocol} protocol=aave
  4. 使用键/值参数执行:
    • defillama-openapi-cli get:/protocol/{protocol} protocol=aave
    • defillama-openapi-cli get:/v2/chains

Operations

支持的操作

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

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.
  • Public DefiLlama data is split across multiple hosts. This skill intentionally stays on
    api.llama.fi
    ; use the separate Pro skill when you need the unified Pro host.
  • defillama-openapi-cli <operation> ...
    is equivalent to
    uxc https://api.llama.fi --schema-url <defillama_openapi_schema> <operation> ...
    .
  • 仅对JSON输出包进行自动化处理;请勿使用
    --text
    参数。
  • 优先解析稳定字段:
    ok
    ,
    kind
    ,
    protocol
    ,
    data
    ,
    error
  • 将本v1 Skill视为只读工具。请勿暗示其支持钱包、交易或管理功能。
  • DefiLlama的公开数据分布在多个主机上。本Skill仅针对
    api.llama.fi
    ;如需统一的Pro主机服务,请使用单独的Pro Skill。
  • defillama-openapi-cli <operation> ...
    等同于
    uxc https://api.llama.fi --schema-url <defillama_openapi_schema> <operation> ...

References

参考资料

  • Usage patterns:
    references/usage-patterns.md
  • Curated OpenAPI schema:
    references/defillama-public.openapi.json
  • DefiLlama API docs: https://defillama.com/docs/api
  • 使用模式:
    references/usage-patterns.md
  • 精心整理的OpenAPI架构:
    references/defillama-public.openapi.json
  • DefiLlama API文档:https://defillama.com/docs/api