7.3 ChainLink oracles —> (ChainLink Docs)
Last updated
Last updated
An interesting example of a declination of decentralized oracles is the ChainLink project, a network of decentralized oracles consisting of three main smart contracts: a reputational smart contract, a data aggregation smart contract, and an off-chain registry of data providers.
The former is used to track performance, the scores of which are used to populate the off-chain registry of data providers.
The order placement smart contract enables the selection of a data provider offer based on the reputational ranking results.
The service smart contract is then finalized, which includes the query parameters and number of oracles required without the need for the buyer to interact directly with the oracles.
The data aggregation smart contract collects the oracle responses and calculates the final query result, then makes it available to the reputational smart contract.
ChainLink facilitates connectivity through the use of external adapters, which connect the oracles to any API endpoint. Possible connections with Chainlink include traditional payments, back-end systems, Web APIs, event data, market data, linking to other blockchains, and more. Chainlink also provides the development tools needed to formulate and implement new oracle design patterns, such as using multiple data-sources, multiple oracles, flexible aggregation methods, and reputation services.
In the ChainLink documentation you can find an example of Solidity code that finds the last price of a token pair through the function latestRoundData.