Oracle

Last updated last month

We are developing a standard for data providers to supply information on what happened in the world so smart contracts can act on that information.

Learn more about our approach towards oracles in the blog post written by Adam.

Our oracle solution is still a work in progress. If you would like to follow development you can follow the progress on the following repositories:

https://gitlab.com/urban_sharon/zen-oracle

https://gitlab.com/zenprotocol/zen-oracle

API Methods

We have currently setup one example oracle running which you can use in your smart contacts:

get
Ticker Price at Date

http://oracle.zp.io
/data?ticker=GOOG&date=2018-10-15
Request
Response
Path Parameters
date
optional
string
The date of prices you want to fetch (YYYY-MM-DD)
ticker
optional
string
The ticker you want to get prices for
200: OK
{
"ticker": "GOOG",
"value": 1138.82
}

get
Ticker Price History

http://oracle.zp.io
/data?ticker=GOOG
Request
Response
Path Parameters
ticker
optional
string
(GOOG, TSLA)
200: OK

get
All Ticker Prices at Date

http://oracle.zp.io
/data?date=2018-10-15
Get the price of all the tickers at a specific date
Request
Response
Path Parameters
date
optional
string
YYYY-MM-DD
200: OK

get
Proof

http://oracle.zp.io
/proof?date=2018-10-10&ticker=GOOG
Get the necessary proof required to provide the smart contract in order for it to settle a position. You can then use the data provided in the response and provide in the "body" field when executing a smart contract.
Request
Response
Path Parameters
ticker
optional
string
(GOOG, TSLA)
date
optional
string
YYYY-MM-DD
200: OK
Hash : 37cb934aca873d085ab9792e31f8b4ebb8ab84fa642021079adf9493d3c3578b
Index : 1
AuditPath :
- ecaf3dc2005f7a0fc1c9001b9f853c4b515286ccbafb580ef1829f4b04d2e2a2
- 9e7fae7a520fe2d3b2e33886aac1b73e753fe30bb4ba53d1de23a32600ce2179
- 532482a78ca2d7d139be2a1eda5e84bfaae7b6b67215084657b0c1c9d2d8736f
- 064f99f3fe85f3385c4facc36bcf1b9c482d42e73cc4ddd9e81d4627a57f9287
- 83c0667c4212d8ad574736f488cab27b8d435eb91f665f3c53ceb08ae3fe272f