tellor-io / dataSpecs

Data specifications for oracle queries
17 stars 9 forks source link

New custom data for Cue #79

Closed sunosuporno closed 2 years ago

sunosuporno commented 2 years ago

Cue is a hackathon project for Ethglobal '22. We are trying to build the notification OS for web3.

themandalore commented 2 years ago

Hey @sunosuporno ! Thanks for the PR. I'll work with the guys on getting it up, but just so you know, it looks like a centralized API right? If there's no alternative way to get the data, this means that if this API goes down, then you'll be out of luck in terms of correct data

sunosuporno commented 2 years ago

Hey @themandalore, the data comes from Tableland, so hopefully it's open-source/decentralised. Basically, I use this: API of Tableland and see if I get back an array. If there's an array, I send 1, otherwise 0. The backend is basically there to do that 1 or 0 sending in Json. If you can help set it up more correctly, I would be happy! Though there's not much time. Would appreciate you reaching out at Suporno#3903 on Discord. In the meantime, while this is being set up I will just use NumericApiResponse query type and get the number from my API and work with that. I guess that works, no?

oraclown commented 2 years ago

@sunosuporno Here's an example of that data reported to a tellor oracle on polygon testnet: https://mumbai.polygonscan.com/tx/0x8bdc4ddd6400cac9f85ac0c81f62d3843339025183b5567bcf6da3db7d1c5f76

I used the NumericApiResponse type with the url being the example you provided above and a parseStr of "message".

You would read the value from the oracle using getCurrentValue and the query ID (unique identifier of your data) 0x d0066ccb8364e71fba623e3bc051c4cb1a397d81680f719fbfed5ccbb6e810f5. Keep in mind that it'll return 1 * 10**18 once you decode the response, because it has 18 decimals of precision.

You can decode the query data and submitted value bytes using this tool as well if you need: https://querydataapi.herokuapp.com/docs

tkernell commented 2 years ago

It seems this doesn't need a custom query type at this point. While it just uses a single API source, the NumericApiResponse should work. If more sources become available, then a new query type can be created. I will be closing this in the next few days unless anyone objects.

oraclown commented 2 years ago

It seems this doesn't need a custom query type at this point. While it just uses a single API source, the NumericApiResponse should work. If more sources become available, then a new query type can be created. I will be closing this in the next few days unless anyone objects.

2nd. If a more robust solution is needed with multiple, specific sources, then check out creating a new query type. Closing