Stablecoins API

How has this stablecoin's price tracked its peg over time?

One stablecoin's daily USD price and, for a dollar peg, its deviation from $1, over 7 to 365 days or since December 2020.

GET/api/external/stablecoin-analysis/stablecoin-peg-history/{id}

What it returns

One stablecoin's USD price, one point per day at 00:00 UTC, over the last 7, 30, 90, 180 or 365 days, or since December 2020 with days=all, addressed by its id from GET /stablecoin-analysis/stablecoins. For a USD peg pegUsd is 1 and each point carries deviationPct, its distance from the peg in percent; for any other peg (EUR, GBP, a floating target…) pegUsd and deviationPct are null, since the peg itself moves against the dollar. priceUsd is null on a day without a price. Windows count back from the newest point, the current or previous UTC day. An id that is not in the directory, or a stablecoin that has never been priced, returns 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/stablecoin-analysis/stablecoin-peg-history/<id>"
Parameters
ParameterDescription
days

query · string · optional

Trailing window in days, or all for the whole history. Defaults to 90. days ≤ 180 keeps the answer under 32 KB.73090180365all
id

path · string · required

A stablecoin's numeric id in this resource's own directory, e.g. "1" — 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 How has this stablecoin's price tracked its peg over time?
FieldTypeDescription
idstringThe id asked for.
namestring | null
symbolstring | null
pegTypestring | nullWhat it is pegged to, e.g. peggedUSD, peggedEUR.
pegUsdnumber | null1 for a USD peg; null for any other peg.
daysstringThe window answered.
pointsobject[]Oldest first, one per day.
points[].timestampintegerUnix seconds, 00:00 UTC of the day.
points[].priceUsdnumber | nullThe price in USD; null on a day without one.
points[].deviationPctnumber | nullDistance from a USD peg in percent (negative below it); null for any other peg or without a price.

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