How It Works
Last updated
Was this helpful?
Last updated
Was this helpful?
See for documentation on the Chainlink Oracle interface.
Currently frxEth/ETH and sfrxEth/ETH are supported.
The frxEth price is determined from two onchain price sources. The first price source is the frxEth / ETH Curve pool EMA Oracle - . This price is bounded to be 0.7 at the lowest (0.7 frxEth = 1 ETH) and 1 at the highest (1 frxEth = 1 ETH).
The second price source comes from the Uniswap frxEth / FRAX pool TWAP oracle - . We then retrieve the price of ETH in USD from this chainlink oracle () and the price of FRAX in USD from this chainlink oracle (). These chainlink prices are used to convert the frxEth / FRAX pool price into a frxEth / ETH price using the following equation:
This price from Uniswap is similarly bounded between 0.7 and 1, mirroring the Curve price. The lower of these prices is returned as priceLow and the higher is returned as priceHigh. These prices are then written to the frxEth / ETH Frax Oracle.
Simply retrieves the pricePerShare() from the sfrxEth contract, retrieves the priceHigh and priceLow in the same manner as the frxEth Dual Oracle outlined above, and returns the following equation:
This works because pricePerShare() returns how many frxEth a single sfrxEth is worth. pricePerShare() goes up over time.
These prices are then written to the sfrxEth / ETH Frax Oracle.
Coming soon
Simply call or on the Frax Oracle contract for the asset you want the price of.