Skip to content

predict: gate mints and pool flushes on a certified pricing-error bound#1159

Draft
0xaslan wants to merge 10 commits into
mainfrom
at/predict-pricing-error-certificate
Draft

predict: gate mints and pool flushes on a certified pricing-error bound#1159
0xaslan wants to merge 10 commits into
mainfrom
at/predict-pricing-error-certificate

Conversation

@0xaslan

@0xaslan 0xaslan commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Predict carries a signed center-radius Approx from option pricing through payout-tree valuation and pool NAV.
  • Pricing now has one canonical, decomposed 1e9 evaluator; the parallel u128/1e18 certificate evaluator has been removed.
  • Mint and pool-NAV policy gates use the certified radius with true-value-relative limits of 0.1% and 1%.

Why

  • Predict prices digital options from an SVI implied-variance surface in fixed point. Mint admission consumes contract prices, while the periodic full-pool valuation consumes the resulting NAV.
  • The previous implementation evaluated the formula twice: once at 1e9 for the protocol value and again at 1e18 for its certificate. That duplication obscured which part of the formula actually needs retained precision.
  • This draft establishes the mechanical all-1e9 baseline needed to measure liveness before widening one minimal contiguous pricing component.

Linear / Context

Key Decisions

  • This is an intentionally known-red experimental checkpoint, not a merge-ready state. Tests that need to mint on the default surface remain live and fail at the precision gate; they are not re-pinned or marked as expected failures.
  • Existing architectural simplifications remain: Approx is carried through the price memo, signed payout-tree walk, liquidation correction, expiry NAV, and pool NAV; tick-to-strike conversion remains owned by range_codec.
  • Independent soundness fixes remain in the baseline: sigma-squared births its fixed-point rounding error, a rounded zero slope does not discard a possible smile correction, and relative-error checks use the lowest possible true value as their denominator.

Scope / Descoped

  • No retained 1e18 pricing island is included in this checkpoint.
  • No test fixtures or economic outputs are changed to make the suite green.
  • Real-surface liveness analysis is deferred until a minimal precision island reduces the unit-test failure count below the experiment threshold.

Test Plan

  • sui move build --path packages/fixed_math --warnings-are-errors
  • sui move build --path packages/predict --warnings-are-errors
  • sui move test --path packages/fixed_math --gas-limit 100000000000 — 151 passed
  • sui move test --path packages/predict --gas-limit 100000000000 — 449 total, 369 passed, 80 known-red
  • Classified all 80 Predict failures: 79 abort at strike_exposure::EPriceTooImprecise; one directly asserts that the same default price should certify
  • python3 packages/predict/predeploy/check.py
  • Pinned Move formatting

Risk / Rollout

  • Draft only; do not merge this checkpoint. The compositional 1e9 radius makes the normal production mint unavailable.
  • The next increment should retain higher precision only across the smallest variance-to-d2 island that materially restores liveness, then validate the surviving failure set before real-surface analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant