# Compound Protocol API
> Live protocol metrics for Compound Finance, one of the original decentralized lending protocols, keyless. Get the total value locked across every chain Compound is deployed on, the per-asset markets across Compound v2 and v3 (Comet) with supply APY and TVL — including the v3 distinction where collateral assets back a single borrowable base asset and do not earn yield (earns_yield) — and protocol fees. One combined overview endpoint snapshots it all. Live, nothing stored. The Compound-metrics layer for DeFi dashboards, lending, yield and risk apps — distinct from other lending protocols, this is Compound own markets, v2 + v3, multi-chain.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/compound-api/..."
```

## Pricing
- **Free** (Free) — 3,500 calls/Mo, 3 req/s
- **Starter** ($22/Mo) — 95,000 calls/Mo, 8 req/s
- **Pro** ($72/Mo) — 650,000 calls/Mo, 20 req/s
- **Business** ($214/Mo) — 4,800,000 calls/Mo, 50 req/s

## Endpoints

### Overview

#### `GET /v1/overview` — Combined Compound snapshot (TVL + fees + markets + top market)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/compound-api/v1/overview"
```

**Response:**
```json
{
    "data": {
        "note": "Snapshot of Compound across all chains: TVL, number of markets, fees and the single largest market.",
        "source": "DeFiLlama",
        "fees_24h": 54430,
        "fees_30d": 1738515,
        "protocol": "Compound",
        "total_tvl": 1153780222.65,
        "top_market": {
            "tvl": 306503650,
            "asset": "WBTC",
            "chain": "Ethereum",
            "pool_id": "c1ca08e4-d618-415e-ad63-fcec58705469",
            "version": "v3",
            "reward_apy": null,
            "stablecoin": false,
            "supply_apy": null,
            "apy_30d_avg": 0,
            "earns_yield": false
        },
        "chain_count": 9,
        "market_count": 119
    },
    "meta": {
        "timestamp": "2026-06-14T08:04:30.400Z",
        "request_id": "05ecd865-98f1-4c8b-b401-bd01723cf981"
    },
    "status": "ok",
    "message": "Compound overview retrieved successfully",
    "success": true
}
```

### Metrics

#### `GET /v1/fees` — Compound protocol fees (24h/7d/30d)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/compound-api/v1/fees"
```

**Response:**
```json
{
    "data": {
        "note": "Interest and protocol fees paid across all Compound deployments, in USD.",
        "chains": [
            "Ethereum",
            "Polygon",
            "Scroll",
            "Mantle",
            "OP Mainnet",
            "Base",
            "Arbitrum",
            "Linea",
            "Unichain"
        ],
        "source": "DeFiLlama",
        "fees_7d": 368232,
        "fees_24h": 54430,
        "fees_30d": 1738515,
        "protocol": "Compound",
        "change_1d_pct": 1.26,
        "change_7d_pct": null,
        "fees_all_time": 568117881
    },
    "meta": {
        "timestamp": "2026-06-14T08:04:30.475Z",
        "request_id": "2629c2fa-1e3f-48e6-8cce-c7c959340b5f"
    },
    "status": "ok",
    "message": "Compound fees retrieved successfully",
    "success": true
}
```

#### `GET /v1/tvl` — Compound TVL total and per-chain breakdown

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/compound-api/v1/tvl"
```

**Response:**
```json
{
    "data": {
        "note": "Total value supplied to Compound (v2 + v3), in USD.",
        "chains": [
            {
                "tvl": 1052630613,
                "chain": "Ethereum"
            },
            {
                "tvl": 63284681,
                "chain": "Arbitrum"
            },
            {
                "tvl": 20103799,
                "chain": "Base"
            },
            {
                "tvl": 10449732,
                "chain": "OP Mainnet"
            },
            {
                "tvl": 5732406,
                "chain": "Polygon"
            },
            {
                "tvl": 1701718,
                "chain": "Mantle"
            },
            {
                "tvl": 1020617,
                "chain": "Unichain"
            },
            {
                "tvl": 103655,
                "chain": "Ronin"
            },
            {
                "tvl": 97521,
                "chain": "Scroll"
            }
        ],
        "source": "DeFiLlama",
        "protocol": "Compound",
        "total_tvl": 1153780222.65,
        "chain_count": 9
    },
    "meta": {
        "timestamp": "2026-06-14T08:04:30.560Z",
        "request_id": "579f3cd4-1e7a-43fc-8628-f70937e708f7"
    },
    "status": "ok",
    "message": "Compound TVL retrieved successfully",
    "success": true
}
```

### Markets

#### `GET /v1/markets` — Per-asset Compound v2/v3 markets with supply APY, TVL and earns_yield

**Parameters:**
- `version` (query, optional, string) — Compound version: v2 or v3 Example: `v3`
- `chain` (query, optional, string) — Filter by chain (e.g. Ethereum, Base, Arbitrum) Example: `Ethereum`
- `earning` (query, optional, string) — Only markets that earn supply yield (true/false) Example: `true`
- `min_tvl` (query, optional, string) — Minimum market TVL in USD Example: `1000000`
- `limit` (query, optional, string) — Results (1-100, default 25) Example: `25`
- `sort` (query, optional, string) — Sort by tvl, supply_apy or apy Example: `tvl`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/compound-api/v1/markets?version=v3&chain=Ethereum&earning=true&min_tvl=1000000&limit=25&sort=tvl"
```

**Response:**
```json
{
    "data": {
        "note": "Compound v2 + v3 markets. In v3 (Comet), collateral assets do not earn yield (earns_yield=false); only base assets do.",
        "sort": "tvl",
        "chain": "Ethereum",
        "count": 3,
        "source": "DeFiLlama",
        "markets": [
            {
                "tvl": 47442549,
                "asset": "USDT",
                "chain": "Ethereum",
                "pool_id": "f4d5b566-e815-4ca2-bb07-7bcd8bc797f1",
                "version": "v3",
                "reward_apy": 0.1,
                "stablecoin": true,
                "supply_apy": 2.69,
                "apy_30d_avg": 2.77,
                "earns_yield": true
            },
            {
                "tvl": 43620148,
                "asset": "USDC",
                "chain": "Ethereum",
                "pool_id": "7da72d09-56ca-4ec5-a45f-59114353e487",
                "version": "v3",
                "reward_apy": 0.11,
                "stablecoin": true,
                "supply_apy": 3.12,
                "apy_30d_avg": 3.45,
                "earns_yield": true
            },
            {
                "tvl": 10688036,
                "asset": "ETH",
                "chain": "Ethereum",
                "pool_id": "85c57261-b75b-4447-a115-d79b1a7de8ed",
                "version": "v3",
                "reward_apy": 0.07,
                "stablecoin": false,
                "supply_apy": 1.76,
                "apy_30d_avg": 1.6,
                "earns_yield": true

…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata & live sample

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/compound-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "markets takes optional version (v2, v3), chain (e.g. Ethereum, Base), earning (true/false — v3 collateral earns none), min_tvl, limit (1-100) and sort (tvl, supply_apy or apy). All money values are USD; APYs are percentages. Other endpoints take no parameters.",
        "sample": {
            "total_tvl": 1153780222.65,
            "market_count": 119
        },
        "source": "DeFiLlama open API (yields.llama.fi + api.llama.fi), live",
        "service": "compound-api",
        "endpoints": {
            "GET /v1/tvl": "Compound TVL total and per-chain breakdown.",
            "GET /v1/fees": "Compound protocol fees (24h/7d/30d).",
            "GET /v1/meta": "This document.",
            "GET /v1/markets": "Per-asset Compound v2/v3 markets with supply APY, TVL and earns_yield (version, chain, earning, sort).",
            "GET /v1/overview": "Combined Compound snapshot (TVL + fees + market count + top market)."
        },
        "description": "Live protocol metrics for Compound Finance, one of the original decentralized lending protocols, keyless. Total value locked across every chain, the per-asset markets across Compound v2 and v3 (Comet) with supply APY and TVL — including the v3 distinction where collateral assets do not earn yield — and protocol fees. One combined overview snapshots it all. Live, nothing stored beyond a short protective cache. The Compound-metrics layer for DeFi dashboards, lending, yield and risk apps. Dist
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/compound-api
OpenAPI spec: https://www.oanor.com/api/compound-api/openapi.json
