Deterministic Oracles Deployment

Overview

Deployment of deterministic oracles, both according to the linear discount model and the zero-coupon bond model, is done through the SpectraPriceOracleFactory .

Deployment

One deploys a deterministic oracle through the method

/**
* @dev Deploys a new `SpectraOracle` for a given PT.
* @param _pt The address of the Principal Token (PT).
* @param _discountModel The discount model address.
* @return oracle The address of the newly deployed Oracle.
*/
function createOracle(
   address _pt,
   address _discountModel,
   uint256 initialImpliedAPY,
   address initOwner
) external returns (address oracle)

The _discountModel address corresponds to the address of either the LinearDiscountModel , LinearAPRModel or ZeroCouponDiscountModel , depending on the pricing model one wants to use.

The initialImpliedAPY field is the implied APY according to which we want to discount the PT over the term. The initialImpliedAPY field is in 18 decimals precision, 10 ** 18 representing a 100% implied APY.

The owner of the oracle contract can change the discount model used in the oracle by calling setDiscountModel() .

Example

For example, to deploy an oracle with a 30% implied APY over the term, one does


createOracle(
   address(0) // PT address,
   address(0) // Discount Model Contract address,
   0.3 * 10 ** 18, // 30% implied APY
   address(0) // Address of the owner
) external returns (address oracle)

Last updated