Skip to content

Latest commit

 

History

History
83 lines (69 loc) · 4.39 KB

README.md

File metadata and controls

83 lines (69 loc) · 4.39 KB

Predict protocol documentation

This is the documentation for the Predict protocol: how it works, how it is designed, and what its risks are. It is written for a technically literate reader (traders, liquidity providers, and anyone evaluating the protocol) who wants to understand the mechanism. It is not an integration or SDK guide — it does not contain transaction recipes or a function-by-function API reference.

Status: in development, not yet deployed. Current shipped state: live oracle data is read from the standalone propbook Pyth and Block Scholes feeds (no in-package oracle); strikes are absolute integer ticks (raw_strike = tick × tick_size); the LP layer is asynchronous — supply and withdraw are queued and settled by a privileged periodic flush that marks the whole pool at one exact NAV; and terminal settlement is passive, preferring Propbook's exact Pyth history and permitting exact Block Scholes after a 30-second grace period when a normal redeem or pool-rebalance flow first needs the settled branch. From package version 4, mints and early sells use delayed execution: each order waits in its market's queue and fills at Pyth's signed price for a fixed instant after it was placed, and a filled order stays in the queue as an Open record. The queue lives in a companion package, deepbook_predict_orders, and the pure pricing math in a library, deepbook_predict_math, because Sui caps the size of a package. Where a behaviour is still changing, the docs describe it at the conceptual level and point to the configuration that governs it rather than to specific values that may drift.

Start here

  • Overview — what Predict is, the core mental model, the market and position lifecycle, and what the protocol guarantees.
  • Glossary — every term technically defined, mapped to its standard options / structured-product name and to the code identifier.

Concepts

How the protocol works:

  • Markets and positions — per-expiry range markets, the absolute tick grid, what an order/position is, and the lifecycle from mint through early sell and settlement.
  • Delayed execution — the three packages that share the order flow, how queued mints and early sells are placed, priced at τ, filled or refunded, held as Open records, and paid at settlement, plus the policy and the upgrade rules.
  • Pricing and oracles — how prices are formed from the propbook Pyth spot and split Block Scholes feeds, the forward fallback, and freshness rules.
  • Fees and rebates — the fee components a trader pays and the isolated inventory-impact charge and rebate.
  • Liquidity and NAV — the pool, PLP shares, the async supply/withdraw queues, the privileged flush, and how the exact pool NAV is computed.

Design

How the protocol is built:

  • Architecture — the packages and on-chain objects, who owns what capital, the capability and authorization model, and version gating, including the publish and relink order across packages.
  • Configuration — what is tunable, the defaults, how config is snapshotted per expiry, and who can change it.
  • Invariants — a precise, scannable reference of the conditions the protocol always maintains (solvency, floor, NAV, settlement, rounding).
  • Design decisions — the significant design choices and the alternatives that were rejected, with rationale.

Risks

  • Risks and limitations — trust assumptions, risks to holders and liquidity providers, oracle and admin powers, and known limitations.

Reading paths