Oracle Strike OLM

Git Source

Inherits: OLM

The Oracle Strike OLM contract uses an oracle to determine the fixed strike price when a new option token is created on epoch transition. This should not be confused with Oracle Strike Option Tokens, whose strike price changes dynamically based on the oracle price.

State Variables

oracle

Oracle contract used to get a current strike price when creating a new option token

IBondOracle public oracle;

oracleDiscount

Discount to the oracle price used to set the strike price when creating a new option token

uint48 public oracleDiscount;

ONE_HUNDRED_PERCENT

uint48 internal constant ONE_HUNDRED_PERCENT = 1e5;

minStrikePrice

Minimum strike price that can be set when creating a new option token, in number of quote tokens per payout token

uint256 public minStrikePrice;

Functions

_initialize

Internal function, not callable directly. Called within initialize to implement Oracle Strike OLM specific initialization logic.

function _initialize(bytes calldata params_) internal override;

Parameters

The parameters for this function are ABI-encoded into a bytes object and passed as the other_variable into the top-level OLM initialize function. For example:

bytes memory other = abi.encode(oracle, oracleDiscount, minStrikePrice);

nextStrikePrice

Returns the strike price that would be used if a new epoch started right now

function nextStrikePrice() public view override returns (uint256);

setOracle

Set the oracle contract

Only owner

function setOracle(IBondOracle oracle_) external onlyOwner requireInitialized;

Parameters

setOracleDiscount

Set the oracle discount

Only owner

function setOracleDiscount(uint48 oracleDiscount_) external onlyOwner requireInitialized;

Parameters

setMinStrikePrice

Set the minimum strike price

Only owner

function setMinStrikePrice(uint256 minStrikePrice_) external onlyOwner requireInitialized;

Parameters

setQuoteToken

Set the quote token that is used for the option tokens

function setQuoteToken(ERC20 quoteToken_) external override onlyOwner requireInitialized;

Parameters