Home

Awesome

defi-oracles

A curated list of oracle methods and contract addresses used in decentralized finance (DeFi) projects.

Table of Contents

Aave

Oracle Method

Aave uses separate Chainlink Price Reference Data contracts for each of the 15 price oracles needed to secure the accurate issuance and liquidation of cryptocurrency-backed loans. These data feeds are for assets priced against ETH and include LEND, LINK, BTC, MKR, MANA, KNC, USDC, REP, ZRX, BAT, DAI, TUSD, USDT, SUSD, and SNX.

Chainlink’s Price Reference Data Contracts are decentralized oracle networks made up of at least 7 independent, security reviewed, and Sybil resistant node operators. They derive from a growing pool of 30 independent node operators run by leading blockchain DevOps and security teams, many of which have extensive experience running POS nodes across multiple blockchain networks.

On-chain prices are calculated by having each independent node retrieve data from one of the numerous different market data aggregators, with every network containing at least seven independent data aggregator APIs. The nodes’ individual responses are then aggregated together on-chain into a collective response that becomes a new on-chain price update to the Price Reference Data Contract. Updates occur every 1% deviation in price (2% for less used assets), with a minimum time-based update every hour if the deviation threshold is not reached.

Source

Augur

Oracle Method

After a market enters reporting, an Initial Reporter (typically the market creator), selects which outcome occurred. This becomes the “Tentative Winning Outcome.”

Users can dispute the Tentative Winning Outcome by staking REP on an alternative outcome that they believe to be correct. An alternative outcome requires a specified threshold of REP, which is called the Dispute Bond, to be staked on it in order to become the new Tentative Winning Outcome.

In v2, if you stake REP in favor of an outcome that the market ends up resolving to, you receive a 40% ROI on your staked REP (except in the case of an usued pre-stake or initial reporting). If you stake on an outcome that the market does not end up resolving to, you lose your entire stake.

With each successive dispute round, a higher Dispute Bond is needed to shift the Tentative Winning Outcome. A user may contribute the full Dispute Bond or fill it partially as part of a crowd-sourced fill along with other users.

Source

bZx

Oracle Method

bZx uses separate Chainlink Price Reference Data contracts for each of the 6 price oracles (BTC/ETH, KNC/ETH, LINK/ETH, ZRX/ETH, DAI/ETH, and SUSD/ETH) needed to secure the accurate issuance and liquidation of loans for margin trading.

Chainlink’s Price Reference Data Contracts are decentralized oracle networks made up of at least 7 independent, security reviewed, and Sybil resistant node operators. They derive from a growing pool of 30 independent node operators run by leading blockchain DevOps and security teams, many of which have extensive experience running POS nodes across multiple blockchain networks.

On-chain prices are calculated by having each independent node retrieve data from one of the numerous different market data aggregators, with every network containing at least seven independent data aggregator APIs. The nodes’ individual responses are then aggregated together on-chain into a collective response that becomes a new on-chain price update to the Price Reference Data Contract. Updates occur every 1% deviation in price (2% for KNC/ETH and BTC/ETH), with a minimum time-based update every hour if the deviation threshold is not reached.

Source

Compound

Oracle Method

The price of BAT, REP, ZRX, and WBTC are a median of prices from Coinbase Pro, Bittrex, Poloniex, and Binance, denominated in Ether, and posted on-chain after a 1% deviation in an asset’s median price. For security, price changes are limited (at the protocol level) to 10% per hour, unless a manual approval is provided by a second, offline address. DAI, SAI, and USDC are based on Maker’s ETH/USD price feed.

Compound is developing an advanced price feed, the Open Oracle System, to create a transparent, decentralized, resilient, and tamper-proof price feed.

Contract Addresses

Source

DDEX

Oracle Method

Uses on-chain price oracles to determine real-time USD prices. These price oracles are different for each market (example: the ETH-DAI market will use the MakerDAO ETH-USD price oracle), chosen based on stability. They have several safety mechanisms built into the price determination process to guard against oracle failures: both on a contract level and algorithmically.

USDC references Coinbase prices, with safety checks, outlier detection, and expiration time built into their onchain proxy.

There are sanity bounds placed on the price of DAI, currently set to 0.95 and 1.05

Contract Addresses

Source

dYdX

Oracle Method

Prices are fed to the dYdX smart contracts through price oracles that run on Ethereum. dYdX uses different price oracles for different assets.

For ETH, dYdX uses the MakerDAO ETH-USD V1 Oracle that is used by MakerDAO for their stablecoin SAI, and relies on a distributed network of reporters that report the price of ETH in USD.

For SAI, dYdX uses a price of $1. SAI can no longer be borrowed and is basically worth 0 as collateral. We only include this oracle method for completeness.

For DAI, dYdX uses our own price oracle which calculates the USD price of DAI using a combination of Oasis Trade's on-chain orderbook, Uniswap, and the MakerDAO ETH-USD oracle. The oracle also has several protections against price manipulation on eth2dai and Uniswap.

For USDC, dYdX uses a price of $1 as USDC is exchangeable 1:1 with USD on Coinbase.

Contract Addresses

Up-to-date contract addresses for the Oracles that dYdX uses can be obtained by calling the getMarketPriceOracle function on dYdX's Solo Margin contract.

Currently the addresses are:

Source

MakerDAO

Oracle Method

The reference price (ETHUSD) for the Maker system is provided via an oracle (the medianizer), which collates price data from a number of external price feeds.

Independent price feed operators constantly monitor the reference price across a number of external sources and will submit updates to the blockchain when:

  1. Source price differs to the most recently submitted price by more than the defined amount (currently 1%)
  2. Last price update was more than 6 hours ago.

Price updates are written to the blockchain via price feed contracts which are deployed and owned by feed operators. Price feed contracts which have been whitelisted by the medianizer are able to forward their prices for inclusion in the medianized price.

The medianizer is the smart contract which provides Makers trusted reference price.

It maintains a whitelist of price feed contracts which are allowed to post price updates and a record of recent prices supplied by each address. Every time a new price update is received the median of all feed prices is re-computed and the medianized value is updated.

Permissions:

The adding and removal of whitelisted price feed addresses is controlled via governance, as is the setting of the min parameter - the minimum number of valid feeds required in order for the medianized value to be considered valid.

v2 introduces several new proposals:

  1. Add a set of DeFi partners as Feeds
  2. An Oracle Team Mandate to create an Oracle Team role. The mandate will empower MKR Governance to appoint Oracle Team(s) to perform certain tasks on their behalf.
  3. MKR Governors’ control of the Oracles infrastructure be formalized via an Oracle Governance Framework.
  4. New incentive structure for Oracles.

Contract Addresses

Source

Nexus Mutual

Oracle Method

Members will act as judges, with each claim subject to a yes/no vote by members who have chosen to stake a portion of their tokens to act as Claims Assessors. The Claims Assessors earn rewards for voting with the consensus outcome. If anyone is deemed to have voted fraudulently, their stake may be burned via the Governance process.

Nexus Mutual is using Chainlink’s price reference data contracts for valuations of the multi-currency capital pool. Nexual Mutual performs daily on-chain updates and rebalances of its minimum capital requirement (MCR) by consistently recalculating the value of each capital asset (currently ETH and DAI) in the multi-currency pool using Chainlink’s Price Reference Data Contracts.

Source

Nuo

Oracle Method

For any currency pair, Nuo uses best price provided by decentralised exchanges (Pd) and hard-fences it using volume weighted average price aggregated over price feeds from centralised exchanges (Pc).

Currently Nuo uses Kyber and Uniswap as decentralised partner exchanges. Among centralised exchanges, Nuo tracks price and volume across all major cexes with >50 total cexes added already.

At any time, for any currency pair, Pd = Best Price across partner decentralised exchanges Pc = TimeDecaySum( Sum( VolumeOfCex * PriceByCex ) / TotalVolumeAcrossAllCexes )

VolumeOfCex, PriceByCex and TotalVolumeAcrossAllCexes use clustering techniques to remove anomalies in price/volume and ignore exchanges with poor pricing.

TimeDecaySum is built to reduce effect of a high volume exchange going offline for a while by reducing the weight of the price obtained from a cex based on the duration when the last trade was recorded from it.

For any currency pair, Nuo hard-fencing ensures the following holds true: lower_fence * Pc < Pd < upper_fence * Pc

Currently, fencing percentage is placed at 10% system-wide. Hence, lower_fence = 0.9 and upper_fence = 1.1. We can expect a tighter fence as dexes get more efficient and liquid in future

At any point in time, if the above condition does not hold true, the exchange market is paused and resumed again when the condition becomes true. This is done to prevent any unwanted liquidations from happening on the platform due to price manipulations or flash crashes across our partner dexes.

There are plans to potentially integrate Chainlink in a future version.

Source

Synthetix

Oracle Method

Chainlink for FX and commodity price feeds with plan to integrate cryptocurrencies and indices in the future.

Other price feeds are determined by an oracle that pushes price feeds on-chain using an algorithm with a variety of sources to form an aggregate value for each asset.

The ExchangeRates contract (https://contracts.synthetix.io/ExchangeRates) will continue to be fed prices from the decentralized oracle. However, the logic for looking up prices will be extended with a mapping of Chainlink Aggregator contracts for each Synth.

Contract Addresses

Source

Token Sets

Oracle Method

On-chain prices used by their smart contracts are sourced from MakerDAO's oracles (BTC and ETH), and prices for buying and selling are sourced from DEXs that provide liquidity to Set Protocol. They use Chainlink's LINK/USD oracle to power the LINK sets and also have their own on-chain moving average and RSI oracles.

Each Smart Contract Managed Rebalancing Set system is made of three distinct parts: 1) Manager Contract that generates rebalancing proposals based off on-chain data, 2) Oracles that are used to provide data to the Manager Contract and, 3) the Rebalancing Set Token that stores state (balances, allocations, etc.) regarding the strategy.

Currently, HistoricalPriceFeeds use data from Maker’s oracles to build a price history for the underlying asset, but any oracle adhering to Maker's interface could be used. The HistoricalPriceFeed is intended to represent the historical prices of one asset at consistent time intervals. Additionally, there is a defined upper limit to the amount of historical data, after which old data is overwritten.

The MovingAverageOracle leverages data available from the HistoricalPriceFeed to calculate a simple moving average of a desired amount of data points.

Contract Addresses

Source

Additional Resources

Contribute

Contributions welcome! Read the contribution guidelines first.

License

CC0

To the extent possible under law, Linda Xie has waived all copyright and related or neighboring rights to this work.