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}¤cy_token_id={currency_token_id}
Parameters
| Name | Type | In | Description |
|---|---|---|---|
currency_token_id | string | query | Required. A currency token id (24-character hex). Repeat the parameter once per token. |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Example
curl --request GET \
--url '{{baseUrl}}/v2/admin/analytics/exchange-rates?currency_token_id=68fe8c129367fd414b227c7a¤cy_token_id=6901a7c2e4b5d6f708a9b0c1' \
--header 'Authorization: Bearer <access_token>'
Response
{
"rates": {
"68fe8c129367fd414b227c7a": "0.0291",
"6901a7c2e4b5d6f708a9b0c1": "1"
},
"quote": "USD"
}
Response Fields
| Field | Type | Description |
|---|---|---|
rates | object | One 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. |
quote | string | The currency the rates are expressed in. Always USD. |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | Validation 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.