commitfunction is called, which uses the Uniswap v3 TWAP feature to get the TWAP for the time period. This TWAP is added to the contract, which is then used to calculate the period's return and the pool's price volatility.
function vol(address pool) public returns (uint256 stdev)
function annualizedVol(address pool) public returns (uint256 stdev)
annualizedVolfunction annualizes the output from
voland returns what is typically used as a Historical Volatility number in options exchanges.
function getPremium(uint strike, uint expiryTimestamp, bool isPut) public returns (uint256 premium)
getPremiumfunction takes in the option's terms such as strike price, expiry and option type to determine the pricing of the option using the Black-Scholes model. Internally, it retrieves the spot price of the underlying asset from ChainLink and the annualized volatility from the VolOracle as additional inputs for Black-Scholes.
strikeparameter is in the unit of
10**8, so the strike price of $3000 is
3000 * 10**8. The premium is in the unit of
function getOptionDelta(uint strike, uint expiryTimestamp) public returns (uint256 delta)