# DeFi TVL Microdata API

> DeFi TVL Microdata API is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-31).

Returns total DeFi TVL with multi-period % changes, risk signal, top chains ranked by TVL, and optional per-chain or per-protocol breakdown in a single call.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/crypto/defi-tvl?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-tvl-microdata-api-a0772efe
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uHfFukO3vbXsfTPy-BBWI

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 defi-tvl-microdata-api-a0772efe
```

Example prompt: What's the current DeFi risk signal and total TVL, and where does Base rank among the top 20 chains by TVL share?

## When to prefer this

Choose this endpoint when an AI agent needs DeFi TVL, chain rankings, capital flow signals, and risk sentiment in a single $0.002 call — instead of buying separate TVL and DeFi overview calls from other providers. Ideal for trading agents, portfolio monitors, or any workflow that needs a fast, cheap, structured DeFi health check without assembling data from multiple sources. Also prefer when you need Base-specific TVL context or a DefiLlama-backed protocol TVL figure (e.g. Aave, Lido, Uniswap, Aerodrome).

## Known failure modes

- Invalid chain name returns no chain block or error
- Invalid protocol slug returns no protocol block
- limit out of range (1-50) causes validation error
- DefiLlama upstream unavailability may cause stale or missing data
- Payments via x402 failing due to insufficient USDC balance block the request entirely

## How this service works

DeFi TVL in ONE call (others sell TVL and DeFi overview as two $0.003 calls): total DeFi TVL with 1d/7d/30d % change and flow inflow|flat|outflow, signal RISK_ON|NEUTRAL|RISK_OFF, top chains ranked by TVL with share %, Base rank+share; chain=Base|Ethereum|Solana|... adds that chain's TVL, rank, share and 1d/7d/30d flow; protocol=aave|lido|uniswap|aerodrome (DefiLlama slug) adds protocol TVL and share. limit=1-50 top chains (default 15).

## Output

A JSON object containing: total DeFi TVL in USD with 1d/7d/30d % changes and flow direction; a macro risk signal (RISK_ON, NEUTRAL, or RISK_OFF) with human-readable reasons; a ranked list of top chains (up to 50) with name, TVL, and share %; optionally a per-chain breakdown (TVL, rank, share, flow, chain_id, as_of) and/or a per-protocol breakdown (TVL, share); a Base-specific summary; data source URL; and an updated_at timestamp.

## 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": {
      "chain": {
       "type": "string",
       "examples": [
        "Base",
        "Ethereum"
       ],
       "maxLength": 40,
       "description": "Chain name, e.g. Base, Ethereum, Solana"
      },
      "limit": {
       "type": "integer",
       "maximum": 50,
       "minimum": 1,
       "description": "Top chains to list (default 15)"
      },
      "protocol": {
       "type": "string",
       "examples": [
        "aave"
       ],
       "maxLength": 60,
       "description": "DefiLlama protocol slug, e.g. aave, lido, aerodrome"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "defi": {
   "base": {
    "rank": 5,
    "tvl_usd": 3900000000,
    "share_pct": 3.1
   },
   "flow": "flat",
   "change_1d_pct": 0.3,
   "change_7d_pct": -2.1,
   "total_tvl_usd": 125000000000,
   "chains_counted": 300,
   "change_30d_pct": 4
  },
  "next": [
   "/crypto/global-market",
   "/crypto/stablecoin-peg"
  ],
  "chain": {
   "flow": "flat",
   "name": "Base",
   "rank": 5,
   "as_of": "2026-10-30",
   "tvl_usd": 3900000000,
   "chain_id": 8453,
   "change_1d_pct": 0.4,
   "change_7d_pct": -1.2,
   "change_30d_pct": 5.6,
   "share_of_defi_pct": 3.1
  },
  "signal": "NEUTRAL",
  "source": "https://defillama.com",
  "reasons": [
   "DeFi TVL $125.0B, 7d -2.1%",
   "Base #5 $3.90B, 7d -1.2% (flat)"
  ],
  "top_chains": [
   {
    "name": "Ethereum",
    "rank": 1,
    "token": "ETH",
    "tvl_usd": 70000000000,
    "share_pct": 56
   }
  ],
  "updated_at": "2026-10-30T02:30:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-tvl-microdata-api-a0772efe/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)
