# DefiLlama TVL Oracle

> DefiLlama TVL Oracle is a paid API for AI agents from api.chainmarket-api.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-24).

Fetches the current total value locked (TVL) in USD for a specified DeFi protocol via DefiLlama

## Facts

- Endpoint: GET https://api.chainmarket-api.workers.dev/api/crypto/defillama-tvl-oracle?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defillama-tvl-oracle-cdb2b193
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_i2Eq2rIowlasYM_w3btyo

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-tvl-oracle-cdb2b193
```

Example prompt: What is the current total value locked for Aave? Look it up via the DefiLlama TVL oracle using the protocol slug 'aave'.

## When to prefer this

Choose this endpoint when you need current TVL data for a specific DeFi protocol without signing up for an API key. It is ideal for AI agents that need pay-per-call on-chain finance data with no authentication overhead. Prefer it over scraping DefiLlama directly or using a full DeFi data subscription when you only need TVL for one protocol at a time.

## Known failure modes

- Invalid or unknown protocol slug returns an error or empty result
- Protocol slug must be lowercase with dashes — incorrect casing or spaces may cause lookup failure
- DefiLlama API upstream unavailability may cause request to fail
- Misspelled protocol slugs (e.g. 'uni-swap' instead of 'uniswap') will not match

## How this service works

Current total value locked (TVL, USD) of one DeFi protocol from DefiLlama, by protocol slug (e.g. aave, uniswap-v3). Returns the single current TVL number only; chain breakdown and history are not included.

## Output

Returns a JSON object containing the protocol slug, TVL in USD as a floating-point number, the DefiLlama source URL, and the timestamp when the data was checked (e.g. {protocol: 'aave', tvlUsd: 17983507210.47, source: 'https://api.llama.fi/tvl/aave', checkedAt: '2026-10-23T09:35:53.785Z'}).

## 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",
     "required": [
      "protocol"
     ],
     "properties": {
      "protocol": {
       "type": "string",
       "description": "DefiLlama protocol slug, lowercase letters, digits and dashes"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "source": "https://api.llama.fi/tvl/aave",
  "tvlUsd": 17983507210.47533,
  "protocol": "aave",
  "checkedAt": "2026-10-23T09:35:53.785Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defillama-tvl-oracle-cdb2b193/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.chainmarket-api.workers.dev](https://www.zero.xyz/host/api.chainmarket-api.workers.dev/llms.txt)
