tellor-io / dataSpecs

Data specifications for oracle queries
16 stars 9 forks source link

Add Custom Price Query Type #120

Closed 0xSpuddy closed 1 year ago

0xSpuddy commented 1 year ago

This PR is intended to start the process of formalizing a new query type for any non-crypto asset like a stock, derivative product, or legacy market commodity. My take was to make it basically the same as the SpotPrice query type with an added parameter "context" that describes the nature of the spot price data that is to be reported.

Inspiration for this query type comes from communications with LandX. LandX is a protocol that tokenizes real world agricultural commodities. They are using 4 highly custom data points: CORN: per bushel, RICE: per CWT, SOYBEAN: per bushel, and WHEAT: per metric ton. An example of a CustomPrice query type for LandX is included in the proposed dataSpec.

Thanks for reading and review! 🙏

themandalore commented 1 year ago

@heavychain, should we future proof this and add an IPFS field? If we're going down the route of the registry, should we just make all queryID's the IPFS field? I think that ruins any readability right....pros/cons?

tkernell commented 1 year ago

@heavychain, should we future proof this and add an IPFS field? If we're going down the route of the registry, should we just make all queryID's the IPFS field? I think that ruins any readability right....pros/cons?

I imagine that this dataSpecs repo and the on-chain registry could both exist in parallel, and we wouldn't necessarily need to change anything about the dataSpecs docs themselves, nor the queryType definitions or queryIDs. For now this repo hosts the canonical dataSpecs docs, and then when we switch, the on-chain registry will become the official source of the dataSpecs. At that point this repo could just become a staging area for writing dataSpecs, and act as a backup host of these docs.

tkernell commented 1 year ago

Nice structure Spuddy! I like the "context" arg approach for making this customizable.