Predict
The Predict shared object is the main protocol entry point. It coordinates user actions across manager balances, oracle state, pricing config, risk config, and vault accounting.
API
Following are the public functions that applications use most often.
Create a PredictManager
The create_manager() function creates a new shared PredictManager for the caller and returns its object ID.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Preview binary position amounts
The get_trade_amounts() function returns the mint cost and redeem payout for a binary position at the requested quantity.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Mint a binary position
The mint() function buys a binary position using an enabled quote asset deposited in the caller's PredictManager.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Redeem a binary position
The redeem() function sells a binary position and deposits the payout back into the owner's PredictManager.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Redeem a settled binary position permissionlessly
The redeem_permissionless() function lets anyone redeem a settled position into the owner's PredictManager.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Preview range amounts
The get_range_trade_amounts() function returns the mint cost and redeem payout for a vertical range at the requested quantity.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Mint a vertical range
The mint_range() function buys a bounded range position. The range is keyed by oracle ID, expiry, lower strike, and higher strike.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Redeem a vertical range
The redeem_range() function sells a range position and deposits the payout into the owner's PredictManager.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Supply vault liquidity
The supply() function deposits an accepted quote asset into the vault and returns PLP shares.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Withdraw vault liquidity
The withdraw() function burns PLP shares and returns the selected quote asset when the requested amount is available after max payout coverage.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Compact settled oracle exposure
The compact_settled_oracle() function lets an authorized oracle operator compact settled strike-matrix exposure into constant-size settled state.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Read protocol configuration
These read functions expose trading pause state, accepted quote assets, pricing parameters, risk limits, ask bounds, and currently available withdrawal amount.
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Events
Trading events
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Liquidity events
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.Configuration events
packages/predict/sources/predict.move. You probably need to run `pnpm prebuild` and restart the site.