predict library
DeepBook Predict — package:deepbook/predict.dart.
Mirrors the official @mysten/deepbook-v3/predict subpath: market
discovery, quotes, mint/redeem/claim, PLP, typed receipts, the client-side
board pricer (pricing), and the exact-integer cost engine (cost). Like
the official subpath, this entry point is a separate library — importing
it does not load spot or margin code, and
package:deepbook/deepbook.dart is unchanged.
The curated surface is the PredictClient facade plus the value types, unit conversions, tick helpers, typed errors, and typed execution-result decoders — and, for composing your own PTBs, the auth/derivation primitives and trade-call compositions below plus the generated move-call bindings.
Differences from the TypeScript SDK
- No
predict()client extension. The official subpath registers itself on a Sui client viaclient.$extend(predict({ network }))and exports aPredictCompatibleClienttype. Dart has no client-extension mechanism, so construct PredictClient directly — it is the same facade (tx.*/read.*/decode.*) the extension would have installed, and there is nopredictfunction orPredictCompatibleClienttype here. PredictConfig.predictV1is required. The official field is optional and falls back topackages.predict. The shipped deployment records always carry it; when hand-building a config for your own not-yet-upgraded deployment, setpredictV1to the same value aspredict.
Namespacing differences
The official subpath exports pricing.* and cost.* as namespaces and 17
generated binding modules as *MoveCalls / *Events namespaces. Dart has
no namespace exports, so:
- The float pricer (
pricing.*) and integer cost engine (cost.*) are exported FLAT here. Two official names are adjusted to avoid collision:cost.rangeProbabilityis rangeProbabilityRaw (the floatpricing.rangeProbabilitykeeps the plain name), and the package root's testnet conveniencePOSITION_LOT_SIZEis TESTNET_POSITION_LOT_SIZE (the Move constant keeps POSITION_LOT_SIZE). - The generated binding modules are exported flat with the generic
object-id/cap helpers (
id,destroy) hidden, since several modules define them; every other builder and BCS struct keeps its official name. Every module is also published whole as its own library —package:deepbook/predict/<module>.dart(for examplepackage:deepbook/predict/pause_cap.dartforpause_cap.destroy, orpackage:deepbook/predict/expiry_market.dartfor the on-chainMintQuoteBCS struct) andpackage:deepbook/predict/propbook/...for the pricer-store modules — import one with a prefix to reach hidden symbols or to avoid collisions with your own code.
Classes
- ActiveMarket
-
One tradeable market as returned by
read.markets(). - BalanceChangeReceipt
-
Typed
Deposited/Withdrawnreceipt. Display values assume a 6-decimal coin (quote + PLP both are). - BoardPricer
-
A pricer bound to one resolved snapshot: price a whole board of strikes
locally, no chain calls. Returned by
read.pricer(market); also constructable directly from inputs you already hold (e.g. from aPricersnapshot decoded elsewhere). - BoardPricerWithSources
- A client-side board pricer bound to one market snapshot, with the oracle source timestamps it was read at.
- Boundaries
- A range's two boundary UP probabilities, raw 1e9. Null is an infinite boundary — the −∞ lower of a DOWN order and the +∞ higher of an UP order — which is priced at the digital limit and pays no fee leg.
- BuilderCodeReceipt
-
Typed
BuilderCodeSetreceipt. - ClaimReceipt
-
Typed
SettledOrderRedeemedreceipt. A settled claim closes the order in full. - CloseBookTerms
-
The same reads for a live close, which also needs the peak OUTSIDE the
order's range (
strike_exposure::live_close_inventory_impact). - CloseOptions
-
Options for
redeem: which order and how much to close.claimSettledtakes only the order id — a settled claim closes the order in full. - CongestionPolicy
-
The protocol's congestion knobs (
EwmaConfig). Shipped disabled. - CongestionState
-
The market's gas-price EWMA (
ewma::EwmaState), both fields 1e9-scaled. - CreateManagerReceipt
-
Typed
AccountCreatedreceipt. - DecodableEvent
- The slice of an executed/simulated transaction result the decoders need. Transport-agnostic: construct from a gRPC event proto with DecodableEvent.fromProto, or structurally from any transport's fields.
- DecodableTransactionResult
- The decodable slice of an executed/simulated transaction result.
- DeploymentInfo
- Which on-chain deployment a set of ids came from.
- DeploymentUnits
- Scale constants the deployment owns rather than the SDK.
- FeePolicy
-
One market's fee policy: the
StrikeExposureConfigit snapshotted at creation, in raw 1e9 rates. Snapshotted means later admin changes do NOT reprice a market already trading, so read it per market (theMarketCreatedevent carries every field) rather than assuming the template. The last three are the inventory-impact parameters, inert while inventoryImpactMaxRate is zero (the shipped value). - MarketDescriptor
- A live/settled market addressed by its human coordinates: a binary position (single strike + side) or a two-strike range position.
- MarketFeeds
-
The oracle feed object ids a live market's pricer reads. Grouped so
callers pass one bundle; the deployment's per-underlying ids live in
cfg.underlyings[symbol], named to match the deployment manifest. - MarketSummary
- A resolved live market: its on-chain state summary for the caller.
- MintAmountOptions
-
Options for
mintAmount(spend up to a premium budget, floor the quantity received). - MintBookTerms
-
Pre-trade payout-tree reads a mint's inventory-impact charge is evaluated
against (
strike_exposure::quote_mint_range). All in quote units. - MintBudgetCost
- Budget-sized mint plus the budget information needed to render an order preview.
- MintBudgetInputs
-
Inputs for mintCostForBudget: an all-in budget, the
mint_exact_costshape. - MintCost
-
One mint's cost decomposition — the fields of the chain's
MintQuote, in human units with the exact integers alongside. cost is the account debit. - MintCostInputs
- Inputs for mintCost: an exact payout quantity.
- MintCostOptions
-
Options for
mintCost: all-in budget. Requires Predict v2 or later. - MintCostRaw
- Exact integer fields of a mint quote.
- MintFees
- One mint's fee decomposition in human units.
- MintInputsBase
- Inputs shared by the exact-quantity mint quote and the budget-sized one.
- MintOptions
-
Options for the friendly
mint(exact payout quantity). - MintQuote
- Exact pre-trade quote: the dry-run receipt of the mint you are about to send.
- MintQuoteRaw
- Raw integers of a mint quote.
- MintReceipt
-
Typed
OrderMintedreceipt. - MintReceiptFees
-
Fee breakdown of a mint.
referralis a PORTION of the trader-paid trading fee and congestion surcharge routed to the referrer — it is already inside those numbers and is NOT an extra debit;inventoryImpactis a separate charge. - MintReceiptRaw
- Exact integers of a mint receipt.
- OpenPosition
- One open position — the coordinates redeem/claim/hasPosition take.
- OrderRange
-
The contract terms packed into an order ID (
deepbook_predict::order). Tick 0 as the lower bound is −∞ and POS_INF_TICK as the higher is +∞; multiply a finite tick by the market'stickSizefor its raw strike. Use it to feed a position fromread.positionsinto redeemLiveProceeds. - PlpCancelReceipt
-
Typed
RequestCancelledreceipt. - PlpRequestReceipt
-
Typed
SupplyRequested/WithdrawRequestedreceipt. - PlpSupplyOptions
-
Options for
supplyPlp. - PlpWithdrawOptions
-
Options for
withdrawPlp. - PoolSummary
- Aggregate pool figures. Balances in human units (shares raw); the pending fields are request COUNTS, not amounts — the on-chain getters expose queue lengths, and the escrowed USDC/PLP behind them is tracked separately.
- PositionsHandle
- Resolved-once ids for an owner's position store (cache these).
- PredictClient
-
The one object an app constructs. Wraps the config, a client for reads,
and a derived-account model so callers pass owner addresses, decimal
amounts, and human market coordinates — the facade converts to raw units,
resolves markets (cached), and delegates to the internal tx primitives /
reads. Each
tx.*builder returns a finishedTransaction; callers composing their own PTBs use the trade primitives and generated move-call bindings this subpath exports. - PredictCoinTypes
- Coin types DeepBook Predict reads.
- PredictDecoders
-
client.decode.*— pure event parsing (no network): pass the executed/simulated transaction result (with events included) and get a typed receipt back. Singular forms throw unless exactly one matching event exists; plural forms return all (an integrator batching N actions in one PTB gets N receipts). - PredictIds
- Ids for DeepBook Predict.
- PredictObjects
- Shared object ids for DeepBook Predict.
- PredictPackages
- Package ids for DeepBook Predict.
- PredictReads
-
client.read.*— chain reads and dry-run quotes. - PredictTxBuilders
-
client.tx.*— each returns a ready-to-signTransaction. Market-resolving builders are async. - PricerBoundaries
- A local pricer snapshot plus the range's strikes in USD (null for an infinite side) — carries the float pricer's ~1e-4 approximation.
- PricerInputs
-
A resolved pricer snapshot: the forward the contract prices against and
its rolled SVI surface, both in decimal. Produced by
read.pricer(market); consume via boardPricer or the pure functions below. - PricerSnapshot
- A resolved pricer snapshot read from the chain: the decimal forward + rolled SVI the client-side math consumes, plus the oracle source timestamps behind it.
- PricerSources
-
The oracle source timestamps behind a pricer snapshot (ms; for staleness
display — Pyth is 0 when no usable spot existed). The Block-Scholes
entries are the provider's PER-UPDATE source timestamps
(
value_timestampfor spot/forward,svi_timestampfor SVI) — the clocks freshness and the SVI roll-down anchor on. - ProbabilitySource
- Where a quote's probabilities come from: Boundaries you already hold (raw 1e9), or a PricerBoundaries — a local pricer snapshot plus the range's strikes in USD (null for an infinite side).
- RangeTicks
-
The
(lowerTick, higherTick)pair of a range, as themintentrypoint takes directly. - RedeemFees
- A live close's fee decomposition in human units.
- RedeemLiveInputs
-
Inputs for redeemLiveProceeds. The range is the ORDER's own range — the
same two boundaries it was minted over, which is what
redeem_livereprices. - RedeemLiveProceeds
- What a live close credits the account, decomposed.
- RedeemLiveRaw
- Exact integer fields of a live-redeem preview.
- RedeemQuote
- Exact pre-close quote: the dry-run receipt of the redeem you are about to send.
- RedeemQuoteRaw
- Raw integers of a redeem quote.
- RedeemReceipt
-
Typed
LiveOrderRedeemedreceipt. - RedeemReceiptFees
-
Fee breakdown of a live close.
inventoryImpactRebateis the path-independent inventory-impact rebate credited back on the close. - RedeemReceiptRaw
- Exact integers of a redeem receipt.
- Svi
-
Rolled-down SVI parameters for one expiry, in decimal (NOT the chain's
1e9/1e18 integer scaling) — the surface AFTER Predict's remaining-time
roll-down, as carried by the on-chain
Pricer. a, rho, m are signed; b, sigma are non-negative. - UnderlyingIds
- Per-underlying oracle wiring.
Constants
- MAINNET_DEPLOYMENT → const DeploymentInfo
- Which on-chain deployment the ids below came from.
- MAINNET_UNITS → const DeploymentUnits
- Scale constants the deployment owns rather than the SDK.
- TESTNET_DEPLOYMENT → const DeploymentInfo
- Which on-chain deployment the ids below came from.
- TESTNET_UNITS → const DeploymentUnits
- Scale constants the deployment owns rather than the SDK.
Properties
-
AdminCap
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- BUILDER_FEE_MULTIPLIER → BigInt
-
constants::builder_fee_multiplier— the builder's cut of the trading fee (10%).final -
BuilderCode
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
BuilderCodeCreated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
BuilderCodeKey
→ BcsType<
List, List> -
final
-
BuilderCodeSet
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
BuilderFeesClaimed
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
CadenceConfig
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
CadenceConfigUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
CapitalLocked
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
DeployableMarket
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
EwmaConfigUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ExpiryCashRebalanced
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ExpiryCashReceived
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ExpiryMarket
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ExpiryMarketMintPausedUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ExpiryProfitMaterialized
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- FEE_INCENTIVE_SUBSIDY_RATE → BigInt
-
constants::fee_incentive_subsidy_rate— sponsor share of a trader's mint fee (20%).final -
FeeIncentivesAllocated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
FeeIncentivesReturned
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
FeeIncentivesSponsored
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- FLOAT_SCALING → BigInt
-
math::float_scaling— 1e9 is 1.0 for every rate and probability here.final -
FlushExecuted
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
FlushRestarted
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
FrozenPricer
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
LiveOrderRedeemed
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- MAINNET_CONFIG → PredictConfig
-
Mainnet deployment constants, from the shared generated record.
final
-
MarketCreated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
MarketKey
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
MarketLifecycleCap
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
MarketManager
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
MarketSettled
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- MAX_BUILDER_FEE_RATE → BigInt
-
constants::max_builder_fee_rate— cap on the builder fee as a share of quantity (0.5%).final - MAX_QUANTITY_LOTS → BigInt
-
order::max_quantity_lots— the order ID's 32-bit lot field.final - MIN_PREMIUM → BigInt
-
constants::min_premium— a mint below this premium abortsEPremiumBelowMinimum.final -
NoTradeWindowUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
OrderMinted
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PauseCap
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PLP
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PlpFeeRatesUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PoolValuation
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PoolValuationCap
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PoolValuationProof
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PoolVault
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- POS_INF_TICK → BigInt
-
+inf sentinel tick: the upper bound of an UP range.
final
-
Position
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- POSITION_LOT_SIZE → BigInt
-
constants::position_lot_size— quantity is an integer number of these.final -
PositionKey
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PredictApp
→ BcsType<
List, List> -
final
-
PredictData
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
Pricer
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PricingConfigUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
PricingSVI
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ProtocolConfig
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ProtocolFrozenUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
RangePrice
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
RawSVI
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ReferenceTickSet
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
Registry
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
RequestCancelled
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
RequestLimitMissed
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
SettledOrderRedeemed
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- SHIPPED_FEE_POLICY → FeePolicy
-
The shipped template (
config_constantsdefaults): 10% Bernoulli fee, a 2.2% per-leg floor, a one-day ramp window that is inert at a 1.0 multiplier, a 1%–99% entry band, and inventory impact disabled. A market created under these values charges exactly this; one created after an admin change does not, which is why the per-market snapshot is the real answer. Verify against the deployment'sMarketCreatedbefore pricing money on it.final -
SnapshotStage
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
Strike
→ BcsType<
List, List> -
final
-
StrikeExposureTemplateConfigUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
SupplyFilled
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
SupplyRequested
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- TESTNET_CONFIG → PredictConfig
-
Testnet deployment constants, from the shared generated record.
final
- TESTNET_POSITION_LOT_SIZE → BigInt
-
Testnet's
position_lot_size, read from the deployment record. Validation uses the lot size of the config actually in play; this is the convenience constant for testnet callers.final -
TradingPausedUpdated
→ BcsType<
Map< String, dynamic> , dynamic> -
final
- U64_MAX → BigInt
-
The largest u64: the "no cap" sentinel the trade entrypoints take.
final
-
UnderlyingMarketConfig
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
UsdcAddedToPlp
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
ValuationStamp
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
WithdrawFilled
→ BcsType<
Map< String, dynamic> , dynamic> -
final
-
WithdrawRequested
→ BcsType<
Map< String, dynamic> , dynamic> -
final
Functions
-
activeExpiryMarkets(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return active expiry IDs for external PTB construction and pool inspection.
-
activeLiveExpiryCount(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the pre-expiry active count for SDK and devInspect capacity reads.
-
addUsdcToPlp(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Add USDC straight to pool idle liquidity without minting any PLP. Anyone may call it; the payment is an outright gift to the existing share base, so the caller receives nothing back and no share of it is recoverable.
-
admissionTickSize(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the admission-grid step for SDK and devInspect range construction.
-
allInCost(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the total quoted account withdrawal for SDK and devInspect consumers.
-
backingBufferLambda(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the snapshotted backing-buffer lambda for SDK and devInspect reads.
-
bernoulliFeeRate(
BigInt baseFee, BigInt probability) → BigInt -
strike_exposure_config::raw_bernoulli_fee_rate—base_fee · sqrt(p·(1−p)), the fee rate before themin_feefloor and the expiry ramp. Zero at the certain ends. -
binaryRangeTicks(
BigInt strikeRaw, Side side, BigInt tickSize) → RangeTicks -
Convert a raw binary-range strike to the
(lower_tick, higher_tick)pair themintentrypoint takes directly (there is no standalone packed range key). An UP order is(strike, +inf)→ lowerTick = strike/tickSize, higherTick = POS_INF_TICK; a DOWN order is(-inf, strike)→ lowerTick = 0 (neg-inf), higherTick = strike/tickSize. -
boardPricer(
PricerInputs inputs) → BoardPricer - Build a BoardPricer from a resolved snapshot (decimal forward + rolled SVI). Pure.
-
boundaryProbabilities(
PricerInputs pricer, double? lower, double? upper) → Boundaries -
Price a range's two boundaries with the local float pricer.
lower/upperare strikes in USD; pass null for an infinite side (lower: strike, upper: nullis an UP order,lower: null, upper: strikea DOWN order). Carries the pricer's ~1e-4 approximation. -
builderCodeId(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the sticky builder-code ID, if set.
-
builderFee(
BigInt fee, BigInt quantity, bool hasBuilderCode) → BigInt -
expiry_market::builder_fee_amount— an account carrying a builder code pays the builder a multiple of its trading fee, capped as a share of quantity. -
bumpVersionWatermark(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Advance the version floor to this package's compiled-in
current_version!(). -
cadenceAdmissionTickSize(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the admission-grid step for SDK and devInspect cadence reads.
-
cadenceConfig(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return deployment policy for SDK and devInspect market discovery.
-
cadenceConfigs(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return one underlying's complete deployment policy as a single coherent snapshot, for off-chain consumers (SDK and devInspect cadence discovery by the keeper, price updater, and dashboard) that would otherwise need one read per cadence. The vector holds one entry per supported cadence, indexed by cadence ID; disabled cadences are present as their all-zero configuration. Aborts if the underlying is not registered.
-
cadenceEnabled(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return whether this cadence is enabled for SDK and devInspect discovery.
-
cadenceInitialExpiryCash(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the initial expiry cash target for SDK and devInspect cadence reads.
-
cadenceMaxExpiryAllocation(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the expiry allocation cap for SDK and devInspect cadence reads.
-
cadenceTickSize(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the raw-price-per-tick factor for SDK and devInspect cadence reads.
-
cadenceWindowSize(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the rolling deployment horizon for SDK and devInspect cadence reads.
-
cancelSupplyRequest(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Cancel a still-pending supply request, refunding its escrowed USDC straight into
the requesting account.
accountmust be the request's recorded recipient. -
cancelWithdrawRequest(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Cancel a still-pending withdraw request, refunding its escrowed PLP straight
into the requesting account.
accountmust be the request's recorded recipient. -
cashBalance(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return expiry USDC custody for SDK and devInspect state reads.
-
claimableBuilderFees(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return visible USDC builder fees for SDK and devInspect reads.
-
claimAllBuilderFees(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Claims all settled USDC builder fees for the immutable owner; an empty accumulator returns a zero coin.
-
closeInventoryImpact(
FeePolicy policy, CloseBookTerms book, BigInt payout) → BigInt -
strike_exposure::live_close_inventory_impact— the rebate a live close ofpayoutreceives: the exact fall in the same potential. Zero at the shipped rate of zero. -
congestionPenaltyRate(
CongestionPolicy policy, CongestionState state, BigInt gasPrice) → BigInt -
ewma::penalty_fee's firing test, as a per-unit RATE:penalty_ratewhen the transaction's gas price is a high outlier against the market's pre-trade EWMA, else zero. It is a rate and not an amount because the surcharge israte · quantity, and a budget search has to reprice it at every candidate quantity.gasPriceis the raw reference gas price (not 1e9-scaled), astx_context::gas_pricereports it. - Create a derived shared BuilderCode for the caller and index.
-
Create the next deployable
ExpiryMarketfor one cadence on a Propbook underlying. -
Return live marked NAV as free expiry cash minus the exposure book's marked
liability, floored at zero. This read requires a market-bound pre-expiry
Pricer; an expired but unsettled market cannot be valued through this path. Public for PTB composition and devInspect pool valuation. -
decodeAccountsCreated(
PredictConfig cfg, DecodableTransactionResult result) → List< CreateManagerReceipt> -
All
AccountCreatedreceipts inresult. -
decodeBuilderCodeSets(
PredictConfig cfg, DecodableTransactionResult result) → List< BuilderCodeReceipt> -
All
BuilderCodeSetreceipts inresult. -
decodeClaims(
PredictConfig cfg, DecodableTransactionResult result) → List< ClaimReceipt> -
All
SettledOrderRedeemedreceipts inresult. -
decodeDeposits(
PredictConfig cfg, DecodableTransactionResult result) → List< BalanceChangeReceipt> -
All
Depositedreceipts inresult. -
decodeMints(
PredictConfig cfg, DecodableTransactionResult result) → List< MintReceipt> -
All
OrderMintedreceipts inresult. -
decodeMoveAbort(
ExecutionError? error) → PredictMoveError? -
Decode a gRPC
ExecutionErrorinto a PredictMoveError. -
decodeOrderRange(
BigInt orderId, {BigInt? lotSize}) → OrderRange -
Decode an order ID's range and quantity — the Dart mirror of
order::lower_tick/higher_tick/quantity. -
decodePlpCancels(
PredictConfig cfg, DecodableTransactionResult result) → List< PlpCancelReceipt> -
All
RequestCancelledreceipts inresult. -
decodePlpRequests(
PredictConfig cfg, DecodableTransactionResult result) → List< PlpRequestReceipt> -
All
SupplyRequested/WithdrawRequestedreceipts inresult. -
decodeRedeems(
PredictConfig cfg, DecodableTransactionResult result) → List< RedeemReceipt> -
All
LiveOrderRedeemedreceipts inresult. -
decodeWithdrawals(
PredictConfig cfg, DecodableTransactionResult result) → List< BalanceChangeReceipt> -
All
Withdrawnreceipts inresult. -
deriveAccountWrapperId(
PredictConfig cfg, String owner) → String -
The deterministic id of an owner's canonical account wrapper — no chain
read needed. The pure
(cfg, owner)form ofPredictClient.wrapperIdForfor contexts with no client instance. -
downProbability(
PricerInputs inputs, double strike) → double -
P(settle < strike) — the DOWN digital. Exactly
1 − up, matching the chain'srange_price(-inf, strike] = up(-inf) − up(strike) = 1 − up. -
entryProbability(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the quoted range probability for SDK and devInspect consumers.
-
exactlyOne<
T> (List< T> items, String what) → T -
Throw unless exactly one
whatreceipt was decoded; return it. The singular decoders use this; the plural forms return all matches (an integrator batching N actions in one PTB gets N receipts). -
expiry(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the expiry timestamp for SDK and devInspect market reads.
-
expiryFeeMaxMultiplier(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the snapshotted fee-ramp multiplier for SDK and devInspect reads.
-
expiryFeeMultiplier(
FeePolicy policy, BigInt timeToExpiryMs) → BigInt -
strike_exposure_config::expiry_fee_multiplier— 1.0 outside the window, rising linearly toexpiry_fee_max_multiplierat expiry. -
expiryFeeWindowMs(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the snapshotted fee-ramp window for SDK and devInspect reads.
-
expiryMarketId(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Resolve an expiry market ID for external discovery and PTB construction.
-
feeIncentiveBalance(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return local fee incentives for SDK and devInspect state reads.
-
feeIncentiveReserve(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return sponsor-funded fee reserves for SDK and devInspect state reads.
-
feeIncentiveSubsidy(
BigInt fee, BigInt feeIncentiveBalance) → BigInt -
expiry_market::fee_incentive_subsidy_amount— a sponsor pays part of the trader's MINT fee, bounded by the expiry's remaining sponsored balance. Mints only; redeems pay in full. -
finishFlush(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Finish a full-pool valuation and run the LP flush: prove every snapshotted market was valued exactly once, price the pool NAV, then drain the supply/withdraw queues at that frozen mark (mint PLP for supplies, burn PLP and pay USDC for withdrawals), release the valuation flag, retire the in-flight valuation, and return the LP-attributable pool-wide USDC NAV (frozen idle + Σ active NAV, net of the pending-protocol-profit exclusion priced from the frozen profit basis — every term as of the snapshot instant). Each drain fills only requests submitted before the flush's snapshot instant (the recorded queue cutoffs); younger requests wait for the next mark.
-
forward(
double pythSpot, double bsSpot, double bsForward) → double -
The forward the contract prices against: Pyth spot re-anchored by the
Block-Scholes basis (
spot · forward/bsSpot), falling back to the Block-Scholes forward when Pyth is absent. PasspythSpot <= 0to force the fallback. NOTE: on-chain this branch is also gated by the admin flaguse_pyth_spot_for_forward(default on) and a Pyth freshness window — when the flag is off or the Pyth spot is stale, the chain usesbsForward. If you track that config/freshness, apply it before calling (or useread.pricer, which gets the resolved forward from the chain). -
freezeProtocolPauseCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Force the protocol-wide emergency freeze via a valid
PauseCap. One-way; admin'sprotocol_config::set_frozenis needed to lift the freeze. -
frozen(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the global protocol-freeze state for SDK and devInspect reads.
-
generateAuth(
PredictConfig cfg) → TransactionResult Function(Transaction) -
Mint owner authority for the transaction sender. Owner authority is a
hot-potato
Authminted from the tx sender (ctxis implicit in a PTB) and consumed by the very next account-loading call (load_account_mutinsidedeposit_funds/withdraw_funds/mint/ …). It resolves to owner auth for whoever signs the transaction. -
generatePoolValuationProof(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Generate a transaction-local proof that
pool_valuation_capis currently allowlisted.plp::start_pool_valuationtakes the proof by value so a revoked cap cannot start a valuation. -
getConfig(
String network) → PredictConfig -
The recorded Predict config for
network('testnet'/'mainnet'). -
getDeployment(
String network) → DeploymentInfo -
Which deployment the ids on
networkcame from — its name and the deepbookv3 commit they were generated at. Useful when a bug report needs to say which on-chain deployment an SDK build was pinned to. -
getUnits(
String network) → DeploymentUnits -
Scale constants for
network— lot size, fixed-point scale, and coin decimals. Deployment-wide, so any subsystem formatting a custody balance can read them rather than hardcoding 6. -
hasPosition(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return whether an account holds a position for SDK and devInspect state reads.
-
higherUp(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
idleBalance(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return idle USDC for SDK and devInspect state reads.
-
index(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Returns the owner-selected derivation index for external discovery.
-
inspectReturns(
ReadClient client, Transaction tx, {String? sender}) → Future< List< List< >Uint8List> > -
Simulate a read-only PTB and return each command's BCS return values,
indexed
[commandIndex][returnValueIndex]. A sender is required to simulate; callers rarely have one for a pure read, so the zero address is the default. -
inventoryImpactCharge(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the separate inventory-impact charge for SDK and devInspect quote consumers.
-
inventoryImpactMaxRate(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return this market's immutable maximum marginal inventory-impact rate for SDK and devInspect state reads.
-
inventoryImpactPotential(
FeePolicy policy, BigInt liability) → BigInt -
strike_exposure::inventory_impact_potential_for_liability— the book-level potentialphi(L): marginal rate rising linearly toinventory_impact_max_rateover the scaleB, flat at the cap above it. Trades are charged the DIFFERENCE of two evaluations, which is what makes inventory cycles telescope to zero. -
inventoryImpactReserve(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the isolated inventory-impact escrow for SDK and devInspect state reads.
-
inventoryImpactScale(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the immutable USDC scale of this market's inventory-impact curve for SDK and devInspect state reads.
-
isPendingValuation(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Return whether this market is snapshotted into the in-flight flush and still
awaiting its
value_expiry. For SDK, keeper, and devInspect reads. It gates nothing: settlement and trading both run regardless — the frozen mark is settlement-invariant, so a stamped market settles the instant it expires. Do not defer a settlement attempt on this read. -
isSettled(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return whether terminal settlement has been recorded for this market. Public read for SDK/devInspect settlement-state checks.
-
liveOrderValue(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Return one live order's full-close range value before fees. Requires a
market-bound
Pricerand does not prove account ownership oforder_id. Public for SDK, PTB, and devInspect position valuation. -
loadLivePricer(
GeneratedConfig config, {required String expiryMarketId, required MarketFeeds feeds}) → TransactionResult Function(Transaction) -
Load a fresh
Pricerfrom the live oracle feeds. Every live-flow trade call (mint_*,redeem_live) borrows this&Pricerand it must be loaded first in the PTB. Deployed sigload_live_pricer(expiry_market.move): market, config, propbook_registry (&OracleRegistry), pyth, bs_values, bs_svi, clock (auto-injected).configandpropbook_registryare supplied by the config slice, not named here. -
lockCapital(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Bootstrap the pool exactly once: permanently lock
paymentUSDC of minimum liquidity. Mints matching PLP (1:1) into the book's locked balance — never withdrawable, so the caller receives no shares — and joins the USDC into idle. This keepstotal_supply > 0while the vault exists and gives rounding dust a non-withdrawable PLP holder. Requires root authority and zero existing supply. Supply, withdrawal, and flush flows remain disabled until the locked liquidity has been created. -
lowerUp(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
mintCost(
MintCostInputs inputs) → MintCost -
All-in cost of minting an exact payout quantity — the
mint_exact_quantityshape, priced entirely client-side. Mirrorscompute_mint_quote, including its admission checks: the entry-probability band on each finite leg and on the range, themin_premiumfloor, the lot grid, and theall_in_cost <= quantitybound (a contract may never cost more than it can pay out). Each violation throws the PredictInputError naming the abort the chain would have raised. -
mintCostForBudget(
MintBudgetInputs inputs) → MintBudgetCost -
A fill whose ALL-IN cost fits a budget —
expiry_market::mint_exact_costcomputed client-side, with the same lot search over the same cost function, so the answer is the quantity that entrypoint would size and the cost it would debit. -
mintExactAmount(
GeneratedConfig config, {required String expiryMarketId, required String wrapperId, required BigInt lowerTick, required BigInt higherTick, required BigInt maxPremiumRaw, required BigInt minQuantityRaw, BigInt? maxCostRaw, required MarketFeeds feeds}) → MoveCallBuilder -
Mint by spending up to
maxPremiumRaw(raw quote units), enforcing aminQuantityRawfloor on the position received and amaxCostRawall-in ceiling, returning the new order id (u256). Command order is pricer → auth → mint. Deployed sigmint_exact_amount. -
mintExactCost(
GeneratedConfig config, {required String expiryMarketId, required String wrapperId, required BigInt lowerTick, required BigInt higherTick, required BigInt maxCostRaw, required BigInt minQuantityRaw, required MarketFeeds feeds}) → MoveCallBuilder - Mint within an all-in budget, including fees, using the v2 entrypoint.
-
mintExactQuantity(
GeneratedConfig config, {required String expiryMarketId, required String wrapperId, required BigInt lowerTick, required BigInt higherTick, required BigInt quantityRaw, BigInt? maxCostRaw, BigInt? maxProbabilityRaw, required MarketFeeds feeds}) → MoveCallBuilder -
Mint a position of an exact
quantityRaw, capped by cost/probability ceilings, returning the new order id (u256). Command order is pricer → auth → mint (auth is a hot potato consumed by this call).maxCostRaw/maxProbabilityRawdefault to U64_MAX (no slippage cap). Deployed sigmint_exact_quantity. -
mintInventoryImpact(
FeePolicy policy, MintBookTerms book, BigInt quantity) → BigInt -
strike_exposure::mint_range_inventory_impact— the charge a mint ofquantityover a range pays: the exact rise in the book potential. Zero at the shipped rate of zero. -
mintLifecycleCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Mint a version-gated
MarketLifecycleCapwith market-creation authority. -
mintPauseCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Mint a new
PauseCap. This bypasses the version gate so emergency pause authority remains available from a package version below the runtime floor. -
mintPaused(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the market mint-pause state for SDK and devInspect reads.
-
mintPoolValuationCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Mint a version-gated
PoolValuationCapwith authority to start the full-pool valuation. -
noTradeWindowMs(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Window before expiry in which live quotes, mints, and live redeems abort.
publicfor SDK and devInspect reads: a client that cannot see this value can only learn the window closed by decodingETradeWindowClosedfrom a failed quote. -
orderStrikes(
OrderRange range, BigInt tickSizeRaw) → ({double? lower, double? upper}) -
The strikes an OrderRange prices against, in USD, with null for each
infinite side — the shape boundaryProbabilities takes.
tickSizeRawis the market's raw tick size. -
owner(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Returns the immutable owner authorized to claim fees.
-
pauseExpiryMarketMintPauseCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Force
mint_paused = trueon a single expiry market via a validPauseCap. One-way; admin'sexpiry_market::set_mint_pausedis needed to unpause. -
pauseTradingPauseCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Force
trading_paused = truevia a validPauseCap. One-way. -
payoutLiability(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return payout reserve or settled liability for external accounting observability.
-
penaltyFee(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the quoted EWMA congestion surcharge for SDK and devInspect consumers.
-
pendingProtocolProfit(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return deferred protocol profit for external accounting observability.
-
plpTotalSupply(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return total PLP supply for SDK and devInspect state reads.
- Return the quoted premium for SDK and devInspect consumers.
-
priceToRaw(
Object v) → BigInt - USD price (9-decimal raw) human → raw.
-
probability(
PricerInputs inputs, double strike, String side) → double -
Binary probability at
strikefor the given side ('up'= P(>strike),'down'= 1 − up). -
probabilityToRaw(
double p) → BigInt -
Probability in
[0, 1]→ raw 1e9. -
profitBasisCredits(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the profit-basis credits for external accounting observability.
-
profitBasisDebits(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the profit-basis debits for external accounting observability.
-
propbookUnderlyingId(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the Propbook underlying for SDK and devInspect market reads.
-
protocolReserveBalance(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return protocol-owned USDC for SDK and devInspect state reads.
-
quantity(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the sized quantity for SDK and devInspect quote consumers.
-
quoteMint(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Quote the all-in cost of a mint request for an anonymous taker (no builder code)
without mutating any market state. Exact-quantity mode uses
min_quantity; budget mode conservatively sizes a lot-rounded fill undermax_premium. The quote applies live-mint and admission gates but does not preflight account balance, slippage caps, or exposure-index capacity. Its penalty uses the current pre-update EWMA state. Public for SDK and devInspect pre-trade pricing. -
quoteMintExactCostForAccount(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Quote
mint_exact_costfor one account: the fill that mint would size formax_cost, capped by total account balance including unsettled accumulator funds, with that fill's cost decomposition. Applies the mint's live-mint gates, sizing,min_quantityfloor, and admission, but does not preflight exposure-index capacity or cash backing.quantityis the figure to derive amin_quantityslippage floor from. Public for SDK and devInspect pre-trade pricing. -
quoteMintForAccount(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Quote the all-in cost of a mint request for one account, reading its builder code. Budget mode caps premium by total account balance, including unsettled accumulator funds. Public for SDK and devInspect pre-trade pricing.
-
rangePrice(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Return both boundary probabilities for
(lower, higher]. Useprobability()for the combined range probability; absent boundaries are infinite sentinels. -
rangeProbability(
PricerInputs inputs, double lower, double higher) → double -
Probability mass in
(lower, higher], floored at 0 (matchescompute_range_price's saturating subtraction). Uselower <= 0for the −∞ bound andhigher = double.infinityfor +∞. -
rangeProbabilityRaw(
Boundaries boundaries) → BigInt -
pricing::probability— the range's own probability,up(lower) − up(higher)with the chain's saturating subtraction and its infinite-boundary defaults. -
rawToPrice(
BigInt raw) → double - USD price raw → human (display).
-
rawToProbability(
BigInt raw) → double -
Raw 1e9 probability →
[0, 1]double (display). -
rawToUsdc(
BigInt raw) → double - USDC raw → human (display).
-
rebalanceExpiryCash(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Move cash between pool idle liquidity and one expiry market.
-
redeemLive(
GeneratedConfig config, {required String expiryMarketId, required String wrapperId, required BigInt orderId, required BigInt closeQuantityRaw, BigInt? minProbabilityRaw, BigInt? minProceedsRaw, required MarketFeeds feeds}) → MoveCallBuilder -
Owner-authorized redeem of a live (not-yet-settled) position: close
closeQuantityRawoforderIdat the live pricer's mark, enforcing close-side slippage floors (minProbabilityRaw/minProceedsRaw, default 0 = uncapped). ReturnsOption<u256>: the replacement order id when a partial close leaves quantity open, else none. Command order is pricer → auth → redeem. Deployed sigredeem_live. -
redeemLiveProceeds(
RedeemLiveInputs inputs) → RedeemLiveProceeds -
Net proceeds of closing a live position —
expiry_market::redeem_live's payment decomposition, client-side. The mirror of mintCost: the same per-boundary trading fee and builder fee, the same congestion surcharge, and the inventory-impact term as a REBATE rather than a charge. There is no sponsor subsidy on a close (incentives subsidise mints only), and each deduction is clamped at the payout remaining after the ones before it, exactly as the contract clamps them, so a close can never cost more than it releases. -
redeemSettled(
GeneratedConfig config, {required String expiryMarketId, required String wrapperId, required BigInt orderId}) → MoveCallBuilder -
Owner-authorized redeem of a settled position: closes
orderIdIN FULL against the recorded settlement price (the deployed entrypoint takes no quantity — a settled claim is all-or-nothing). No live pricer (settlement price is fixed); auth is consumed by the call. Deployed sigredeem_settled(owner-auth form). The keeper-facingredeem_settled_permissionlessis a separate entrypoint, out of scope for this SDK. -
redeemSettledPermissionless(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Permissionlessly redeem a settled order without account-owner authority.
-
referenceTick(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the admitted reference tick for SDK and devInspect range construction.
-
referenceTickSourceTimestampMs(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the reference observation timestamp for SDK and devInspect reads.
-
referralFeeRate(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the live referral fee rate for SDK and devInspect reads.
-
registerUnderlying(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Record admin approval of one Propbook underlying. Source IDs and canonical oracle object IDs remain owned by Propbook; this row only gates which underlyings Predict will build markets on and stores deployment watermarks.
-
requestSupply(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Queue a supply request: pull
amountUSDC from account custody into queue escrow, recording the account's receive address as the fill recipient. The pull auto-settles any flush-delivered USDC first. The flush charges the protocol's supply fee — zero by default — on the USDC it takes in and prices shares on the remainder, somin_plp_outis measured after that fee. The account receives minted PLP only at a mark that mints at leastmin_plp_outfor the wholeamount— a price floor, not a promise of that many shares: if the pool cap leaves room for only part of the deposit, the fill is proportionally smaller at the same price and the remainder stays queued with its limit rescaled. At the shipped attempt count of one, a flush whose mark quotes less cancels and refunds the request there and then; a higher configured count lets it rest and retry that many flushes first. Returns the queue index, the handle used to cancel before the flush. -
requestWithdraw(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Queue a withdraw request: pull
amountPLP shares from account custody into queue escrow, recording the account's receive address as the fill recipient. The pull auto-settles any flush-delivered PLP first. The flush withholds the protocol's withdraw fee from the marked payout, somin_usdc_outis measured after the fee. The account is paid only at a mark that quotes at leastmin_usdc_outfor the wholeamount— a price floor, not a promise of that much USDC: if idle liquidity covers only part of the payout, only the shares idle affords are burned, the fill is proportionally smaller at the same price, and the remainder stays queued with its limit rescaled. At the shipped attempt count of one, a flush whose mark quotes less cancels and refunds the request there and then; a higher configured count lets it rest and retry that many flushes first. Returns the queue index used to cancel before the flush. -
requiredCash(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return required expiry cash for external accounting observability.
-
revokeLifecycleCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Revoke a
MarketLifecycleCapby ID without applying the version gate. -
revokePauseCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Revoke a previously minted
PauseCapby ID. Admin-only. -
revokePoolValuationCap(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Revoke a
PoolValuationCapby ID without applying the version gate. -
rollDown(
Svi svi, double remainingMs, double anchorTteMs) → Svi -
Roll
aandbdown by the fraction of anchored time remaining, matching the chain'sroll_down_svi(variance decays toward expiry).remainingMs= expiry − now;anchorTteMs= expiry − the SVI observation's providersvi_timestamp(its per-update source timestamp) — the same clock the freshness gate accepts, and what the chain anchors on. Anchoring on the batch's ingestion time instead rolls by the wrong fraction.read.priceravoids the question entirely (the chain has already rolled).rho,m,sigmaare unchanged. Feed an UNrolled provider surface; the result is what upProbability expects. -
sealValuationSnapshot(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Close the snapshot stage once every expected market has a frozen pricer, and freeze the vault-side figures — idle, the profit basis, the pending protocol cut — completing the snapshot.
-
setBlockScholesPriceFreshnessMs(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the live Block Scholes spot/forward freshness threshold.
-
setBlockScholesSviFreshnessMs(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the live Block Scholes SVI freshness threshold.
-
setBuilderCode(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set sticky builder-code attribution for future trades using valid account auth. Owner auth and authorized-app auth both satisfy the account borrow boundary.
-
setEwmaEnabled(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Enable or disable the EWMA gas-price penalty.
-
setEwmaParams(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the EWMA gas-price penalty parameters.
-
setFrozen(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the protocol-wide emergency freeze.
-
setLpRequestLimitFlushAttempts(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Set how many frozen-mark attempts a queued LP request gets before it is
cancelled and refunded.
1is fill-or-kill. Raising it lets a request rest at the head across flushes, which stops that queue each time it misses — see RP-12 for the liveness cost that buys. -
setMaxLpPoolValue(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the ceiling on LP-attributable pool value that queued supplies may raise the pool to. A supply that would carry the pool past it is filled up to the cap at the flush and its remainder stays queued; withdrawals and already-issued PLP are unaffected, so lowering this below current pool value closes the pool to new capital rather than forcing anyone out.
-
setMaxValuationWindowMs(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set how long a started full-pool valuation may stay in flight before anyone may discard it. A stalled flush costs LP-fill latency (and settlement latency for its own market set), not a trading pause, so this is an operator liveness knob: too short and a legitimate long flush can be discarded from under the keeper, too long and an abandoned one delays queued LP fills for that duration. See RP-29.
-
setMintPaused(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Set whether new mints are paused on this expiry market. Admin-only and
version-gated. A
PauseCapholder can force-engage the pause one-way under a version freeze viaregistry::pause_expiry_market_mint_pause_cap. -
setNoTradeWindowMs(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Set the window before expiry in which live quotes, mints, and live redeems
abort.
0disables the block. Read live at trade time, so a change applies to markets already trading and stays available as an incident control. -
setPlpSupplyFeeRate(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the fee charged on executed PLP supply fills. Admin-gated and validated against its config-constants envelope. Locked during valuation so the rate a flush froze into its mark cannot change midway through that flush.
-
setPlpWithdrawFeeRate(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the fee charged on executed PLP withdraw fills. Same gating as the supply leg; the two are independent so the exit charge can move without taxing entry.
- Set the protocol reserve profit share used when materializing aggregate expiry profit. Admin-gated; validated against its config-constants envelope.
-
setPythSpotFreshnessMs(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the live Pyth spot freshness threshold.
-
setReferenceTick(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Set this expiry's reference fine-grid tick from the exact previous-window
Propbook Pyth observation. The source observation must be inserted into the feed
at
reference_tick_source_timestamp_msbefore this call, and the normalized spot is floored to the market'stick_size. Not gated on the valuation lock: the reference tick shapes mint admission only, and a mint it admits mid-flush is invisible to the captured snapshot like any other. -
setReferralFeeRate(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the portion of referred mint fees routed to the referrer. The new rate applies to subsequent mints without changing their all-in account withdrawal.
-
setTemplateBackingBufferLambda(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the backing-buffer lambda snapshotted by newly created expiry markets.
-
setTemplateBaseFee(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the base fee multiplier snapshotted by newly created expiry markets.
-
setTemplateCadenceConfig(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set all deployment terms for one underlying's cadence. Passing zero for all five values disables the cadence; otherwise all values must be nonzero and valid.
-
setTemplateExpiryFeeMaxMultiplier(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the expiry-fee max multiplier snapshotted by newly created expiry markets.
-
setTemplateExpiryFeeWindowMs(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the expiry-fee ramp window snapshotted by newly created expiry markets.
-
setTemplateInventoryImpactMaxRate(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Set the maximum marginal inventory-impact rate snapshotted by newly created
expiry markets.
0(the default) disables both charges and rebates. -
setTemplateMaxEntryProbability(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the maximum raw entry probability snapshotted by newly created expiry markets.
-
setTemplateMinEntryProbability(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the minimum raw entry probability snapshotted by newly created expiry markets.
-
setTemplateMinFee(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set the minimum fee floor snapshotted by newly created expiry markets.
-
settledOrderPayout(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Return one settled order's terminal payout. This function does not prove account
ownership of
order_id. Public for SDK, PTB, and devInspect position valuation. -
settlementPrice(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the recorded settlement price. Aborts if the market is not settled.
-
setTradingPaused(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Set whether trading is paused.
-
setUsePythSpotForForward(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Select which source the live forward is built from:
truecarries the Block Scholes basis on a fresh Pyth spot,falseuses the Block Scholes forward directly. Locked during valuation so one flush marks every market on one formula. -
simulateWithEvents(
ReadClient client, Transaction tx, String sender) → Future< List< Event> > -
Simulate a full transaction (typically one built by a
tx.*builder) and return the events it would emit — the quote path: dry-run the real action, decode the receipt.sendermust be the acting owner so account auth resolves. Throws the same typed errors the real execution would surface. -
snapshotExpiryPricer(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Freeze one snapshotted market's oracle state for this flush and stamp the market, capturing its cash rows and activating its payout-tree snapshot at this instant.
-
sponsorFeeIncentives(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Sponsor taker fee incentives with USDC. Anyone may contribute; the payment joins a pool-level reserve that is excluded from PLP NAV and later allocated to expiry markets by the normal rebalance flow.
-
sqrtDown(
BigInt x) → BigInt -
math::sqrt_down— square root of a 1e9-scaled value, 1e9-scaled, rounded down. -
startPoolValuation(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Begin a full-pool valuation using a registry-issued pool-valuation proof. The
proof grants control over when current oracle state is frozen for queued LP
fills. Starting engages the cross-transaction valuation flag, snapshots the
active expiry set and each LP queue's eligibility cutoff, and opens the atomic
snapshot stage: freeze every active market's pricer under the returned
SnapshotStage, then seal it in the same transaction. -
strikeAtProbability(
PricerInputs inputs, double p) → double? -
Strike where P(settle > strike) =
p, by bisection (UP is monotone-decreasing in strike). Null when no crossing exists within ±64% of forward. -
strikeFromTick(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Convert a boundary tick to its raw strike, including the open-end sentinels.
Non-sentinel ticks multiply directly by
tick_size; public PTB and devInspect callers are responsible for supplying the intended market domain. -
supplyRequestsPending(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return pending LP supply count for SDK and devInspect queue reads.
-
tickSize(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Return the strike tick size for SDK and devInspect range construction. Raw
strikes are
tick * tick_size. -
toGeneratedConfig(
PredictConfig cfg) → GeneratedConfig - Project a PredictConfig onto the flat GeneratedConfig slice.
-
tradingFee(
FeePolicy policy, Boundaries boundaries, BigInt quantity, BigInt timeToExpiryMs) → BigInt -
strike_exposure_config::trading_fee— the fee for a whole range, charged PER FINITE BOUNDARY with each leg floored and ramped independently. A binary order has one finite boundary and pays one leg; a two-sided range pays two, so it is not the same fee as the range's own probability would suggest. -
tradingPaused(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return the global trading-pause state for SDK and devInspect reads.
-
trySettle(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Settle from Propbook's exact positive Pyth spot at expiry, or from the exact Block Scholes minute-boundary spot when Pyth remains unavailable after the compiled grace period. Permissionless and idempotent; missing or unusable observations leave the market unsettled.
-
trySettlementPrice(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Return the recorded settlement price, or
nonewhile the market is live. Non-aborting companion tosettlement_pricefor SDK/devInspect reads. -
unsetBuilderCode(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Clear sticky builder-code attribution using valid owner or authorized-app auth.
-
upPrice(
{required dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Return the current UP digital probability for a typed strike. Public PTB and
devInspect reads can compose it with a transaction-local
Pricer. -
upProbability(
PricerInputs inputs, double strike) → double -
P(settle > strike) — the UP digital, with the SVI skew correction.
inputs.sviis the already-rolled surface (no roll-down applied here).strikeshares units withinputs.forward. Returns a probability in[0, 1]. -
usdcToRaw(
Object v) → BigInt - USDC (6-decimal) human → raw.
-
valuationInProgress(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return whether a full-pool valuation is in flight, for SDK and devInspect reads. The flush spans transactions, so "in flight" is an observable state: a keeper reads it to notice a flush it must finish or discard, and an integrator reads it to explain a gated keeper/config transaction. Trading is not gated on it.
-
valueExpiry(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder -
Fold one snapshotted market's SNAPSHOT-INSTANT NAV into the running total. A
market frozen as settled is swept and contributes 0; one frozen with a pricer is
valued via
expiry_market::snapshot_navover its captured cash and tree shadows, then has its stamp cleared (releasing the tree snapshot), so later trades and the next flush start clean. -
withAuth(
GeneratedConfig config, MoveCallBuilder build(TransactionResult auth)) → MoveCallBuilder -
Every owner-authorized call in this SDK is the same two commands — mint
the hot-potato
Auth, then make the generated call that consumes it. This lifts a generated-call closure into that pair:buildreceives the minted auth handle and returns the one call consuming it. Mirrors the officialwithAuth(which lifts at the type level; Dart lifts at the call site). -
withdrawRequestsPending(
{dynamic arguments, String? package, Map< String, dynamic> ? config}) → MoveCallBuilder - Return pending LP withdrawal count for SDK and devInspect queue reads.
Typedefs
-
GeneratedConfig
= Map<
String, dynamic> -
The flat config slice the generated bindings resolve
config:against, projected from the nested public PredictConfig. Each generated call declares only the keys it consumes, so a single map carrying all of them satisfies every call site. - PredictConfig = PredictIds
-
Everything a tx builder or read needs to address a Predict deployment on
one network — the deployment record's Predict slice, used directly (the
official
PredictConfiginterface is the same shape the record carries). - ReadClient = GrpcCoreClient
-
The Sui client surface Predict reads through. The Dart SDK's core client
is the gRPC one; it provides both the
simulateTransactionthe reads/quotes sit on and the object reads position enumeration needs. - Side = String
-
A binary position's side. The official SDK types this
'up' | 'down'(with'range'as the range-descriptor arm); Dart keeps the string form so descriptors stay JSON/UI friendly — invalid values are rejected at runtime exactly like the official guard. - UnderlyingConfig = UnderlyingIds
- Per-underlying oracle wiring: the propbook underlying id plus the feed object ids the live pricer reads.
Exceptions / Errors
- ConfigurationError
- Thrown when configuration is invalid or missing.
- DeepBookError
- Base class for DeepBook errors.
- PredictInputError
- A caller-supplied argument the SDK rejected before building/sending a tx.
- PredictMoveError
-
A Move
abortdecoded from a simulate/read failure. - ValidationError
- Thrown when transaction validation fails.