Skip to content

Volatility measurement method

Version 1.0. Normative.

The keeper reports a volatility measurement when it opens an auction. The contract uses the report to derive a proposed strike distance. The contract then clamps that distance inside governance rails.

This page specifies the input data, recursion, annualization, weekly conversion, rounding, and output scale.

The method has no estimation step. It is deterministic arithmetic on public closing prices.

1. Definitions

  • Close: the official daily closing price on the underlying's primary exchange.
  • Market date: the trading date of that exchange in New York time.
  • Return: the natural logarithm of the ratio of two consecutive closes.
  • Variance: the exponentially weighted estimate of squared daily returns.
  • Annual sigma: annualized volatility as a decimal.
  • Weekly sigma: seven-day volatility as a decimal.
  • Basis point: 0.01%. The output uses 10,000 basis points per 1.0.

2. Input data rules

  1. Use one close per trading day.
  2. Order closes by market date, ascending.
  3. Use the official close of the primary exchange.
  4. A public mirror is permitted.
  5. End the series at the last close before measurement time.
  6. Use at least 21 closes.
  7. Use every close in the committed series.
  8. Do not truncate early history.
  9. A market holiday has no row. This is not a data gap.
  10. Commit the exact input series before measurement.
  11. Publish the SHA-256 of the input snapshot.
  12. If the source reports a split or dividend inside the window, use adjusted closes and commit a new snapshot.

3. Constants and arithmetic

ConstantValue
Lambda0.94
Seed window20 returns
Trading days per year252
Days per year365
Weekly round length7 days

Use IEEE-754 double-precision arithmetic.

Do not round an intermediate value. Round only the final output.

4. Computation

Let C_0 through C_n be the closing prices.

Step 1: daily log returns

For t = 1 through n:

r_t = ln(C_t / C_{t-1})

Step 2: seed variance

Use the first 20 returns:

v_20 = (1 / 20) × sum(r_t² for t = 1 through 20)

Use a zero mean return.

Step 3: update variance

For t = 21 through n:

v_t = 0.94 × v_{t-1} + 0.06 × r_t²

Step 4: annualize

sigma_ann = sqrt(v_n × 252)

Step 5: convert to seven days

sigma_week = sigma_ann × sqrt(7 / 365)

Step 6: produce the report

sigmaWeekBps = round(sigma_week × 10,000)

Round to the nearest integer. Round halves away from zero. This is the only rounding step.

Proposed strike distance

The keeper derives:

proposedDistanceBps = round(sigmaWeekBps × strikeSigmaK / 10,000)

strikeSigmaK is a governance parameter scaled by 10,000. A value of 10,800 represents 1.08.

The contract then applies its floor, ceiling, and maximum-change rails.

5. Worked TSLA example

Input snapshot: 556 daily closes from 2024-05-01 through 2026-07-21.

sha256: e57d451299fd0abccaadaf52b472c59ef4a1138f4f1077bad46f1d44c43c0904

StepValue
Last close378.93
Return count555
First return0.00011111111122521166
Final return0.025011323812001267
Seed variance0.0006642174942174634
Final variance0.0010471343304365042
Annual sigma0.5136904235724071
Weekly sigma0.07113839413598368
sigmaWeekBps711
Distance at strikeSigmaK = 10,800768

An implementation conforms when it produces these values from the same snapshot.

6. Method reference and versioning

  1. The canonical reference uses UTF-8 bytes.
  2. The on-chain volatilityMethodRef stores the SHA-256 of those canonical bytes.
  3. Governance changes the reference through its timelock.
  4. Any byte change produces a new hash.
  5. A normative rule change increments the method version.
  6. An editorial change can keep the version but still changes the hash.
  7. A verifier computes the canonical hash and compares it with the on-chain reference.

Normative rules are the input rules, computation, versioning, failure rules, and conformance rule.

7. Failure rules

A data gap exists when:

  1. the source is unavailable;
  2. a market-open date has no row;
  3. a close is missing, zero, negative, or not a number;
  4. the series has fewer than 21 closes;
  5. a split or dividend invalidates unadjusted closes; or
  6. the input snapshot hash does not match its commitment.

When a data gap exists:

  1. do not report a sigma;
  2. call the no-report auction-open form;
  3. let the contract use the previous weekly distance;
  4. do not interpolate a close;
  5. do not extrapolate a close;
  6. do not reuse an old sigma; and
  7. record the public failure reason and input hash.

Never invent a sigma.

8. Conformance

An implementation conforms to version 1.0 when it reproduces the worked example exactly from the same committed snapshot.

It must expose the intermediate values so another operator can compare every step.

Rules before returns.