Price Oracles

What are oracles?

Oracles are an essential part of the DeFi ecosystem that allows protocols to incorporate of both on and off-chain data for use in their smart contracts.

Unit Protocol uses oracles to gather current price data for the dozens of tokens accepted as collateral.

Example of an oracle price feed

Price quote from Chainlink oracle

Sources underlying oracle price feed

Detail feeding Chainlink oracle price quote

Oracle price feed used in Unit Protocol

Unit Protocol risk and liquidation calculation based on oracle price feed

Why is this information important?

Having accurate and reliable pricing information is necessary to calculate borrowing parameters, manage collateralized debt positions (CDPs), and when necessary to liquidate collateral positions.

Oracle history at Unit Protocol

Initial attempts to use Keep3r as the primary oracle to receive our collateral price in ETH and Chainlink oracle to receive ETH price proved to be unreliable and it was determined that a new solution was needed.

In April 2021 Unit Protocol undertook an major oracle upgrade to address this issue. During that time all $USDP borrowing limits were temporarily set to zero for all collateral except ETH, which used Chainlink. Upon completion all oracles had been successfully migrated to Chainlink. This solution will allow for adding even more collateral in the future and reduce the overall expense associated with retreiving data from it. By inheriting the security underpinning Chainlink oracles Unit Protocol is using the most accurate pricing data possible.

As a backup to the Chainlink price oracles Unit Protocol maintains a Keydonix-based oracle solution which can relies on a time weighted average price (TWAP) from Uniswap v2.