# DefiLlama Data Export – TVL, Stablecoins, DEX, Fees, Yields (`fast_data_asap/defillama-defi-data`) Actor

Export DefiLlama DeFi data as flat tables: protocol & chain TVL, TVL history, stablecoin supply, DEX volumes, fees & revenue and yield pool APYs. Filter by chain, category, TVL. No API key. Pay per row.

- **URL**: https://apify.com/fast_data_asap/defillama-defi-data.md
- **Developed by:** [Fast Data](https://apify.com/fast_data_asap) (community)
- **Categories:** Developer tools, AI
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.20 / 1,000 rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## DefiLlama DeFi Data Export – TVL, Stablecoins, DEX Volumes, Fees & Yields

Export the most-used [DefiLlama](https://defillama.com) DeFi datasets as **clean, flat tables**, ready for Excel, Google Sheets, BI tools, databases, n8n/Make/Zapier workflows and AI agents. One run = one table, with a `snapshotAt` timestamp on every row.

| `dataset` | What you get (one row per…) |
|---|---|
| `protocols` | protocol: name, slug, category, chains, TVL, 1h/1d/7d TVL change %, market cap, mcap/TVL, top chains, website |
| `chains_tvl` | chain: TVL, share of total DeFi TVL %, native token, chain ID |
| `protocol_history` | protocol × day (optionally × chain): daily TVL for the last N days, change vs previous point |
| `stablecoins` | stablecoin: symbol, peg type & mechanism, price, circulating supply (USD), 1d/7d/30d supply change %, top chains |
| `stablecoin_chains` | chain: total stablecoin supply (USD), share %, USD/EUR/other-pegged split |
| `dex_volumes` | DEX: 24h / 7d / 30d / 1y / all-time volume, 1d/7d/1m change % |
| `fees_revenue` | protocol: 24h / 7d / 30d / 1y fees **and** revenue, change % |
| `yields` | yield pool: project, chain, symbol, TVL, APY, base APY, reward APY, 30d mean APY, stablecoin flag, IL risk, exposure |

No API key, no login, no proxies. A typical run takes **3–10 seconds**.

### Who it is for

- **Analysts, researchers and journalists** who need DeFi TVL, stablecoin or fee numbers in a spreadsheet without writing code.
- **Data teams** loading daily DeFi snapshots into a warehouse (schedule the actor and append the dataset).
- **Dashboard builders** (Looker Studio, Power BI, Metabase, Notion) who want stable column names.
- **AI agents and LLM apps** that need a reliable "current DeFi data" tool via MCP.

### Why this actor

- **8 datasets in one actor** with one consistent, flat schema per dataset. No nested JSON to unpack: chains are comma-separated strings and percentages are plain numbers.
- **Useful filters** that the raw API does not have: chains, categories, protocol slugs, stablecoin symbols, minimum TVL, minimum APY, stablecoin-only pools, Top N.
- **Computed fields**: chain market share %, stablecoin supply changes, mcap/TVL ratio, TVL on your selected chains, fees and revenue merged into one row.
- **Handles the big endpoints**: protocol history and yield pools are streamed to disk and parsed incrementally, so even 100 MB+ responses run on 512 MB memory.
- **CEX reserves are excluded by default** so the protocols table is DeFi only (toggle `excludeCex`).
- **Cheap and capped**: $0.20 per 1,000 rows, with a hard `maxRows` cap (default 100).

### Input

Default input (top 20 DeFi protocols by TVL):

```json
{
  "dataset": "protocols",
  "topN": 20
}
```

More examples:

```json
{ "dataset": "protocols", "categories": ["Lending"], "chains": ["Base"], "topN": 10 }
{ "dataset": "chains_tvl", "topN": 25 }
{ "dataset": "protocol_history", "protocols": ["aave", "lido"], "days": 90, "includeChainBreakdown": true, "chains": ["Ethereum", "Arbitrum"], "maxRows": 1000 }
{ "dataset": "stablecoins", "stablecoinSymbols": ["USDT", "USDC", "USDe", "DAI"] }
{ "dataset": "dex_volumes", "chains": ["Solana"], "topN": 15 }
{ "dataset": "fees_revenue", "topN": 50 }
{ "dataset": "yields", "chains": ["Ethereum"], "stablecoinPoolsOnly": true, "minTvlUsd": 10000000, "topN": 50 }
```

| Field | Description |
|---|---|
| `dataset` | One of the 8 datasets above. |
| `topN` | Keep the N largest entries after filtering (by TVL, supply, 24h volume or fees; yields by TVL or APY). 0 = no limit. Not applied to `protocol_history`. |
| `maxRows` | Hard cap on output rows (= billable events). Default 100. |
| `chains` | Chain names, case-insensitive (Ethereum, Solana, Base, Arbitrum, BSC, Tron …). |
| `categories` | DefiLlama categories (Lending, Dexs, Liquid Staking, Bridge, CDP, Restaking, Derivatives …). |
| `protocols` | DefiLlama slugs (as in `defillama.com/protocol/<slug>`). Needed for `protocol_history` (max 25, defaults to aave and lido); filters other datasets. For `yields` use project names like `aave-v3`, `lido`. |
| `stablecoinSymbols` | USDT, USDC, DAI … for `stablecoins`; for `yields` keeps pools containing that token. |
| `minTvlUsd` | Minimum TVL (or circulating supply for stablecoins). |
| `excludeCex` | Drop centralized-exchange reserve entries from `protocols` (default on). |
| `days`, `includeChainBreakdown` | History length and per-chain rows for `protocol_history`. |
| `stablecoinPoolsOnly`, `minApy`, `yieldsSortBy` | Yield pool filters and ranking. |

### Output

Every row has `dataset`, `rank`, `snapshotAt` (UTC), `source` and `status`. Real rows from a test run on 2026-11-06:

`protocols` (default input):

```json
{
  "dataset": "protocols",
  "rank": 1,
  "name": "Lido",
  "slug": "lido",
  "category": "Liquid Staking",
  "chains": "Ethereum, Solana, Terra, Moonriver, Moonbeam",
  "chainCount": 5,
  "tvlUsd": 21772660694.61,
  "change1hPct": 0.51,
  "change1dPct": -7.4,
  "change7dPct": 0.55,
  "mcapUsd": 277250073.15,
  "mcapToTvl": 0.013,
  "symbol": "LDO",
  "topChainsByTvl": "Ethereum, Solana",
  "url": "https://lido.fi/",
  "defillamaUrl": "https://defillama.com/protocol/lido",
  "twitter": "LidoFinance",
  "listedAt": null,
  "snapshotAt": "2026-11-06T11:26:57Z",
  "source": "DefiLlama",
  "status": "ok"
}
```

The rest of that run's top 5: LayerZero V2 ($17.1B), Aave V3 ($15.2B), SSV Network ($11.7B), Morpho Blue ($11.0B).

`protocol_history` (aave, Arbitrum):

```json
{
  "dataset": "protocol_history",
  "protocol": "Aave",
  "slug": "aave",
  "chain": "Arbitrum",
  "date": "2026-11-05",
  "timestamp": "2026-11-05T00:00:00Z",
  "isIntraday": false,
  "tvlUsd": 509999354,
  "changeVsPrevPointPct": null,
  "snapshotAt": "2026-11-06T11:27:17Z",
  "source": "DefiLlama",
  "status": "ok"
}
```

The last point of each history series is DefiLlama's current (intraday) value and is marked `isIntraday: true`.

Other datasets use these columns:

- `chains_tvl`: chain, tvlUsd, sharePct, tokenSymbol, chainId, geckoId, defillamaUrl
- `stablecoins`: symbol, name, pegType, pegMechanism, priceUsd, circulating, circulatingUsd, change1dPct, change7dPct, change30dPct, chainCount, topChains, geckoId
- `stablecoin_chains`: chain, stablecoinSupplyUsd, sharePct, usdPeggedUsd, eurPeggedUsd, otherPeggedUsd
- `dex_volumes`: protocol, slug, category, chains, volume24hUsd, volume7dUsd, volume30dUsd, volume1yUsd, volumeAllTimeUsd, change1dPct, change7dPct, change1mPct
- `fees_revenue`: protocol, slug, category, chains, fees24hUsd, fees7dUsd, fees30dUsd, fees1yUsd, feesChange1dPct, feesChange7dPct, revenue24hUsd, revenue7dUsd, revenue30dUsd, revenue1yUsd, revenueChange7dPct
- `yields`: pool, project, chain, symbol, poolMeta, tvlUsd, apy, apyBase, apyReward, apyMean30d, apyChange1d/7d/30d, stablecoin, ilRisk, exposure, volume1dUsd, outlier, predictedClass, rewardTokens, defillamaUrl

Download as JSON, CSV, Excel or HTML from the dataset tab or the API.

### Pricing

Pay per event: **$0.0002 per output row** ($0.20 per 1,000 rows), plus Apify's tiny actor start fee. The default run (20 rows) costs about $0.004. Error rows (e.g. an unknown protocol slug) are free. `maxRows` caps your cost per run.

### Use it via API, n8n, Make or MCP

**API** (synchronous, returns the rows directly):

```bash
curl -X POST "https://api.apify.com/v2/acts/fast_data_asap~defillama-defi-data/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"dataset":"stablecoins","topN":10}'
```

**Python**:

```python
from apify_client import ApifyClient
rows = ApifyClient("YOUR_APIFY_TOKEN").actor("fast_data_asap/defillama-defi-data") \
    .call(run_input={"dataset": "chains_tvl", "topN": 20}).dataset().list_items().items
```

**n8n / Make / Zapier**: use the Apify node or app, choose "Run actor and get dataset items", actor `fast_data_asap/defillama-defi-data`. Schedule it daily to build your own DeFi time series.

**MCP (Claude, Cursor, other AI agents)**: add `https://mcp.apify.com?tools=fast_data_asap/defillama-defi-data` as an MCP server. Your agent can then ask for things like "top 10 lending protocols on Base by TVL" or "stablecoin supply by chain".

### Data source, rate limits and fair use

All data comes from the free public **[DefiLlama](https://defillama.com) API** (api.llama.fi, stablecoins.llama.fi, yields.llama.fi). Credit for collecting and maintaining the data goes to DefiLlama and its open-source adapter contributors. Please credit DefiLlama when you publish the data.

To respect DefiLlama's free API limits, the actor sends requests one at a time, fetches each endpoint at most once per run (cached), spaces protocol-history requests about 1 second apart, caps history at 25 protocols per run, and backs off on HTTP 429 or 5xx responses. It identifies itself with a descriptive User-Agent.

This actor is not affiliated with DefiLlama. Values are DefiLlama's methodology (for example, TVL excludes borrowed and staked governance tokens by default) and may change or be revised by DefiLlama.

### Disclaimer

The data is provided for information and research only, as published by DefiLlama, without warranty of accuracy or completeness. It is not financial advice or a recommendation to buy, sell or use any protocol or token. APY figures are historical or current values reported by the protocols and are not guaranteed.

# Actor input Schema

## `dataset` (type: `string`):

Which DefiLlama table to export.

## `topN` (type: `integer`):

Return only the N largest entries (by TVL, supply or 24h volume/fees) after filtering. 0 = no limit (maxRows still applies).

## `maxRows` (type: `integer`):

Hard cap on output rows. Every row is one billable event.

## `chains` (type: `array`):

Optional chain names, e.g. Ethereum, Solana, Arbitrum, Base (case-insensitive). Filters protocols, chains, stablecoins, DEXs, fees and yield pools to these chains.

## `categories` (type: `array`):

Optional DefiLlama categories, e.g. Lending, Dexs, Liquid Staking, Bridge, CDP, Yield, Derivatives (case-insensitive). Applies to protocols, DEX volumes and fees.

## `protocols` (type: `array`):

DefiLlama protocol slugs, e.g. aave, lido, uniswap, curve-dex. Used by 'Protocol TVL history' (max 25; defaults to aave and lido). For other datasets it filters by slug / yield project name.

## `stablecoinSymbols` (type: `array`):

Optional stablecoin symbols, e.g. USDT, USDC, DAI, USDe. Applies to the stablecoins dataset and yield pools (symbol contains).

## `minTvlUsd` (type: `integer`):

Drop entries below this TVL (protocols, chains, yield pools) or circulating supply (stablecoins). 0 = off.

## `excludeCex` (type: `boolean`):

DefiLlama also tracks CEX reserves in the protocols list. On by default so the protocols table is DeFi only.

## `days` (type: `integer`):

Protocol TVL history: how many most recent daily data points per protocol.

## `includeChainBreakdown` (type: `boolean`):

Protocol TVL history: also output one row per chain and day (more rows).

## `stablecoinPoolsOnly` (type: `boolean`):

Yield pools: keep only pools flagged as stablecoin pools.

## `minApy` (type: `integer`):

Yield pools: drop pools below this total APY. 0 = off.

## `yieldsSortBy` (type: `string`):

Yield pools: ranking used for Top N.

## Actor input object example

```json
{
  "dataset": "protocols",
  "topN": 20,
  "maxRows": 100,
  "minTvlUsd": 0,
  "excludeCex": true,
  "days": 30,
  "includeChainBreakdown": false,
  "stablecoinPoolsOnly": false,
  "minApy": 0,
  "yieldsSortBy": "tvlUsd"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "dataset": "protocols",
    "topN": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("fast_data_asap/defillama-defi-data").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "dataset": "protocols",
    "topN": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("fast_data_asap/defillama-defi-data").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "dataset": "protocols",
  "topN": 20
}' |
apify call fast_data_asap/defillama-defi-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fast_data_asap/defillama-defi-data"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7GNy2e62ZaAfyjiIT/builds/dCLO5wRFd5XezZ6rB/openapi.json
