Discovery and markets API
How much does a DeFi category earn, and which protocols lead it?
A DeFi category's fees, revenue or DEX volume in USD over 24 hours, 7 days or 30 days, overall or on one chain, with its protocols ranked.
/api/external/discovery/defi-category-metricsWhat it returns
A DeFi category's total for the metric chosen with metric, over the trailing window in window, and its protocols ranked largest first, across every chain or on the one in chain. fees is what users paid the protocols, revenue the part of those fees they kept, volume DEX trading volume (for category=dexs only). totalUsd is the sum over the protocols that carry a figure. A protocol with no figure for the window is left out rather than ranked as zero. On a chain with no protocol of the category, protocols is empty and totalUsd is null.
Chains
- Solana SOL
- Ethereum ETH
- BNB Chain BNB
- Base BASE
- Stable STABLE
- Robinhood Chain RHC
- Arc ARC
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/discovery/defi-category-metrics?category=dexs"
| Parameter | Description |
|---|---|
categoryquery · string · required | The kind of protocol: dexs (exchanges), lending, liquid-staking, derivatives (perpetuals and other derivatives venues), launchpad (token launch platforms), dex-aggregator.dexslendingliquid-stakingderivativeslaunchpaddex-aggregator |
chainquery · string · optional | Only the protocols on this chain, with their figures there. Omit for every chain. |
metricquery · string · optional | fees: what users paid. revenue: the part of the fees the protocol kept. volume: DEX trading volume, only with category=dexs. Defaults to fees.volumefeesrevenue |
windowquery · string · optional | The trailing window the figures cover: the last 24 hours, 7 days or 30 days. Defaults to 24h.24h7d30d |
limitquery · integer · optional | How many protocols to return, 1 to 100. Defaults to 25. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
category | string | The category asked about. |
chain | string | null | The chain asked about, or null for every chain. |
metric | string | What the figures measure. |
window | string | The window the figures cover. |
totalUsd | number | null | The category's total for the metric and window, in USD. null when no protocol carries a figure. |
protocolsRanked | integer | How many protocols carry a figure for the window, before limit is applied. |
protocols | object[] | Largest first; ties ordered by slug. |
protocols[].rank | integer | 1 for the largest figure. |
protocols[].slug | string | The protocol's id, lowercase and hyphenated. |
protocols[].name | string | The protocol's display name. |
protocols[].usd | number | The protocol's figure over the window, in USD. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key