Frax Oracle Overview

Oracles for Frax assets that use onchain prices and provide the same interface as Chainlink oracles

Motivation

To increase the velocity of adoption of our assets in lending protocols, AMMs, and vault products. We believe that oracles using onchain prices sources are the most reliable and verifiable.

Major Components

Dual Oracle / Price Source

The Dual Oracle / Price Source contract gets two prices (high and low) from two different onchain sources and returns them both. This contract then writes the prices to the Frax Oracle contract. These contracts are largely inspired by Fraxlend Dual Oracles.

Anyone can call the addRoundData() function on the Dual Oracle to add a fresh price to a Frax Oracle. They just need to pay gas. The Frax Protocol calls this function once per day per supported asset.

Frax Oracle

Only the Dual Oracle contract for the proper asset can write prices to a corresponding Frax Oracle. The Frax Oracle stores prices that can be retrieved in the Chainlink style with AggregatorV3Interface or in the Fraxlend getPrices() style. When interacting with a Frax Oracle through the Chainlink style, the price data will be the average of the low price and high price. When using the Fraxlend getPrices() style, the low and high price will both be given. Prices will be considered bad / stale if an underlying Chainlink oracle signals a price is bad, or if a price is too old.

Key Takeaways

Frax Oracle prices can be consumed identically to Chainlink oracles.

All onchain price sources have deep Frax protocol owned liquidity that we will not remove, which provides a high degree of safety.

Last updated