defillama-api

defillama-api is a skill for Claude Code from agiprolabs/claude-trading-skills. It costs 32 tokens per session (2,253 once invoked), scanned A, original, MIT.

A guide to using the free DeFiLlama API, a data service that tracks decentralised-finance activity across blockchains.

In plain words
What is it for?
It helps fetch total value locked, token prices, decentralised-exchange volumes, fees, revenue, stablecoin data and bridge information.
Why use it?
It provides one place to retrieve data that is otherwise spread across many protocols and chains, usually without authentication for its free endpoints.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the trading-skills plugin — 68 skills shipped together

not rated 354repo +12 8d ago A scan Socket: passSnyk: warnSkillSpector: warn 32 tokens original MIT

Good fit It helps fetch total value locked, token prices, decentralised-exchange volumes, fees, revenue, stablecoin data and bridge information.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agiprolabs/claude-trading-skills/defillama-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add agiprolabs/claude-trading-skills --skill defillama-api
Clone the repo
git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills

Made for: Claude Code.

Or install trading-skills, the plugin that ships this one along with the rest of its 68 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for defillama-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/agiprolabs/claude-trading-skills/defillama-api/github.svg)](https://agentmods.dev/skills/agiprolabs/claude-trading-skills/defillama-api)
Your own site
<a href="https://agentmods.dev/skills/agiprolabs/claude-trading-skills/defillama-api"><img src="https://agentmods.dev/badge/skills/agiprolabs/claude-trading-skills/defillama-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for defillama-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/agiprolabs/claude-trading-skills/defillama-api"><img src="https://agentmods.dev/badge/skills/agiprolabs/claude-trading-skills/defillama-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,253 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 21 Mar 2026
  • Snyk warn 21 Mar 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 173
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 199
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 202
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 203
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.02253
Opus 5 $0.00016 $0.01126
Sonnet 5 $0.00006 $0.00451
Haiku 4.5 $0.00003 $0.00225

Measured 12d ago against content hash 78fecd91ca49, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

defillama-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/defi_snapshot.py, scripts/price_lookup.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/defillama-api/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DeFiLlama API — DeFi Macro Analytics

DeFiLlama is the largest DeFi TVL aggregator. Its API is free with no authentication for most endpoints — covering TVL, token prices, DEX volumes, fees/revenue, stablecoins, and bridges across all chains.

Quick Start

import httpx

# No auth required for free endpoints
BASE = "https://api.llama.fi"
COINS = "https://coins.llama.fi"

# Current TVL for a protocol
tvl = httpx.get(f"{BASE}/tvl/raydium").json()
print(f"Raydium TVL: ${tvl:,.0f}")

# Token prices (multi-chain)
resp = httpx.get(f"{COINS}/prices/current/solana:So11111111111111111111111111111111111111112")
sol_price = resp.json()["coins"]["solana:So11111111111111111111111111111111111111112"]["price"]

Base URLs

Service Base URL Auth
TVL / Protocols https://api.llama.fi Free
Coin Prices https://coins.llama.fi Free
Stablecoins https://stablecoins.llama.fi Free
Yields https://yields.llama.fi Pro ($300/mo)
Bridges https://bridges.llama.fi Free (list) / Pro (detail)
Pro API https://pro-api.llama.fi/{KEY}/api/... Pro key in URL path

Rate limits: ~500 requests per 5 minutes (free). Pro: 1,000 req/min, 1M calls/mo.

TVL & Protocol Data

# List all protocols with TVL
GET /protocols
# Returns: [{name, slug, tvl, chainTvls, change_1h, change_1d, change_7d, category, chains, ...}]

# Detailed protocol data with historical TVL
GET /protocol/{slug}
# Returns: Full object with tvl[], tokensInUsd{}, currentChainTvls{}, ...

# Simple current TVL number
GET /tvl/{slug}
# Returns: plain number (e.g., 150977324562.40)

# TVL for all chains
GET /v2/chains
# Returns: [{name, tvl, tokenSymbol, chainId, gecko_id}]

# Historical chain TVL
GET /v2/historicalChainTvl/{chain}
# chain: "Ethereum", "Solana", "Arbitrum", etc.
# Returns: [{date, tvl}] — date is unix timestamp (seconds)

Token Prices

Coin identifiers use {chain}:{address} format:

  • solana:So11111111111111111111111111111111111111112 (SOL)
  • ethereum:0xdac17f958d2ee523a2206206994597c13d831ec7 (USDT)
  • coingecko:bitcoin (non-chain lookups)

Read the full file on GitHub · 270 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 270 lines · 32 tokens per session scan A 78fecd91ca49

Subscribe to this mod's changes

defillama-api is a skill published in the GitHub repository agiprolabs/claude-trading-skills (354 stars, last pushed 8d ago), licensed MIT. It adds 32 tokens to every session and 2,253 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.