/oracle Endpoints
Base URL: /oracle
Available Endpoints
/cash/closest?<timestamp>
Endpoint: GET /cash/closest
Status: Unstable
Description: Get the closest BCH/USD price for a given timestamp. Returns 404 if no oracle price is available within 2 hours of the timestamp.
Example URI: /cash/closest
/cash/history?<start>&<end>&<stepsize>
Endpoint: GET /cash/history
Status: Unstable
Description: Get historical BCH/USD prices for a time range. Backed by Delphi v2 (and v1 for historical timestamps).
Example URI: /cash/history
/delphi/<token>/history?<start>&<end>&<stepsize>
Endpoint: GET /delphi/<token>/history
Status: Unstable
Description: Get historical oracle prices for a given token.
- token: The 32 byte token ID of the oracle contract. Known IDs:
- BCH/USD v2 (current, live):
be0d0d8324e8cda41d34b85bd203ce2482256eb337a0ad0fea82c2ddd7306c88 - BCH/USD v1 (legacy, no longer updated):
d0d46f5cbd82188acede0d3e49c75700c19cb8331a30101f0bb6a260066ac972 - start: Unix timestamp for start of period
- end: Unix timestamp for end of period (optional, defaults to now)
- stepsize: Seconds per interval (optional)
Reserve UTXOs and price=0 updates (the operator's "feed disabled"
signal) are filtered at index time, so every entry returned here is a
live price.
Important: oracle_price values are in cents. Divide by 100 to convert to USD.
Response Example:
[
{ "time": 1777886180, "price": 43900, "txid": "...", "blockhash": "...", "sequence": 1646803 },
{ "time": 1777889180, "price": 43972, "txid": "...", "blockhash": "...", "sequence": 1646804 }
]
price values of 43972 cents = $439.72 USD.
Example URI: /delphi/be0d0d8324e8cda41d34b85bd203ce2482256eb337a0ad0fea82c2ddd7306c88/history
/delphi/closest?<token_id>&<timestamp>
Endpoint: GET /delphi/closest
Status: Stable
Description: Get the closest oracle price for a given token and timestamp.
- token_id: The 32 byte token ID of the oracle contract. Known IDs:
- BCH/USD v2 (current, live):
be0d0d8324e8cda41d34b85bd203ce2482256eb337a0ad0fea82c2ddd7306c88 - BCH/USD v1 (legacy, no longer updated):
d0d46f5cbd82188acede0d3e49c75700c19cb8331a30101f0bb6a260066ac972 - timestamp: Unix timestamp (optional, defaults to now)
When token_id is omitted, the closest entry across all indexed
Delphi contracts is returned. After the v2 deploy this naturally resolves
to the most recent live oracle (v2), since v1 stopped advancing; callers
who want a specific contract should pass token_id=… explicitly.
Reserve UTXOs and price=0 updates (the operator's "feed disabled"
signal) are filtered at index time, so any non-null entry returned here
is a live price.
Returns null if no oracle data is found.
Important: oracle_price is returned in cents (not dollars). Divide by 100
to get the price in USD:
price_usd = oracle_price / 100
Response Example:
{
"oracle_timestamp": 1777889180,
"oracle_price": 43972,
"oracle_sequence": 1646804,
"token_id": "be0d0d8324e8cda41d34b85bd203ce2482256eb337a0ad0fea82c2ddd7306c88",
"txid": "...",
"blockhash": "..."
}
oracle_price of 43972 cents = $439.72 USD.
Example URI: /delphi/closest