Prior Protocol / Docs
Exchange / Docs / Reference / Verification

Verification

Anchors, invariants and the defects these caught.

101 tests. The pricing and risk components are anchored against published values and structural invariants.

QuantityComputedTolerance
Call10.4505835721855501e−10
Put5.5735260222569641e−10
Φ(1.96)0.9750021048517801e−12
Anchor case: S = K = 100, T = 1, r = 0.05, q = 0, σ = 0.20.

Invariants

  • Put-call parity across four strikes, three tenors and a non-zero dividend yield.
  • Vega equals the central difference of price in volatility; gamma the second difference in spot.
  • Implied volatility round trips wherever vega exceeds the identifiability threshold, and returns nothing elsewhere.
  • A long option can never produce a scenario loss exceeding the premium paid.
  • A flat book requires zero margin; a spread requires materially less than its naked leg.
  • Borrowing power against any short position is exactly zero.

Defects these caught

Recorded rather than buried

The delta inverter had the put branch reversed, producing 25 delta put strikes above spot. Delta decreases in strike for calls and puts alike, so one branch was correct and writing two is what allowed the sign to flip.

The strike ladder emitted non-positive strikes for low priced underlyings and silently returned short ladders.

The scenario grid used fixed shocks, with the consequence analysed under horizon scaling.

reproduce
$ npm test                          101 passing
$ node --test 'test/options.test.js'
$ node --test 'test/perp.test.js'
$ npm run emit