DeFi protocols API

A protocol's value locked, fees, revenue, volume, treasury or options over time

One DeFi protocol's daily series for one metric (value locked, fees, revenue, trading volume, treasury, options premium or notional) over a trailing window.

GET/api/external/protocol-analysis/protocol-history/{slug}

What it returns

One protocol's daily history for the metric chosen with metric, over the trailing window in days, oldest first. tvl and treasury are the value at 00:00 UTC of each day plus one more point, the latest reading of today, so today has two points and a window of N days holds up to N+1. fees, revenue, volume, options-premium and options-notional are one total per UTC day, dated 00:00 UTC. revenue can be negative. The window counts back from the newest point's own day, not from today: a protocol that stopped reporting answers its last days, so read the newest timestamp to see how current the series is. The slug is the one GET /protocol-analysis/protocols lists. A protocol that is unknown, or that has no series for that metric (a lending protocol has no trading volume, and only options venues have options volume), answers 404.

Chains

This endpoint is not tied to a chain: it takes no chain in its request.

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/protocol-analysis/protocol-history/<slug>"
Parameters
ParameterDescription
metric

query · string · optional

Which series. tvl: the value locked in the protocol. fees: what its users paid. revenue: the part of the fees the protocol kept. volume: what was traded on it, for exchanges. treasury: what the protocol itself holds. options-premium: what buyers paid for the options traded on it. options-notional: the size of the underlying those options were written on. Defaults to tvl.tvlfeesrevenuevolumetreasuryoptions-premiumoptions-notional
days

query · string · optional

How many trailing days to return, or all for the whole series. Defaults to 90. days ≤ 365 keeps the answer under 32 KB.73090180365all
slug

path · string · required

A DeFi protocol's slug, e.g. "pancakeswap-amm" — not a token mint or contract address, and not scoped to any single chain.

Response fields

A JSON response. Every field is always present; null means the value could not be established, never zero.

Response fields of A protocol's value locked, fees, revenue, volume, treasury or options over time
FieldTypeDescription
slugstringThe protocol asked about.
metricstringThe series returned.
daysstringThe window returned.
pointsobject[]Oldest first. Empty only when the protocol has no point at all.
points[].timestampintegerUnix seconds: 00:00 UTC of the day, except the extra newest tvl and treasury point.
points[].usdnumberIn USD: the value at that time for tvl and treasury, the day total otherwise.

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