The BondingCurveOracle contract pegs to a linked bonding curve price pre Scale and to a normal UniswapOracle post Scale.
The contract stores the bonding curve (pre-Scale) and Uniswap (post-scale) oracle contracts to reference.
Updates to the bonding curve oracle update the linked uniswap oracle.
Additionally, the contract includes the "thawing" process. Thawing implements the initial pegged price lower than the target uniswap/bonding curve price. The reported peg linearly converges on the target peg over a preset duration window. The duration window d is 2 weeks. At the beginning of the window it reports the peg at the initial price I and at the end it will report the peg at the target price T. Let t be the timestamp between [0,d]. The reported oracle price O during the thawing period is:
new reported peg
new peg value
function read() external view returns (Decimal.D256 memory, bool);
Reads the oracle value and reports the peg as FEI per underlying. The boolean value returned informs whether the reported oracle value is valid. Invalid value means the oracle is uninitialized or the contract is paused.
function isOutdated() external view returns (bool);
Pass through calls
uniswapOracle.isOutdated(), if false, then multiple read functions relying on the oracle would be inaccurate.
function uniswapOracle() external returns (IOracle);
The referenced Uniswap Oracle
function bondingCurve() external returns (IBondingCurve);
The referenced Bonding Curve
function initialUSDPrice() external returns (Decimal.D256 memory);
The initial price to thaw from during the thawing period reported as USD per FEI.
function update() external returns (bool);
function init(Decimal.D256 calldata initialPrice) external;
called by the GenesisGroup with the initial price to thaw from