Receiving Data From Fetch
This page is about consuming data from Fetch Oracle in your own smart contract.
Querying Information
The Fetch Oracle system allows users to request specific pieces of data. Meanwhile, reporters can then submit those values.
Every piece of data that is requested, reported, and retrieved within the Fetch system is associated with a Query Type, Query Data, and a specific identifier known as the Query ID.
A Query Type is a specification for custom data you want to receive from the oracle. It defines the parameters of a Query that users can input for their specific requests. For example:
Query Type - SpotPrice
asset
description: Asset ID (e.g. PLS)
value type: string
currency
description: Selected currency (e.g. USD)
value type: string
Query Data is used to form your new Query's unique identifier, or Query ID.
It's also emitted in data submission and payment contract events, allowing Fetch users and reporters can programmatically construct query objects.
The Query ID is your Query's unique identifier and the hash of the Query Data. It's required for submitting, retrieving, and paying for all data in the ecosystem.
To generate a query ID, use this simple tool:
Last updated
