# DeFiLlama Chain TVL & DEX Volume Rankings

> DeFiLlama Chain TVL & DEX Volume Rankings is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-11-02).

Returns ranked DeFi chain data including TVL, DEX volumes, momentum scores, and growth trends sourced from DefiLlama, paid per-call via x402 USDC micropayment.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/api/v1/defillama/chains?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defillama-chain-tvl-dex-volume-rankings-327ebb68
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GsNSe9nLLLyX2r04l0dtJ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability defillama-chain-tvl-dex-volume-rankings-327ebb68
```

Example prompt: What are the top DeFi chains right now ranked by momentum — specifically show me Base's TVL, DEX volume, and whether it's growing or shrinking?

## When to prefer this

Use this endpoint when an AI agent needs real-time DeFi chain-level analytics — TVL rankings, DEX volume comparisons, and momentum scoring — without requiring an API key, paying only per successful call via USDC micropayment. Prefer this over free tier aggregators when building autonomous trading or onchain agents that need lightweight, pay-as-you-go access to chain health signals. Best when the agent needs to rank or compare multiple chains simultaneously rather than querying a single protocol.

## Known failure modes

- Payment failure: x402 micropayment not completed or insufficient USDC balance returns 402 error
- Invalid sort enum: values other than momentum/tvl/volume for the sort parameter may be rejected
- Unknown chain name: specifying an unrecognized chain in the chain filter may return empty focus data
- Rate limiting: excessive calls without valid payments may be throttled
- Stale data: 10-minute cache means data may be slightly delayed during high volatility periods

## How this service works

Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.

## Output

Returns a ranked list of DeFi chains with fields including TVL in USD, TVL rank, TVL 7d/30d change %, DEX volume for 24h/7d/30d periods, momentum score and rank, trend label (GROWING/SHRINKING), TVL flow, and chain ID. Also includes a summary object highlighting the biggest chain by TVL, busiest DEX chain, and fastest growing chain, plus suggested next API calls. Data is sourced from DefiLlama with a 10-minute cache.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "sort": {
       "enum": [
        "momentum",
        "tvl",
        "volume"
       ],
       "type": "string",
       "description": "Ranking key (default momentum)"
      },
      "chain": {
       "type": "string",
       "examples": [
        "Base"
       ],
       "maxLength": 40,
       "description": "Optional chain to focus, e.g. Base, Solana, Hyperliquid"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "next": [
   "/crypto/defi-tvl?chain=Base",
   "/crypto/gas-compare"
  ],
  "sort": "momentum",
  "focus": {
   "rank": 1,
   "chain": "Base",
   "trend": "GROWING"
  },
  "chains": [
   {
    "rank": 1,
    "chain": "Base",
    "flags": [],
    "trend": "GROWING",
    "tvl_usd": 5780000000,
    "chain_id": 8453,
    "tvl_flow": "flat",
    "tvl_usd_rank": 3,
    "tvl_share_pct": 5.1,
    "momentum_score": 11.1,
    "dex_volume_7d_usd": 6848442299,
    "tvl_change_7d_pct": 2.1,
    "dex_volume_24h_usd": 1466645030,
    "dex_volume_30d_usd": 29794587087,
    "tvl_change_30d_pct": 4,
    "momentum_score_rank": 1,
    "dex_volume_7d_usd_rank": 4,
    "dex_change_7d_over_7d_pct": 16.9,
    "dex_change_30d_over_30d_pct": 10.17
   }
  ],
  "source": "DefiLlama DEX volume + chain TVL (10 min cache)",
  "summary": {
   "growing": [
    "Base"
   ],
   "shrinking": [],
   "biggest_by_tvl": "Ethereum",
   "busiest_dex_7d": "Solana",
   "fastest_growing": "Base"
  },
  "updated_at": "2026-10-30T07:30:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defillama-chain-tvl-dex-volume-rankings-327ebb68/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from kr-x402-mvp.kgy5612.workers.dev](https://www.zero.xyz/host/kr-x402-mvp.kgy5612.workers.dev/llms.txt)
