A guide to oracles in DeFi
Along with smart contracts, oracles form one of the cornerstones of decentralized applications (DApps) and the world of decentralized finance, or DeFi. Oracles act as a gateway between real-world, real-time data sources and the blockchain, allowing smart contracts to be executed and fulfilled based on external sources of information. Use cases to date primarily involve financial information tracking the prices of assets, including digital assets, but the potential applications are endless and could extend to smart contracts based on information about weather, political events, traffic, or even people’s behavioral patterns and geolocations.
Oracles can be based on software or hardware. The former collects data from digital sources such as websites – stock trackers and digital asset exchanges are two common examples – while the latter are based on information that is collected physically, such as barcode scanners and sensors. Oracles can also differ in the directionality of the information, with inbound oracles providing information from third-party data sources to smart contracts, while outbound oracles allow contracts to export data.
Chainlink
Chainlink is one of the oldest and highest-profile oracle technologies in the digital assets space, and today is the most widely used decentralized oracle network. Its core principle is to provide highly reliable tamper-proof data to smart contracts, allowing the contracts to be verified by real-world inputs rather than stakeholder decision-making. The platform aggregates price feeds through its network of oracle nodes, providing reference prices that allow developers to build smart contracts based on reliable external data. The node operators are rewarded for their data collection activity in the form of LINK tokens, the network’s native coin and an ERC677 token, an extension of the ERC-20 protocol standard for tokens created on the Ethereum network. The size of the reward is calculated according to market demand for the data itself, while the value of the token itself is allowed to fluctuate according to supply and demand.
The platform’s success can be observed in the number of high-profile crypto projects that have announced integrations with Chainlink. Polkadot’s DeFi hub Acala and blockchain platform Cardano are just two examples, and as of February 2022, the network had secured over $60 billion in deposits into smart contracts across DeFi, GameFi, lending and more. Serving as a mouthpiece through which the traditional and digital financial systems can communicate, it also follows that Chainlink can provide utility to non-crypto projects. The Google Cloud team previously integrated Chainlink with its BigQuery enterprise cloud data warehouse, while a partnership with charity UNICEF was recently announced. Under the new collaboration, Chainlink will help to fund projects that are developing blockchain-based solutions to support communities in need on behalf of the UNICEF Office of Innovation.
Another feature of the Chainlink ecosystem is its Proof of Reserve oracle networks, which ensure that tokenized assets are collateralized. This protects people using digital assets from fractional reserve practices that they may be unaware of, as well as other risks associated with assets that are not properly backed up. This aspect of oracle networks is set to become even more significant as more and more high-value traditional commodities such as tokenized financial assets and precious metals come on chain.
Band Protocol
Band Protocol is a cross-chain oracle platform connecting real-world data and authenticated APIs to smart contracts. The protocol feeds off-chain information to DApps and uses a number of different mechanisms for communication between data sources and smart contracts. Like Chainlink, Band Protocol is blockchain agnostic, and the platform supports integration with a variety of different blockchains.
The Band Protocol is notable for its community focus, with over 72 professional and community node operators on its network. The decentralized BandChain platform allows anyone with an API endpoint to offer their data for use by DApps via oracle scripts. Data sources are tamper-proof thanks to the Tendermint BFT (Byzantine fault tolerance) consensus algorithm, in which validators take turns to propose blocks of transactions and vote on them.
Node operators stake BAND tokens as a guarantee of their data’s reliability and receive on-chain rewards in BAND in exchange for fulfilling oracle requests and producing blocks. This is funded by the data requests themselves, for which BAND tokens are required as transaction fees from smart contract stakeholders. BAND token holders who do not themselves carry out oracle duties may allocate their tokens to chosen and trusted validators in exchange for a share of query fees and block rewards.
MakerDAO
MakerDAO is a decentralized governance community supporting the generation of Dai, which is described as the world’s leading decentralized stablecoin. This is achieved via the Maker Protocol, a set of smart contracts that forms one of the largest DApps on the Ethereum blockchain. The Dai token uses audited and publicly viewable Ethereum smart contracts as collateral, locking in the token’s price at $1, the standard value for stable digital assets.
Participants in the Maker ecosystem can create Dai by putting up collateral and burning it after repaying the balance they have generated. The decentralized, non-custodial and permissionless storage of leverage is fulfilled through Maker Vaults, which form a core component of the Maker Protocol. This is where oracles come in. The protocol pulls price feeds of various assets into the ecosystem via oracle nodes, allowing participants to identify the right moment to liquidate a vault or find out how much Dai a given vault can generate. The independent, third-party feeds used by the oracles are provided by a number of individuals and organizations, and each oracle corresponds to a specific asset, continually providing new information on its reference price and, therefore, the value of any chosen collateral.
Compound
Compound is an algorithmic, autonomous interest rate protocol supporting the lending and borrowing of digital assets. Running on the Ethereum blockchain, the platform allows users to accrue interest without the need to entrust their digital assets to a third party. All terms are calculated by a smart contract rather than the stakeholders, meaning that collateral and interest rates are set according to the market, and the assets themselves are held in liquidity pools as opposed to being held by the counterparties. The protocol is permissionless, meaning that anyone with a crypto wallet can freely interact with it.
Prices on the protocol are determined by the Open Price Feed, which acts as the core oracle functionality for Compound and is based on Chainlink Price Feeds that are then processed using a number of smart contracts. The View contract ensures that reported prices fall within an acceptable range relative to a token’s time-weighted average price, while the ValidatorProxy contract validates the prices submitted by the feed. A precautionary failover is also in place – the network can switch the primary oracle from Chainlink Price Feeds to Uniswap v2 if necessary.
NEST
NEST Protocol is a blockchain oracle network providing real-world price data for DeFi, GameFi and NFTs. It is also the first oracle to provide on-chain price predictions. The two core components of the ecosystem are NEST Financial Market and NEST Oracle, the latter of which offers decentralized, nodeless, permissionless on-chain verification without a single point of entry or governing body.
NEST is based on a price reference system known as ‘quotation mining’, which allows anyone to participate via the native NEST token, an ERC-20 utility token. Miners provide price quotations to the smart contract and, provided that they have locked in a certain amount of the asset being quoted and paid a commission fee, receive NEST tokens as a reward. Verifiers then accept the quoted price and must lock in double the value of the same asset staked by the miner. Mining is the only way to acquire the NEST token beyond purchasing it on the open market, and a split is made upon minting, whereby 80% goes to the miner, 15% to the node, which comprises holders of the governance token, and 5% to NEST developers.
UMA
UMA Protocol operates Optimistic Oracle, which provides a means of bringing various data types on-chain via dispute arbitration. Requestors seeking price asset data submit requests to the oracle with a stated reward, allowing Proposers to reference off-chain price feeds in exchange for these rewards once a proposal bond has been staked. A period known as the proposal liveness period follows, during which Disputers can refute the Proposer’s price. When proposed prices are disputed, a Data Verification Mechanism (DVM) is activated, and token holders are given 48 hours to vote on the price of an asset. Proposers lose their bond if the disputed price information is deemed incorrect, incentivizing trustworthiness for price information on the oracle.
DIA
DIA (decentralized information asset) is an open-source oracle platform enabling the sourcing, supply and sharing of trustable data. Founded in 2018 and based in Switzerland, DIA is backed by a number of high-profile venture funds, including Outlier Ventures, Continue Capital and TRG Capital. The platform’s feeds include asset prices, metaverse data, and lending rates, along with other data classes. The oracles can be used on all major networks, including Ethereum, Solana, Polkadot and Polygon.
In 2020, DIA began to publicly distribute DIA, the native token of the ecosystem. DIA is a governance token, meaning that validators are able to contribute to decision-making based on their stake. The token also serves as an incentive for information sources to provide accurate data feeds and for validators to check them. The project creators hope to distribute all governance by 2025, at which point DIA will become a fully-fledged DAO or decentralized autonomous organization. Other plans in the project’s roadmap include the launch of custom-built data feeds, which can be constructed around a mix of sources and methodologies, delivering higher resilience.