Oracle Prices

Current Oracle Price

The current Oracle Price in $USD and at which block it took effect. The last 7 digits are decimals, cent denominations.

Response

{
  "data": {
    "price": 167000000,
    "block": 471570
  }
}

Current and Historical Oracle Prices

The current and historical Oracle Prices and at which block they took effect. This route is paged using a cursor.

Query Parameters

Name

Tags

Description

Example

Type

optional

Returned from an initial query, allowing client to fetch more results.

eyJiZWZvcmUiOjQ2NjE5MH0

text

Response

{
  "data": [
    {
      "price": 167000000,
      "block": 471570
    },
    {
      "price": 169630000,
      "block": 471540
    }
  ],
  "cursor": "eyJiZWZvcmUiOjQ2NjE5MH0"
}

Oracle Price Stats

Gets statistics on Oracle prices.

Query Parameters

Name

Tags

Description

Example

Type

required

First time to include in stats.

2020-08-27T00:00:00Z

ISO8601 timestamp or relative time

required

Last time to include in stats.

-1 week

ISO8601 timestamp or relative time

Response

{
  "data": {
    "avg": 12.433719079615384,
    "max": 20.0,
    "median": 12.53731614,
    "min": 6.0,
    "stddev": 3.50807814
  },
  "meta": {
    "max_time": "2021-04-20T15:52:28Z",
    "min_time": "2021-03-21T15:52:28Z"
  }
}

Oracle Price at a Specific Block

Provides the oracle price at a specific block and at which block it initially took effect.

Path Parameters

Name

Tags

Description

Example

Type

required

The block to get the HNT Oracle Price at.

471570

number

Response

{
  "data": {
    "price": 167000000,
    "block": 471570
  }
}

List Activity for a Specific Oracle

Lists price report transactions for the given oracle key. This route is paged using a cursor.

Path Parameters

Name

Tags

Description

Example

Type

required

The public key of the oracle.

145J6Aye86pKTJrUHREiXu7qqppZBcWY1bvWo8id7ZjxyuainYj

text

Query Parameters

Name

Tags

Description

Example

Type

optional

Cursor for the next page to fetch.

eyJ0eXBlcyI6InByaWNlX29yYWNsZV92MSIsIm1pbl9ibG9jayI6MzY2MjgzLCJibG9jayI6ODY2MjAwLCJhbmNob3JfYmxvY2siOjg2NjIwMH0

text

Response

{
  "data": [
    {
      "type": "price_oracle_v1",
      "time": 1622481773,
      "public_key": "145J6Aye86pKTJrUHREiXu7qqppZBcWY1bvWo8id7ZjxyuainYj",
      "price": 1586445000,
      "height": 866243,
      "hash": "d-2h0NpDcmF2zZrFkepS6KMDgQfgXxnmtN70vRboLkE",
      "fee": 0,
      "block_height": 866240
    },
    {
      "type": "price_oracle_v1",
      "time": 1622478285,
      "public_key": "145J6Aye86pKTJrUHREiXu7qqppZBcWY1bvWo8id7ZjxyuainYj",
      "price": 1621738000,
      "height": 866200,
      "hash": "d_VJbYy6bwRt2LbsN6XpghDljY-AC9pZCPbWQMjWWtg",
      "fee": 0,
      "block_height": 866198
    }
  ],
  "cursor": "eyJ0eXBlcyI6InByaWNlX29yYWNsZV92MSIsIm1pbl9ibG9jayI6MzY2MjgzLCJibG9jayI6ODY2MjAwLCJhbmNob3JfYmxvY2siOjg2NjIwMH0"
}

Get Predicted HNT Oracle Prices

This returns a list of expected times when the Oracle Price is expected to change.The blockchain operates in "block-time", meaning that blocks can come out at some schedule close to 1 per minute. Oracles report in "wall-clock-time", meaning they report what they believe the price should be.If the route returns one or more prices and times, it indicates that the chain is expected to adjust the price (based on Oracle reports) no earlier than the indicated time to the returned price.NOTE: A prediction may not be seen in the blockchain if they are close together (within 10 blocks) since block times may cause the blockchain to skip to a next predicted price. If no predictions are returned the current HNT Oracle Price is valid for at least 1 hour.

Response

{
  "data": [
    {
      "price": 47000000,
      "time": 1594410146
    }
  ]
}

Last updated

Was this helpful?