# DefiLlama Scraper — Protocol TVL, Chains, Yields & Stablecoins (`yadroo/defillama-protocols`) Actor

DeFi data from DefiLlama for AI agents: protocol TVL rankings with growth filters, protocol detail, chain TVL, yield pools with risk filters, stablecoin supply and depegs, fees/revenue, DEX volumes, TVL history and exploits. No API key.

- **URL**: https://apify.com/yadroo/defillama-protocols.md
- **Developed by:** [Samat Makatov](https://apify.com/yadroo) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

DeFi market data from DefiLlama's public API: protocol TVL rankings, per-chain TVL, yield pools with APY and risk flags, stablecoin supplies and depegs, protocol fees/revenue, DEX volumes, TVL history and the exploit database. Twelve modes, rich filters, one normalized row per item with a stable `id`, `sourceUrl` and `fetchedAt`. No API key, no proxy, no browser.

### Use cases

- **DeFi lead lists / BD** — `mode: protocols`, `listedAfter: 2026-08-01`, `minTvl: 1000000`, `excludeCategories: ["CEX","Chain"]` → new protocols worth contacting.
- **TVL outflow alerts** — `maxChange7d: -30` on a schedule; alert when a protocol you hold loses a third of its TVL.
- **Yield desk / treasury** — `mode: yields`, `stablecoinOnly: true`, `minTvl: 10000000`, `maxApy: 30`, `minApyMean30d: 4` → sustainable stablecoin yields.
- **Depeg monitoring** — `mode: stablecoins`, `minPegDeviationPct: "0.5"` → stablecoins trading ≥0.5% off peg.
- **Revenue research / due diligence** — `mode: fees`, `feeMetric: dailyRevenue` + `protocolHistory` for TVL trend of a target.
- **Risk & security reports** — `mode: hacks`, `days: 365`, `minAmountUsd: 1000000` → last year's exploits with technique and chain.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `mode` | string | `protocols` | `protocols`, `protocol`, `chains`, `yields`, `stablecoins`, `fees`, `volumes`, `protocolHistory`, `chainHistory`, `yieldHistory`, `stablecoinHistory`, `hacks`. Other values are refused by Apify before the run. |
| `limit` | integer | `100` | Max rows of the whole run (all chains, slugs and series together), after filtering and sorting. Billing is per row. |
| `fields` | array | `[]` | Keep only these columns, in this order; `id` is always kept. See [Output fields](#output). |
| `chain` / `chains` | string / array | — | Chain names (see Reference). Aliases work: `eth`, `bsc`/`bnb`, `op`/`optimism`, `arb`, `xdai`/`gnosis`, `hyperliquid`… |
| `category` / `categories` | string / array | — | DefiLlama category (see Reference). Aliases: `dex`/`dexes`→Dexs, `perps`→Derivatives, `lst`→Liquid Staking, `lrt`→Liquid Restaking, `rwas`→RWA… In `yields`, `category` = project slug (legacy). |
| `excludeCategories` | array | — (form prefill `["CEX","Chain"]`) | protocols: drop these categories, e.g. CEX reserves and L1 chains for pure DeFi rankings. |
| `slugs` | array | `[]` | Protocol slugs from `defillama.com/protocol/<slug>`. Required for `protocol`, `protocolHistory`; a whitelist in `protocols`, `fees`, `volumes`, where a parent slug (`aave`, `uniswap`) matches its versions. |
| `search` | string | — | Substring on name/symbol. |
| `minTvl` / `maxTvl` | integer | empty / — | TVL bounds (USD); for stablecoins `minTvl` = min circulating. Empty `minTvl` = $1,000,000 for rankings, but 0 for slugs or chains you name (and when `maxTvl` is below $1M). Not used by fees/volumes. |
| `minChange1d` / `maxChange1d` / `minChange7d` / `maxChange7d` | number | — | protocols: TVL change bounds in % (decimals allowed). |
| `listedAfter` / `listedBefore` | date | — | protocols: listing date window (YYYY-MM-DD). |
| `auditedOnly` | boolean | `false` | protocols with ≥1 audit on DefiLlama. |
| `includeChainTvls` | boolean | `false` | protocols: add `chainTvls` {chain: usd}. |
| `chainDetails` | boolean | `true` | chains: add TVL change 1d/7d/30d and protocol count to each returned chain (one small request per chain). |
| `projects` | array | `[]` | yields: project slugs (`aave-v3`, `pendle`, `morpho-v1`…). |
| `symbols` | array | `[]` | yields: pool symbol contains any token (`USDC`). |
| `minApy` / `maxApy` / `minApyMean30d` | number | — | yields APY bounds (%, decimals allowed). |
| `stablecoinOnly` / `singleExposureOnly` / `noIlOnly` | boolean | `false` | yields risk filters. |
| `excludeOutliers` | boolean | `true` | yields: drop pools DefiLlama flags as outliers. |
| `poolIds` | array | `[]` | yieldHistory: pool UUIDs (field `pool` from yields). |
| `pegTypes` / `pegMechanisms` | array | `[]` | stablecoins (see Reference). Peg types take the code or the currency (`peggedUSD` or `USD`); mechanisms take `fiat`/`crypto`/`algo` too. |
| `minPegDeviationPct` / `maxPegDeviationPct` | string (decimal) | — | stablecoins: distance from peg in %, e.g. `"0.5"` (a comma or a trailing % is fine). |
| `includeChainBreakdown` | boolean | `false` | stablecoins: add `chainCirculating`. |
| `feeMetric` | string | `dailyFees` | fees: `dailyFees` or `dailyRevenue`. |
| `volumeType` | string | `dexs` | volumes: `dexs`, `aggregators`, `options`, `aggregator-derivatives`, `bridge-aggregators`, `open-interest`. |
| `minTotal24h` | integer | — | fees/volumes: min last-24h value in USD. |
| `includeBreakdown` | boolean | `false` | fees/volumes: add `breakdown24h` {chain: usd}. |
| `from` / `to` / `days` | date / date / integer | — | History windows (default last 90 days); hacks window (default all time). |
| `aggregate` | string | `daily` | History modes: `daily`, `weekly`, `monthly` (OHLC-style buckets). |
| `minAmountUsd` | integer | — | hacks: min loss. |
| `sortBy` / `sortDir` | string | per mode / `desc` | protocols: `tvl, change1d, change7d, change1m, mcap, mcapTvl, listedAt, name`; chains: `tvl, chain`; yields: `tvl, apy, apyBase, apyReward, apyMean30d, apyPct7d, volumeUsd1d`; stablecoins: `circulating, change1d, change7d, change30d, pegDeviationPct, chainCount, name`; fees/volumes: `total24h, total7d, total30d, total1y, change1d, change7d, change1m, name`; hacks: `date, amountUsd, name`. Empty = the first one. |

Legacy inputs (`mode`, `chain`, `category`, `slugs`, `minTvl`, `limit`) keep their names and meaning.

**How names are read.** Chain, category, project, peg and `sortBy` names are matched ignoring letter case, accents, spaces, `-` and `_`, plus the aliases above and DefiLlama's old and new chain names (`Binance` = `BSC`, `Optimism` = `OP Mainnet`, `xDai` = `Gnosis`…). Every such reading is listed in the status message and `SUMMARY.notes`. A name that matches nothing stops the run before any row is saved, with a "did you mean" list — it is never dropped and never replaced by a look-alike (dropping it used to return unfiltered rows). Slugs DefiLlama does not know are named in the status message and never billed; when none of them exists the run fails with that message. Inputs the chosen mode does not read (e.g. `minApy` in `protocols`) are listed in the status message instead of being ignored silently.

### Reference

**Modes → source endpoint**

| Mode | Row = | Source |
|---|---|---|
| `protocols` | protocol (or protocol × chain) | `api.llama.fi/protocols` |
| `protocol` | protocol detail (TVL now/1d/7d/30d ago, ATH, chain TVLs, audits, raises, hacks, hallmarks) | `api.llama.fi/protocol/<slug>` |
| `chains` | chain TVL, TVL change 1d/7d/30d, protocol count | `api.llama.fi/v2/chains` + `/v2/historicalChainTvl/<chain>` + `/protocols` |
| `yields` | pool | `yields.llama.fi/pools` |
| `yieldHistory` | pool × day / week / month | `yields.llama.fi/chart/<pool>` |
| `stablecoins` | stablecoin | `stablecoins.llama.fi/stablecoins` |
| `stablecoinHistory` | day / week / month (all chains or per chain) | `stablecoins.llama.fi/stablecoincharts/<chain>` |
| `fees` / `volumes` | protocol (or protocol × chain) | `api.llama.fi/overview/{fees,dexs,…}` |
| `protocolHistory` / `chainHistory` | day / week / month | `api.llama.fi/protocol`, `/v2/historicalChainTvl` |
| `hacks` | exploit | `api.llama.fi/hacks` |

**Top chain names:** Ethereum, Solana, BSC, Base, Arbitrum, Tron, Bitcoin, Hyperliquid L1, Avalanche, Polygon, OP Mainnet, Sui, Aptos, TON, Mantle, Sei, Plasma, Monad, Ink, Stellar, ZKsync Era, Linea, Scroll, Blast, Berachain, Sonic, Unichain, Gnosis (xDai). Full list: [defillama.com/chains](https://defillama.com/chains).

**Categories (protocols / fees / volumes, Sep 2026):** AI Agents, Algo-Stables, Anchor BTC, Basis Trading, Block Builders, Bridge, Bridge Aggregator, Bug Bounty, CDP, CDP Manager, CEX, Canonical Bridge, CeDeFi, Chain, Chain Bribes, Collateral Management, Collateral Markets, Cross Chain Bridge, Crypto Card Issuer, DCA Tools, DEX Aggregator, DePIN, Decentralized AI, Decentralized BTC, Derivatives, Developer Tools, Dexs, Domains, Exotic Options, Farm, Gaming, Governance Incentives, Identity & Reputation, Indexes, Insurance, Interest Rate Derivatives, Interface, Launchpad, Lending, Leveraged Farming, Liquid Restaking, Liquid Staking, Liquidations, Liquidity Automation, Liquidity Manager, MEV, Meme, Mining Pools, NFT Lending, NFT Marketplace, NftFi, OTC Marketplace, Onchain Capital Allocator, Options, Options Vault, Oracle, Payments, Portfolio Tracker, Prediction Market, Privacy, RWA, Reserve Currency, Restaked BTC, Restaking, Risk Curators, SoFi, Stablecoin Issuer, Staking Pool, Synthetics, Telegram Bot, Token Locker, Trading App, Treasury Manager, Uncollateralized Lending, Wallets, Yield, Yield Aggregator, Yield Lottery (plus a few niche ones). The run checks names against DefiLlama's live list.

**Peg types:** peggedUSD, peggedEUR, peggedGBP, peggedJPY, peggedCNY, peggedCHF, peggedCAD, peggedAUD, peggedSGD, peggedHKD, peggedKRW, peggedTRY, peggedRUB, peggedUAH, peggedARS, peggedREAL, peggedMXN, peggedCOP, peggedCLP, peggedPEN, peggedPHP, peggedMYR, peggedKES, peggedZAR, peggedNGN, peggedXOF, peggedGHS, peggedVAR. **Peg mechanisms:** fiat-backed, crypto-backed, algorithmic.

### Examples

**New DeFi protocols listed this month (lead list)**

```json
{ "mode": "protocols", "listedAfter": "2026-09-01", "minTvl": 500000, "excludeCategories": ["CEX", "Chain"], "sortBy": "tvl", "limit": 50 }
```

**Top DEXes on Base**

```json
{ "mode": "protocols", "chain": "Base", "category": "Dexs", "limit": 20, "fields": ["name", "tvl", "change7d", "chains"] }
```

**Sustainable stablecoin yields ≥ $5M TVL on Base, best APY first**

```json
{ "mode": "yields", "chains": ["Base"], "stablecoinOnly": true, "minTvl": 5000000, "maxApy": 30, "sortBy": "apy", "limit": 30 }
```

**Depeg watch**

```json
{ "mode": "stablecoins", "minPegDeviationPct": "0.5", "minTvl": 10000000, "sortBy": "pegDeviationPct" }
```

**Protocol revenue leaders + 90-day weekly TVL trend of a target**

```json
{ "mode": "fees", "feeMetric": "dailyRevenue", "minTotal24h": 10000, "limit": 25 }
{ "mode": "protocolHistory", "slugs": ["aave"], "days": 90, "aggregate": "weekly" }
```

**Exploits over $1M in the last year**

```json
{ "mode": "hacks", "days": 365, "minAmountUsd": 1000000, "limit": 50 }
```

### Output

Example `yields` row (trimmed):

```json
{
  "id": "ae3397ed-1f0f-4aa4-ab62-44413ea8cd9e",
  "pool": "ae3397ed-1f0f-4aa4-ab62-44413ea8cd9e",
  "project": "avantis",
  "chain": "Base",
  "symbol": "USDC",
  "poolMeta": "vault",
  "tvl": 10539693,
  "apy": 19.3211,
  "apyBase": 19.3211,
  "apyMean30d": 7.6399,
  "apyPct7d": 8.8423,
  "stablecoin": true,
  "ilRisk": "no",
  "exposure": "single",
  "sourceUrl": "https://defillama.com/yields/pool/ae3397ed-1f0f-4aa4-ab62-44413ea8cd9e",
  "fetchedAt": "2026-09-13T08:12:30.000Z"
}
```

| Mode | Columns |
|---|---|
| `protocols` | id, slug, name, symbol, category, chain, chains, chainCount, tvl (on the named chain when chains are set), tvlTotal, change1h, change1d, change7d, change1m, mcap, mcapTvl, audits, listedAt, url, twitter, geckoId, parentProtocol, sourceUrl, fetchedAt; with `includeChainTvls`: chainTvls |
| `protocol` | id, slug, name, symbol, category, chains, chainCount, tvl, tvl1dAgo, tvl7dAgo, tvl30dAgo, change1d, change7d, change1m, tvlAth, firstTvlDate, historyDays, chainTvls, staking, pool2, borrowed, mcap, mcapTvl, description, url, twitter, github, geckoId, cmcId, audits, auditLinks, isParentProtocol, childProtocols, raises, raisedTotalUsd, hacks, hallmarks, sourceUrl, fetchedAt |
| `chains` | id, name, chain, tvl, tokenSymbol, chainId, geckoId, cmcId, sourceUrl, fetchedAt; with `chainDetails`: protocolCount, tvlPrevDay, tvlPrevWeek, tvlPrevMonth, change1d, change7d, change1m (%, live TVL vs 1/7/30 days ago) |
| `yields` | id, pool, project, chain, symbol, poolMeta, tvl, apy, apyBase, apyReward, apyMean30d, apyPct1d, apyPct7d, apyPct30d, apyBase7d, volumeUsd1d, volumeUsd7d, il7d, stablecoin, ilRisk, exposure, outlier, predictedClass, predictedProbability, rewardTokens, underlyingTokens, sourceUrl, fetchedAt |
| `stablecoins` | id, name, symbol, pegType, pegCurrency, pegMechanism, price, pegDeviationPct, circulating, circulatingPrevDay, circulatingPrevWeek, circulatingPrevMonth, change1d, change7d, change30d, chainCount, chains, topChain, geckoId, sourceUrl, fetchedAt; with `includeChainBreakdown`: chainCirculating |
| `fees` / `volumes` | id, slug, name, displayName, category, protocolType, parentProtocol, chains, chainCount, metric, total24h, total48hTo24h, total7d, total14dTo7d, total30d, total1y, totalAllTime, annualized, change1d, change7d, change1m, change7dOver7d, change30dOver30d, methodologyUrl, sourceUrl, fetchedAt, chain (the named chain or null); with `includeBreakdown`: breakdown24h |
| `protocolHistory` | id, slug, name, chain, date, period, value, open, high, low, change1d, change7d, change30d, changePct, tvl, sourceUrl, fetchedAt |
| `chainHistory` | id, chain, date, period, value, open, high, low, change1d, change7d, change30d, changePct, tvl, sourceUrl, fetchedAt |
| `yieldHistory` | id, pool, date, period, value, open, high, low, change1d, change7d, change30d, changePct, tvl, apy, apyBase, apyReward, il7d, sourceUrl, fetchedAt (APY of the same day as `value`: the last day of the period) |
| `stablecoinHistory` | id, chain, pegType, date, period, value, open, high, low, change1d, change7d, change30d, changePct, circulatingUsd, sourceUrl, fetchedAt |
| `hacks` | id, date, name, amountUsd, returnedFundsUsd, chains, classification, technique, targetType, bridgeHack, language, defillamaId, source, sourceUrl, fetchedAt |

Dataset views: **Protocols** (`overview`), **Chains** (`chains`), **Yields**, **Stablecoins**, **Fees & volumes**, **History** (TVL, supply and pool APY series), **Hacks**. Pick the one matching the mode. The dataset schema describes every column with a title, a description and an example.

With `fields`, rows keep only the columns you name, in your order, always with `id` (first unless you place it elsewhere). Names are read ignoring case and `-`/`_`; a name that is not a column of the mode is left out with a "did you mean" note, a column that needs an option (`chainTvls` → `includeChainTvls`) says so, and when no name is a column the run stops before any request.

The run ends with one status message: rows saved, how many matched, whether the `limit` cut them, every name it read differently, slugs it did not find and inputs the mode does not use. The `SUMMARY` record in the key-value store holds the same plus matched counts, the resolved chains/categories and the request count.

### Use it from code / agents

```bash
curl -X POST "https://api.apify.com/v2/acts/yadroo~defillama-protocols/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"mode":"yields","chains":["Base"],"stablecoinOnly":true,"minTvl":5000000,"limit":20}'
```

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('yadroo/defillama-protocols').call({ mode: 'protocols', maxChange7d: -30, minTvl: 10000000 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

```python
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("yadroo/defillama-protocols").call(run_input={"mode": "stablecoins", "minPegDeviationPct": "0.5"})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

MCP: add `https://mcp.apify.com` to Claude, Cursor or your own agent and call `yadroo/defillama-protocols` with the same JSON input.

### Pricing

Pay per event: **$0.001 per run start + $0.001 per row**. Bronze −10 %, Silver −20 %, Gold and above −30 % on the row price; the start event is the same on every plan; platform usage is included. The default run (top 100 protocols) costs about $0.101; a 20-row yield screen about $0.021; one protocol detail $0.002. History modes return one row per day — use `aggregate: "weekly"`/`"monthly"` or a shorter window to keep cost down (90 daily points of one protocol ≈ $0.091, weekly ≈ $0.014).

**Spending limit.** The run reads your "Maximum cost per run" before it saves anything and never goes over it: it saves the rows the limit pays for and ends with "Stopped at your spending limit: N rows delivered".

### Limits & FAQ

- **Freshness** — DefiLlama updates TVL roughly hourly and yields/fees daily; every run reads live data.
- **`limit` is per run** — it counts every row of the run: with several chains, slugs or series the first ones in order can use it up, and the status message says how many more matched or were not read. Raise `limit`, shorten the window or use `aggregate`.
- **Big payloads** — `protocols` (~8k items) and `yields` (~17k pools) are downloaded whole and filtered in memory; a run takes a few seconds.
- **Chain details** — `protocolCount` counts non-CEX protocols that list the chain (as on defillama.com/chains). The protocol list still uses legacy chain names (`Binance`, `xDai`, `Optimism`…); the actor maps the known ones, and a chain it cannot map gets `protocolCount: null` rather than a wrong number. `chainDetails` costs one request per returned chain at about 6 requests per second, so an all-chains run (`minTvl: 0`, `limit: 500`) takes about two minutes; rows are saved every 20 chains. Turn it off for TVL only.
- **Run timeout** — the default timeout is 15 minutes. Before it, the run stops starting new requests, keeps the rows it saved and ends SUCCEEDED with "Stopped before the run timeout: N rows saved".
- **Parent protocols** — slugs like `aerodrome` or `uniswap` are parents: in `protocol` mode `category` is empty and `chains` is derived from current TVL; in `protocols`/`fees`/`volumes` a parent slug selects its versions (`uniswap` → `uniswap-v2`, `uniswap-v3`…); a slug that is a protocol itself means that protocol only.
- **Chains in `protocolHistory`** — one series per named chain the protocol has TVL on; a chain without TVL for that protocol gives no rows and a note (it never falls back to the all-chain total).
- **Paid endpoints** — plain perp DEX volume and some dimensions are Pro-only on DefiLlama; those return a clear error instead of empty data.
- **Errors** — HTTP 429/5xx are retried with backoff within the run's time; a protocol, pool or chain series that fails is named in the status message while the others are still saved; when nothing could be read the run fails with the reason.
- **Not financial advice.** Data is DefiLlama's; APYs are variable and can be manipulated.
- **Roadmap** — bridge volumes, token unlocks (if they remain free), per-protocol fees history.

***

Made by **Yadroo** — more crypto data actors: [coingecko-markets](https://apify.com/yadroo/coingecko-markets) · [crypto-sentiment](https://apify.com/yadroo/crypto-sentiment) · [crypto-news](https://apify.com/yadroo/crypto-news) · [dexscreener-tokens](https://apify.com/yadroo/dexscreener-tokens) · [wallet-intel](https://apify.com/yadroo/wallet-intel) · [x402-endpoints](https://apify.com/yadroo/x402-endpoints)

# Actor input Schema

## `mode` (type: `string`):

Which dataset to fetch. Each mode has its own row shape (see README → Output).

## `limit` (type: `integer`):

Maximum rows this run saves, across all chains, slugs and series of the mode (after filtering and sorting). Billing is per row. The status message says when the limit cut matching rows.

## `fields` (type: `array`):

Keep only these columns, in this order, e.g. \["slug","tvl","change7d"]; `id` is always kept (first unless you place it). Letter case and -/\_ are forgiven; a name that is not a column of the mode is left out with a "did you mean" note, and the run stops before any request when no name is a column. Empty = all columns (README → Output).

## `chain` (type: `string`):

Single chain filter, e.g. Ethereum, Base, Solana, Arbitrum, BSC. Legacy field — same as putting one item in `chains`.

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

Several chains at once. protocols: one row per (protocol, chain) with that chain's TVL; fees/volumes: one row per (protocol, chain) with that chain's totals; chains: only these chains (minTvl is not applied to them unless you set it); yields/stablecoins/hacks: items on any of them; history modes: one series per chain. See README → Reference for chain names.

## `category` (type: `string`):

protocols, fees, volumes: DefiLlama category, e.g. Dexs, Lending, Liquid Staking, Derivatives, Yield, Bridge, RWA, CDP (full list in README; aliases like dex, perps, lst, lrt, rwas work). yields: a project slug like aave-v3, uniswap-v3, lido. Legacy field — same as one item in `categories` / `projects`. Unknown names stop the run with a "did you mean" list.

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

Several DefiLlama categories (protocols / fees / volumes modes). Unknown names stop the run with a "did you mean" list.

## `excludeCategories` (type: `array`):

Drop these categories from protocols mode. DefiLlama lists CEX reserves and L1 chains as "protocols"; exclude them to get pure DeFi rankings. Unknown names stop the run with a "did you mean" list.

## `slugs` (type: `array`):

Protocol slugs (from defillama.com/protocol/<slug>), e.g. aave, uniswap, lido, aerodrome-v2. Required for protocol and protocolHistory; optional whitelist in protocols / fees / volumes, where a parent slug (aave, uniswap) matches its versions. minTvl is not applied to named slugs unless you set it. Slugs DefiLlama does not know are named in the status message, never billed.

## `search` (type: `string`):

Case-insensitive substring match on name / symbol (protocols, chains, yields, stablecoins, fees, volumes, hacks).

## `minTvl` (type: `integer`):

Minimum TVL (USD) for protocols/chains/yields, minimum circulating supply for stablecoins. Empty = $1,000,000 for rankings (keeps dust out), but 0 for slugs or chains you name and when maxTvl is below $1M. Set 0 to see everything. Not used by fees/volumes (see minTotal24h).

## `maxTvl` (type: `integer`):

protocols: drop protocols above this TVL — handy for finding small/emerging projects.

## `minChange7d` (type: `number`):

protocols: keep only protocols whose TVL grew at least this % over 7 days (e.g. 20 = fastest growers; decimals allowed). Negative values find decliners with maxChange7d.

## `maxChange7d` (type: `number`):

protocols: keep only protocols whose 7d change is at most this % (e.g. -30 = TVL outflow alerts).

## `minChange1d` (type: `number`):

protocols: lower bound on 24h TVL change in %.

## `maxChange1d` (type: `number`):

protocols: upper bound on 24h TVL change in %.

## `listedAfter` (type: `string`):

protocols: only protocols listed on DefiLlama on/after this date (YYYY-MM-DD). Great for "new protocols this month" lead lists.

## `listedBefore` (type: `string`):

protocols: only protocols listed on/before this date.

## `auditedOnly` (type: `boolean`):

protocols: keep only protocols with at least one audit recorded on DefiLlama.

## `includeChainTvls` (type: `boolean`):

protocols: add `chainTvls` object {chain: tvlUsd} to each row.

## `chainDetails` (type: `boolean`):

chains: add `change1d`, `change7d`, `change1m` (TVL change %, vs the live TVL), `tvlPrevDay`/`tvlPrevWeek`/`tvlPrevMonth` and `protocolCount` to each returned chain. Costs one small request per returned chain plus the protocol list (≈5–30 s for 30–100 chains). Off = TVL only, instant.

## `projects` (type: `array`):

Yield project slugs, e.g. aave-v3, compound-v3, lido, pendle, morpho-v1, uniswap-v3, aerodrome-slipstream. ~500 projects; see defillama.com/yields. An unknown slug stops the run with a "did you mean" list (it used to be dropped, which returned every project).

## `symbols` (type: `array`):

Match pools whose symbol contains one of these tokens, e.g. \["USDC","USDT"] matches USDC, USDC-WETH, USDT-USDC.

## `minApy` (type: `number`):

Lower bound on total APY, in percent (decimals allowed, e.g. 4.5).

## `maxApy` (type: `number`):

Upper bound on total APY, in percent — cut off unsustainable farm APYs (e.g. 50).

## `minApyMean30d` (type: `number`):

Lower bound on the 30-day average APY, in percent — filters flash-in-the-pan yields.

## `stablecoinOnly` (type: `boolean`):

Only pools DefiLlama flags as stablecoin pools.

## `singleExposureOnly` (type: `boolean`):

Only single-token pools (no LP pairs).

## `noIlOnly` (type: `boolean`):

Only pools with ilRisk = no.

## `excludeOutliers` (type: `boolean`):

Drop pools DefiLlama marks as statistical outliers (usually broken or manipulated APYs).

## `poolIds` (type: `array`):

Pool UUIDs from yields mode (field `pool`), e.g. 747c1d2a-c668-4682-b9f9-296708a3dd90 (Lido stETH).

## `pegTypes` (type: `array`):

e.g. \["peggedUSD"], \["peggedEUR"] — or just the currency: \["USD"], \["EUR"]. All values: peggedUSD, peggedEUR, peggedGBP, peggedJPY, peggedCNY, peggedCHF, peggedCAD, peggedAUD, peggedSGD, peggedHKD, peggedKRW, peggedTRY, peggedRUB, peggedUAH, peggedARS, peggedREAL, peggedMXN, peggedCOP, peggedCLP, peggedPEN, peggedPHP, peggedMYR, peggedKES, peggedZAR, peggedNGN, peggedXOF, peggedGHS, peggedVAR. stablecoinHistory uses the first one (default peggedUSD). Unknown values stop the run.

## `pegMechanisms` (type: `array`):

Any of fiat-backed, crypto-backed, algorithmic (fiat / crypto / algo work too). Unknown values stop the run.

## `minPegDeviationPct` (type: `string`):

Depeg alert: keep USD stablecoins whose price is at least this % away from $1.00 (e.g. 0.5). Text field: decimals with a dot or a comma; anything that is not a number stops the run.

## `maxPegDeviationPct` (type: `string`):

Keep only stablecoins within this % of peg (e.g. 0.2 = healthy pegs only). Text field like minPegDeviationPct.

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

stablecoins: add `chainCirculating` {chain: amount}.

## `feeMetric` (type: `string`):

fees mode: which metric to rank protocols by.

## `volumeType` (type: `string`):

volumes mode: which dimension to fetch. (Plain perp DEX volume is paid-only on DefiLlama and not available.)

## `includeBreakdown` (type: `boolean`):

fees/volumes: add `breakdown24h` {chain: usd}.

## `minTotal24h` (type: `integer`):

fees/volumes: keep protocols whose last-24h fees (or volume) is at least this many USD, e.g. 10000. Empty = no threshold (minTvl is not used in these modes).

## `from` (type: `string`):

Start date YYYY-MM-DD (inclusive).

## `to` (type: `string`):

End date YYYY-MM-DD (inclusive).

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

Alternative to from/to: last N days (history modes default to 90; hacks default to all time).

## `aggregate` (type: `string`):

History modes: bucket the daily series to cut row count (and cost).

## `minAmountUsd` (type: `integer`):

hacks: only exploits with losses at or above this amount.

## `sortBy` (type: `string`):

protocols: tvl, change1d, change7d, change1m, mcap, mcapTvl, listedAt, name. yields: tvl, apy, apyBase, apyReward, apyMean30d, apyPct7d, volumeUsd1d. stablecoins: circulating, change1d, change7d, change30d, pegDeviationPct, chainCount, name. fees/volumes: total24h, total7d, total30d, total1y, change1d, change7d, change1m, name. chains: tvl, chain. hacks: date, amountUsd, name. Empty = the first one of the mode. Letter case is forgiven; a key the mode cannot sort by stops the run with the list.

## `sortDir` (type: `string`):

Sort direction for sortBy.

## Actor input object example

```json
{
  "mode": "protocols",
  "limit": 100,
  "fields": [],
  "chains": [],
  "categories": [],
  "excludeCategories": [
    "CEX",
    "Chain"
  ],
  "slugs": [],
  "auditedOnly": false,
  "includeChainTvls": false,
  "chainDetails": true,
  "projects": [],
  "symbols": [],
  "stablecoinOnly": false,
  "singleExposureOnly": false,
  "noIlOnly": false,
  "excludeOutliers": true,
  "poolIds": [],
  "pegTypes": [],
  "pegMechanisms": [],
  "includeChainBreakdown": false,
  "feeMetric": "dailyFees",
  "volumeType": "dexs",
  "includeBreakdown": false,
  "aggregate": "daily",
  "sortDir": "desc"
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "fields": [],
    "chains": [],
    "categories": [],
    "excludeCategories": [
        "CEX",
        "Chain"
    ],
    "slugs": [],
    "projects": [],
    "symbols": [],
    "poolIds": [],
    "pegTypes": [],
    "pegMechanisms": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("yadroo/defillama-protocols").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 = {
    "fields": [],
    "chains": [],
    "categories": [],
    "excludeCategories": [
        "CEX",
        "Chain",
    ],
    "slugs": [],
    "projects": [],
    "symbols": [],
    "poolIds": [],
    "pegTypes": [],
    "pegMechanisms": [],
}

# Run the Actor and wait for it to finish
run = client.actor("yadroo/defillama-protocols").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 '{
  "fields": [],
  "chains": [],
  "categories": [],
  "excludeCategories": [
    "CEX",
    "Chain"
  ],
  "slugs": [],
  "projects": [],
  "symbols": [],
  "poolIds": [],
  "pegTypes": [],
  "pegMechanisms": []
}' |
apify call yadroo/defillama-protocols --silent --output-dataset

```

## MCP server setup

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

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/nc5KV4FYT1bOHig6H/builds/2OsUNPxaF5xPFUAbf/openapi.json
