mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 16:28:06 +00:00
3.0 KiB
3.0 KiB
Oracle Snapshots
Rate limits
- IP weight =
max((snapshot_count * product_ids.length / 100), 2)wheresnapshot_count = interval.count.min(500). If noproduct_idsare specified,product_ids.length = 100.- E.g: With
product_ids=[1, 2, 3, 4]andinterval.count=60, weight = max((60 * 4 / 100), 2) = 2, allowing up to 1200 requests per min or 200 requests/10 secs.
- E.g: With
{% hint style="info" %} See more details in API Rate limits {% endhint %}
Request
{% tabs %}
{% tab title="Oracle Price" %}
Query oracle snapshots ordered by timestamp desc.
POST [ARCHIVE_ENDPOINT]
Body
{
"oracle_snapshots": {
"interval": {
"count": 2,
"granularity": 3600,
"max_time": 1691083697,
},
"product_ids": [1, 2]
}
}
{% endtab %} {% endtabs %}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| interval | object | Yes | Object to specify desired time period for data |
| interval.count | number | Yes | Number of snapshots to return, limit 100. Also limited to interval.count * # product_ids < 2000 |
| interval.granularity | number | Yes | Granularity value in seconds |
| interval.max_time | number / string | No | When providing max_time (unix epoch in seconds), only return snapshots with timestamp <= max_time. If no value is entered, max_time defaults to the current time. |
| product_ids | number[] | No | list of product ids to fetch snapshots for, defaults to all products |
Response
{% hint style="info" %}
Note: Returns a map of product_id -> oracle_price
{% endhint %}
{
"snapshots": [
{
"timestamp": 1750947789,
"oracle_prices": {
"1": "107070085854928675234384",
"2": "107142264360834928244199"
}
},
{
"timestamp": 1750946389,
"oracle_prices": {
"1": "106963557680819440289916",
"2": "106954360458642468300594"
}
}
]
}