# Agent402 DeFi Fees & Revenue Data

> Agent402 DeFi Fees & Revenue Data is a paid API for AI agents from agent402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Fetches live DeFi protocol and chain-level fee and revenue metrics from DefiLlama, filterable by chain, category, and metric type

## Facts

- Endpoint: POST https://agent402.tools/api/defi-fees
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-defi-fees-revenue-data-0848cc9f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wiIi4dZzNJUA_NwSUPZ2U

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 agent402-defi-fees-revenue-data-0848cc9f -d '<json body>'
```

Example prompt: Pull the top 10 DeFi protocols on Ethereum ranked by fees, filtered to just DEXs, and show me their 24-hour and 7-day fee totals.

## When to prefer this

Use this endpoint when you need structured, ranked DeFi fee or revenue data with filtering by chain, category, or protocol name — especially when you want multi-window time comparisons (24h/7d/30d/1y) in one call. Prefer it over raw DefiLlama API calls when you need a pay-per-call, no-signup interface with pre-normalized output. It's ideal for agent workflows that need to rank protocols, detect fee spikes, or compare chains without managing API keys.

## Known failure modes

- Invalid chain name returns empty or unfiltered results
- Limit exceeding 100 is clamped or returns an error
- Unknown category string produces zero results (case-insensitive exact match required)
- Stale cache may cause fetchedAt timestamp to lag real-time by minutes
- Payment failure (insufficient USDC) results in 402 response before any data is returned

## How this service works

Protocols ranked by fees paid by users or by revenue kept, with 24h, 7d, 30d, 1y and all-time totals, change, category and chains, and chain-level gas fees on request. Use it when an agent is comparing protocols on real usage rather than TVL or valuing a token against the fees its protocol earns.

## Output

Returns a JSON object with aggregate fee/revenue totals (24h, 7d, 30d) and percentage changes at the summary level, plus a paginated list of protocols or chains each containing name, slug, rank, category, chain breakdown, and granular fee/revenue figures across multiple time windows (24h, 7d, 30d, 1y, all-time), sourced from DefiLlama.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "type": {
   "type": "string",
   "description": "Row type: \"protocol\" (default), \"chain\" (chain-level rows such as network gas fees), or \"all\"."
  },
  "chain": {
   "type": "string",
   "description": "Optional chain scope as DefiLlama names it (Ethereum, Base, Solana, Arbitrum, BSC, OP Mainnet...). Case-insensitive; common aliases accepted. Omit for all chains."
  },
  "limit": {
   "type": "number",
   "description": "Rows to return (default 25, max 100)."
  },
  "metric": {
   "type": "string",
   "description": "\"fees\" (default) or \"revenue\"."
  },
  "search": {
   "type": "string",
   "description": "Optional name/slug substring filter (case-insensitive)."
  },
  "category": {
   "type": "string",
   "description": "Optional category filter (Dexs, Lending, Derivatives, Liquid Staking, ...). Case-insensitive exact match."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "unit": "USD",
  "chain": null,
  "count": 1,
  "cached": true,
  "chains": [
   "Solana",
   "Ethereum",
   "Base"
  ],
  "metric": "fees",
  "source": "defillama-fees",
  "totals": {
   "total7dUsd": 423480844,
   "change1dPct": 6.68,
   "change1mPct": 10.2,
   "change7dPct": 2.1,
   "total24hUsd": 75393517,
   "total30dUsd": 1800000000
  },
  "matched": 2500,
  "fetchedAt": "2026-08-22T12:00:00.000Z",
  "protocols": [
   {
    "name": "Tether",
    "rank": 1,
    "slug": "tether",
    "chains": [
     "Ethereum"
    ],
    "category": "Stablecoin Issuer",
    "chainCount": 1,
    "total1yUsd": 5800000000,
    "total7dUsd": 111368600,
    "change1dPct": 0,
    "change1mPct": 1.2,
    "change7dPct": -0.03,
    "total24hUsd": 15900806,
    "total30dUsd": 481404902,
    "protocolType": "protocol",
    "totalAllTimeUsd": 20000000000
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-defi-fees-revenue-data-0848cc9f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
