Перейти к содержанию

Rate Data Collection Frequency

The data collection frequency can be configured in the cron configuration. The data is stored at different frequencies depending on its proximity to the current moment. Below is a description of the periods and the recommended data collection frequency.

  • Hour (last hour): Information is saved every minute and stored with a limit of 60 entries. Older entries are removed from the cache.
  • Day (last day): Information is saved twice an hour and stored with a limit of 60 entries. Older entries are removed from the cache.
  • Week (last week): Information is saved every three hours and stored with a limit of 60 entries. Older entries are removed from the cache.
  • Month (last month): Information is saved every 12 hours and stored with a limit of 60 entries. Older entries are removed from the cache.
  • Eternity: Information is collected once a day since the launch of the rate service. Data is not removed from the cache.

JSON cache

Historical

Swagger Rates History

Request Structure

/rate-history-{period}-{chain}.json

/rate-history-{period}-{chain}-{contract}.json

Response Structure

[
  {
    "date": number,
    "rates": {
      "{fiat}": number,
      "{fiat}": number,
    }
  }
]

Request Example

https://cloud.spatium.net/rate-info/v1/static/rate-history-day-btc.json

Response Example

[
  {
    "date": 1690434242,
    "rates": {
      "clp": "24309115.00000000",
      "cad": "38824.00000000",
      .....
  }
]

Latest

Swagger Rates Latest

Latest Coins Rates

Request Structure

/rates-coin.json

Response Structure

{
  "{chain}": {
     "{fiat}": number,
     "{fiat}": number,
  },
  "{chain}": {
     "{fiat}": number,
     "{fiat}": number,
  }
}

Request Example

https://cloud.spatium.net/rate-info/v1/static/rates-coin.json

Response Example

{
  "ftm": {
    "chf": "0.21298600",
    "ils": "0.90821600",
    "bmd": "0.24548500",
    ....
}

Latest ERC20 Token Rates

Request Structure

/rates-erc20.json

Response Structure

{
  "{chain}-{contract}": {
     "{fiat}": number,
     "{fiat}": number,
  },
  "{chain}-{contract}": {
     "{fiat}": number,
     "{fiat}": number,
  }
}

Request Example

https://cloud.spatium.net/rate-info/v1/static/rates-erc20.json

Response Example

{
"bsc-0x9c65ab58d8d978db963e63f2bfb7121627e3a739": {
    "clp": "51.38000000",
    "cad": "0.08179000",
    ....
}