Olive Docs
Options

Volatility Algorithm

The smart contract uses a tau-window realized-volatility update for option pricing.

Refresh Policy

Every option pricing path calls the same volatility-oracle helper. The helper owns the refresh policy:

update allowed    Δt15 minutesorPtPt1Pt15%\text{update allowed} \iff \Delta t \ge 15\text{ minutes} \quad\text{or}\quad \left|\frac{P_t-P_{t-1}}{P_{t-1}}\right| \ge 5\%

If neither condition is true, the oracle returns the cached volatility and does not mutate the stored price, timestamp, or variance. This means quiet markets still refresh on time, while a large price shock can refresh immediately without waiting for the normal interval.

Volatility Formula

The return is:

rt  =  PtPt11r_t \;=\; \frac{P_t}{P_{t-1}} - 1

When an update is allowed, if the elapsed time since the last update is smaller than the volatility window:

Δt<τ\Delta t < \tau

then:

σt2  =  rt2secondsPerYearτ  +  σt12(τΔt)τ\sigma_t^2 \;=\; \frac{r_t^2 \cdot \mathrm{secondsPerYear}}{\tau} \;+\; \frac{\sigma_{t-1}^2 \cdot (\tau-\Delta t)}{\tau}

When an update is allowed and the elapsed time is greater than or equal to the window:

Δtτ\Delta t \ge \tau

then:

σt2  =  rt2secondsPerYearΔt\sigma_t^2 \;=\; \frac{r_t^2 \cdot \mathrm{secondsPerYear}}{\Delta t}

Finally:

σt=σt2\sigma_t = \sqrt{\sigma_t^2}

Where:

  • P_t is the current oracle price
  • P_{t-1} is the last stored oracle price
  • Delta t is the elapsed time since the last volatility update
  • tau is the volatility window
  • secondsPerYear is the protocol year length used for annualization
  • sigma is stored as annualized volatility

The protocol does not apply a volatility floor in this formula. Admins can still use the multisig-only volatility fix instruction for explicit operational overrides.

On this page