tellor-io / dataSpecs

Data specifications for oracle queries
16 stars 9 forks source link

[New Data Request]: Add New SpotPrice - IRR/USD #111

Closed nonogakhi closed 1 year ago

nonogakhi commented 1 year ago

Contact Details

albertiandre@tutanota.com

Just need a new Spot Price?

IRR/USD every 1 hour or every %1 change

Query Type Name

SpotPrice

Description

This data price will be used to maintain IRR currency's peg to prompts on chain for use by other smart contracts. It will accept a string uint8, its prompt, and return a uint8 its answer.

Your query parameters

prompt

description: the prompt the reporter will put in IRR/USD price
value type: `uint8 memory`

Your response type

response type: uint8 memory

Dispute Considerations

No response

Suggested Data Sources

Custom cloudflare serverless function

Form Feedback

No response

themandalore commented 1 year ago

thanks for the post @nonogakhi , what is IRR? Have a link to a price we can pull it from? And also, for the spotPrice type, we return uin256. We can do a custom one to uint8, but if you're open to it, you'll get more reporter support and is a faster addition for the standard. it's also really easy conversion in solidity (. just uint8(myNumber) )

nonogakhi commented 1 year ago

Thanks @themandalore for your answer. IRR is the Iranian Rials which is the national currency for Iran. We will build multiple multiple serverless function that return the price. The spotPrice type is not an issue. Also would like to know what would be the requirements on our side. Thanks in advance for your guidance

themandalore commented 1 year ago

Thanks, so you just need to give us some example endpoints! You can build the endpoints on your end, but just note that if they go down or get manipulated, so does your price feed. Also, just clear documentation on how/when to dispute. For it to be an open network, everyone should be able to view and be able to calculate what a correct value is, so if you can just add that and some end points, we'll get it merged in and can start reporting it!

And just curious, what network will you need it on and how frequently?

nonogakhi commented 1 year ago

Hey and thanks, The endpoint will look like something like that:

{
    "success": true,
    "query": {
        "from": "USD",
        "to": "IRR",
        "amount": 1
    },
    "info": {
        "timestamp": 1678278662,
        "rate": 42274.999782
    },
    "date": "2023-03-08",
    "result": 42274.999782
}

To prevent the price API we will replicate as much as we can. We are open for suggestions to prevent price manipulation.

Disputes

I guess a dispute happens When there is a mismatch between the real value of the currency based on publicly available calculations of the currency and what the reporter has reported. Does this answer to your question regarding the disputes?

This will be launched on ethereum(and potentially zk-sync if supported by tellor) and it will be updated once per hour.

themandalore commented 1 year ago

Awesome, well let us know when the API is up and you can pass the endpoint to reporters. Usually it's best to just tell reporters how to fetch the data themselves(even a paid api is better than nothing), that way it's not so centralized w/regard to your input.
But sounds good on the other stuff too. We can also support zk-sync, but I think the networks still a little new, so I'd be cautious about going over there yet (there were 5txns yesterday from what I can tell)

themandalore commented 1 year ago

I'll have our reporter manually put in a price though on goerli so you can see what it might look like and test if it works for you

0xSpuddy commented 1 year ago

Hello @nonogakhi! Here is the manual USD/IRRR report:

Also, Here is a screenshot of what this looks like on our data-feed:

Screenshot 2023-03-08 at 10 25 08 AM
0xSpuddy commented 1 year ago

@nonogakhi I've added USD/IRR to a branch of the telliot-feeds repo. It only has one source for now (which is not really good enough for mainnet use), but if you want us to report it on any testnet let me know. We're on mumbai, goerli, arbitrum goerli, optimism goerli, and chiado.

0xSpuddy commented 1 year ago

@nonogakhi I reached out via email 🤙 let us know if you need help.

0xSpuddy commented 1 year ago

Since we haven't heard back from you in a while @nonogakhi I'm going to close this issue. If you want us to open it back up let me know 🤙