Skip to main content

Get Exchange Rates

Returns the USD rate of each currency token you name, so analytics volumes reported in different currencies can be put on one axis: multiply a volume by its token's rate. The rate belongs to the token's fiat currency and comes from the stored spot prices the platform refreshes periodically; this call never waits on an external price service. A token with no fiat currency, an id that matches no currency token, or a currency with no stored price is reported as "1" rather than omitted, so its figures stay visible in their own units. The endpoint is not scoped to a node.

Rates are decimal strings.

Required permission: node:summary:view

Request​

GET /v2/admin/analytics/exchange-rates?currency_token_id={currency_token_id}&currency_token_id={currency_token_id}

Parameters​

NameTypeInDescription
currency_token_idstringqueryRequired. A currency token id (24-character hex). Repeat the parameter once per token.

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>

Example​

curl --request GET \
--url '{{baseUrl}}/v2/admin/analytics/exchange-rates?currency_token_id=68fe8c129367fd414b227c7a&currency_token_id=6901a7c2e4b5d6f708a9b0c1' \
--header 'Authorization: Bearer <access_token>'

Response​

{
"rates": {
"68fe8c129367fd414b227c7a": "0.0291",
"6901a7c2e4b5d6f708a9b0c1": "1"
},
"quote": "USD"
}

Response Fields​

FieldTypeDescription
ratesobjectOne entry per requested currency token id: the value of one unit of the token's fiat currency in quote. "1" when the rate cannot be resolved.
quotestringThe currency the rates are expressed in. Always USD.

Errors​

StatusCodeDescription
40010015Validation failed: no currency_token_id was sent, or one is not a 24-character hex id

See Errors for the error format and common codes.