@mysten/deepbook-v3 2.3.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/PREDICT.md +149 -55
- package/README.md +18 -13
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_events.d.mts.map +1 -1
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/account.d.mts.map +1 -1
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/balances.d.mts.map +1 -1
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/admin.d.mts +27 -0
- package/dist/contracts/deepbook_predict/admin.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/admin.mjs +38 -0
- package/dist/contracts/deepbook_predict/admin.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code.d.mts +81 -0
- package/dist/contracts/deepbook_predict/builder_code.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code.mjs +103 -0
- package/dist/contracts/deepbook_predict/builder_code.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +25 -0
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code_events.mjs +7 -1
- package/dist/contracts/deepbook_predict/builder_code_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.d.mts +104 -0
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/config_events.mjs +155 -0
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/ewma_config.mjs +28 -0
- package/dist/contracts/deepbook_predict/ewma_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +859 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.mjs +647 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs +51 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.d.mts +159 -0
- package/dist/contracts/deepbook_predict/market_manager.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.mjs +88 -2
- package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.d.mts +101 -0
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/order_events.mjs +7 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/pause_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pause_cap.mjs +51 -0
- package/dist/contracts/deepbook_predict/pause_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/plp.d.mts +801 -0
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/plp.mjs +458 -1
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs +52 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.d.mts +90 -0
- package/dist/contracts/deepbook_predict/predict_account.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.mjs +24 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.d.mts +127 -0
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pricing.mjs +25 -1
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing_config.mjs +28 -0
- package/dist/contracts/deepbook_predict/pricing_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +665 -0
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/protocol_config.mjs +841 -0
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.d.mts +30 -0
- package/dist/contracts/deepbook_predict/range_codec.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.mjs +6 -1
- package/dist/contracts/deepbook_predict/range_codec.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/registry.d.mts +382 -0
- package/dist/contracts/deepbook_predict/registry.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/registry.mjs +456 -1
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.d.mts +199 -0
- package/dist/contracts/deepbook_predict/vault_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/vault_events.mjs +19 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.d.mts +22 -22
- package/dist/predict/client.d.mts +3 -2
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +3 -2
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/index.d.mts +18 -1
- package/dist/predict/index.mjs +18 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginRegistry.d.mts +16 -16
- package/package.json +2 -2
- package/src/predict/client.ts +3 -2
- package/src/predict/index.ts +26 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plp.mjs","names":["vec_map.VecMap","pricing.FrozenPricer","balance.Balance","lp_book.LpBook","pool_accounting.Ledger"],"sources":["../../../src/contracts/deepbook_predict/plp.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * PLP token and pool vault.\n *\n * PoolVault owns the PLP treasury cap, idle USDC, the protocol reserve,\n * sponsor-funded fee incentives, per-expiry cash accounting, and the queued LP\n * supply/withdraw requests. It coordinates the full-pool NAV valuation — an atomic\n * oracle snapshot followed by resumable per-market valuation transactions, with\n * trading live throughout (see `PoolValuation`) — and the unified per-market cash\n * flow (initial funding, live rebalance/sweep, and settled-market sweep with\n * terminal profit materialization). LPs queue supply/withdraw requests routed\n * through a loaded Account; each flush (`finish_flush`) drains the requests that\n * predate its snapshot at the frozen pool NAV, minting/burning PLP and delivering\n * fills to each account via the balance accumulator.\n */\n\nimport {\n\tMoveStruct,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n\ttype ConfigValue,\n} from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U64 } from '../../bcs/integers.js';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nimport * as vec_map from './deps/sui/vec_map.js';\nimport * as pricing from './pricing.js';\nimport * as balance from './deps/sui/balance.js';\nimport * as lp_book from './lp_book.js';\nimport * as pool_accounting from './pool_accounting.js';\nconst $moduleName = '@local-pkg/deepbook_predict::plp';\nexport const PLP = new MoveStruct({\n\tname: `${$moduleName}::PLP`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const PoolValuationProof = new MoveStruct({\n\tname: `${$moduleName}::PoolValuationProof`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const SnapshotStage = new MoveStruct({\n\tname: `${$moduleName}::SnapshotStage`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const PoolValuation = new MoveStruct({\n\tname: `${$moduleName}::PoolValuation`,\n\tfields: {\n\t\t/** Active expiry markets snapshotted at start; every one must be valued. */\n\t\texpected_expiry_markets: bcs.vector(bcs.Address),\n\t\t/** Markets valued so far this flush; folded against `expected` at finish. */\n\t\tvalued_expiry_markets: bcs.vector(bcs.Address),\n\t\t/** Running Σ of each valued market's snapshot NAV (settled markets contribute 0). */\n\t\ttotal_nav: U64,\n\t\t/**\n\t\t * Oracle state frozen during the snapshot stage, one entry per expected market.\n\t\t * Keyed by market id so a `Pricer` can never be applied to the wrong market.\n\t\t * `none` marks a market that was already settled at snapshot time and therefore\n\t\t * contributes 0. This map is what makes the valuation stage deterministic: it\n\t\t * decides both the mark AND the sweep-vs-value branch, so no later transaction's\n\t\t * clock or oracle state can change a market's contribution.\n\t\t */\n\t\tfrozen_pricers: vec_map.VecMap(bcs.Address, bcs.option(pricing.FrozenPricer)),\n\t\t/**\n\t\t * Set by `seal_valuation_snapshot`; no market may be valued before it. Nothing may\n\t\t * be snapshotted after it because sealing consumes the `SnapshotStage`.\n\t\t */\n\t\tsealed: bcs.bool(),\n\t\t/** Clock time the flush was started, for the stuck-flush deadline. */\n\t\tstarted_at_ms: U64,\n\t\t/**\n\t\t * Drain budgets committed at start (the cap owner's choice), bounding how many\n\t\t * requests each queue processes at finish. Committing them here — not at finish —\n\t\t * is what lets `finish_flush` run permissionless: a stranger may complete a flush\n\t\t * but only ever drains at these budgets, so completion can help LPs, never starve\n\t\t * them by finishing with a zero budget.\n\t\t */\n\t\tsupply_budget: bcs.option(U64),\n\t\twithdraw_budget: bcs.option(U64),\n\t\t/**\n\t\t * Each LP queue's `next_index` at the snapshot instant: the drain fills only\n\t\t * requests indexed strictly below these, so nobody can watch the frozen mark form\n\t\t * and then submit against a price they already know is stale.\n\t\t */\n\t\tsupply_request_cutoff: U64,\n\t\twithdraw_request_cutoff: U64,\n\t\t/**\n\t\t * Vault-side figures captured by `seal_valuation_snapshot`. With every market's\n\t\t * cash frozen in its stamp and these frozen here, the mark is a pure function of\n\t\t * the snapshot instant: no in-window cash move — maintenance, settled sweep,\n\t\t * market funding, reserve realization — can reach it. Settled members are swept\n\t\t * during the snapshot stage, so their recoverable cash sits inside\n\t\t * `frozen_idle_balance`.\n\t\t */\n\t\tfrozen_idle_balance: U64,\n\t\tfrozen_profit_basis_credits: U64,\n\t\tfrozen_profit_basis_debits: U64,\n\t\tfrozen_pending_protocol_profit: U64,\n\t},\n});\nexport const PoolVault = new MoveStruct({\n\tname: `${$moduleName}::PoolVault`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\t/**\n\t\t * Protocol-owned USDC excluded from PLP redemption. No package entrypoint\n\t\t * withdraws this balance.\n\t\t */\n\t\tprotocol_reserve_balance: balance.Balance,\n\t\t/** Sponsor-funded USDC reserved for taker fee sponsorship, excluded from PLP NAV. */\n\t\tfee_incentive_reserve: balance.Balance,\n\t\t/** PLP share issuance plus queued supply/withdraw escrow. */\n\t\tlp: lp_book.LpBook,\n\t\t/** Idle USDC custody, registered expiries, and per-expiry cash-flow rows. */\n\t\texpiry_accounting: pool_accounting.Ledger,\n\t\t/**\n\t\t * In-flight full-pool valuation, held across transactions. `Some` exactly while\n\t\t * the `ProtocolConfig` valuation flag is engaged.\n\t\t */\n\t\tvaluation: bcs.option(PoolValuation),\n\t},\n});\nexport interface IdArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface IdOptions {\n\tpackage?: string;\n\targuments?: IdArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the pool vault object ID for external discovery and PTB construction. */\nexport function id(options: IdOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'id',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface IdleBalanceArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface IdleBalanceOptions {\n\tpackage?: string;\n\targuments?: IdleBalanceArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return idle USDC for SDK and devInspect state reads. */\nexport function idleBalance(options: IdleBalanceOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'idle_balance',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ProtocolReserveBalanceArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ProtocolReserveBalanceOptions {\n\tpackage?: string;\n\targuments?: ProtocolReserveBalanceArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return protocol-owned USDC for SDK and devInspect state reads. */\nexport function protocolReserveBalance(options: ProtocolReserveBalanceOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'protocol_reserve_balance',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface FeeIncentiveReserveArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface FeeIncentiveReserveOptions {\n\tpackage?: string;\n\targuments?: FeeIncentiveReserveArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return sponsor-funded fee reserves for SDK and devInspect state reads. */\nexport function feeIncentiveReserve(options: FeeIncentiveReserveOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'fee_incentive_reserve',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface PlpTotalSupplyArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface PlpTotalSupplyOptions {\n\tpackage?: string;\n\targuments?: PlpTotalSupplyArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return total PLP supply for SDK and devInspect state reads. */\nexport function plpTotalSupply(options: PlpTotalSupplyOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'plp_total_supply',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface SupplyRequestsPendingArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface SupplyRequestsPendingOptions {\n\tpackage?: string;\n\targuments?: SupplyRequestsPendingArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return pending LP supply count for SDK and devInspect queue reads. */\nexport function supplyRequestsPending(options: SupplyRequestsPendingOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'supply_requests_pending',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface WithdrawRequestsPendingArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface WithdrawRequestsPendingOptions {\n\tpackage?: string;\n\targuments?: WithdrawRequestsPendingArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return pending LP withdrawal count for SDK and devInspect queue reads. */\nexport function withdrawRequestsPending(options: WithdrawRequestsPendingOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'withdraw_requests_pending',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ActiveExpiryMarketsArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ActiveExpiryMarketsOptions {\n\tpackage?: string;\n\targuments?: ActiveExpiryMarketsArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return active expiry IDs for external PTB construction and pool inspection. */\nexport function activeExpiryMarkets(options: ActiveExpiryMarketsOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'active_expiry_markets',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ActiveLiveExpiryCountArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ActiveLiveExpiryCountOptions {\n\tpackage?: string;\n\targuments?: ActiveLiveExpiryCountArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the pre-expiry active count for SDK and devInspect capacity reads. */\nexport function activeLiveExpiryCount(options: ActiveLiveExpiryCountOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'active_live_expiry_count',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ProfitBasisDebitsArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ProfitBasisDebitsOptions {\n\tpackage?: string;\n\targuments?: ProfitBasisDebitsArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the profit-basis debits for external accounting observability. */\nexport function profitBasisDebits(options: ProfitBasisDebitsOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'profit_basis_debits',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ProfitBasisCreditsArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ProfitBasisCreditsOptions {\n\tpackage?: string;\n\targuments?: ProfitBasisCreditsArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the profit-basis credits for external accounting observability. */\nexport function profitBasisCredits(options: ProfitBasisCreditsOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'profit_basis_credits',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface PendingProtocolProfitArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface PendingProtocolProfitOptions {\n\tpackage?: string;\n\targuments?: PendingProtocolProfitArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return deferred protocol profit for external accounting observability. */\nexport function pendingProtocolProfit(options: PendingProtocolProfitOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'pending_protocol_profit',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface StartPoolValuationArguments {\n\tconfig?: RawTransactionArgument<string>;\n\tvault?: RawTransactionArgument<string>;\n\tvaluationProof: TransactionArgument;\n\tsupplyBudget: RawTransactionArgument<number | bigint | null>;\n\twithdrawBudget: RawTransactionArgument<number | bigint | null>;\n}\nexport interface StartPoolValuationOptions {\n\tpackage?: string;\n\targuments: StartPoolValuationArguments;\n\tconfig?: {\n\t\tprotocolConfig: ConfigValue;\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Begin a full-pool valuation using a registry-issued pool-valuation proof. The\n * proof grants control over when current oracle state is frozen for queued LP\n * fills. Starting engages the cross-transaction valuation flag, snapshots the\n * active expiry set and each LP queue's eligibility cutoff, and opens the atomic\n * snapshot stage: freeze every active market's pricer under the returned\n * `SnapshotStage`, then seal it in the same transaction.\n */\nexport function startPoolValuation(options: StartPoolValuationOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'0x1::option::Option<u64>',\n\t\t'0x1::option::Option<u64>',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['config', 'vault', 'valuationProof', 'supplyBudget', 'withdrawBudget'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'start_pool_valuation',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface SnapshotExpiryPricerArguments {\n\tvault?: RawTransactionArgument<string>;\n\tStage: TransactionArgument;\n\tmarket: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n\tpropbookRegistry?: RawTransactionArgument<string>;\n\tpyth: RawTransactionArgument<string>;\n\tbsValues: RawTransactionArgument<string>;\n\tbsSvi: RawTransactionArgument<string>;\n}\nexport interface SnapshotExpiryPricerOptions {\n\tpackage?: string;\n\targuments: SnapshotExpiryPricerArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\toracleRegistry: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Freeze one snapshotted market's oracle state for this flush and stamp the\n * market, capturing its cash rows and activating its payout-tree snapshot at this\n * instant.\n *\n * Holding `SnapshotStage` is what admits this call, and that potato cannot leave\n * the transaction `start_pool_valuation` minted it in — so every `Pricer` here is\n * loaded at one instant, which is what lets the valuation stage span transactions\n * without mixing marks (audit L10). This stage reads oracles only — it never walks\n * a payout tree — so all markets fit one PTB regardless of book size.\n *\n * The oracle feeding this stage must have been written in an EARLIER transaction:\n * `pricing::resolve_live_pricer` refuses a read stamped with the current\n * transaction digest (RP-24), so a keeper cannot refresh and snapshot in one PTB.\n *\n * A market already settled at snapshot time is recorded with no pricer, gets no\n * stamp (settled flows never touch live NAV), and contributes 0. An\n * expired-but-unsettled market aborts: it has no well-defined mark, and because\n * this stage is atomic the abort reverts the whole snapshot transaction, so the\n * flag is never left engaged. Settle it first, then start the flush; settlement is\n * never blocked by a flush, so that ordering is always available.\n */\nexport function snapshotExpiryPricer(options: SnapshotExpiryPricerOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = [\n\t\t'vault',\n\t\t'Stage',\n\t\t'market',\n\t\t'config',\n\t\t'propbookRegistry',\n\t\t'pyth',\n\t\t'bsValues',\n\t\t'bsSvi',\n\t];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'snapshot_expiry_pricer',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t\tpropbookRegistry: options.arguments?.propbookRegistry ?? options.config?.oracleRegistry,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface SealValuationSnapshotArguments {\n\tvault?: RawTransactionArgument<string>;\n\tstage: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n}\nexport interface SealValuationSnapshotOptions {\n\tpackage?: string;\n\targuments: SealValuationSnapshotArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Close the snapshot stage once every expected market has a frozen pricer, and\n * freeze the vault-side figures — idle, the profit basis, the pending protocol cut\n * — completing the snapshot.\n *\n * Consuming `SnapshotStage` is the simultaneity proof: the potato dies here, so no\n * later transaction can add oracle state to this flush, and every market is marked\n * at the instant the snapshot transaction executed. The vault capture is\n * consistent with the per-market stamps because `rebalance_expiry_cash` refuses to\n * run while the stage is open (`ESnapshotStageOpen`), so no idle↔market move can\n * land between a stamp and this capture. Valuation may then resume across as many\n * transactions as it needs.\n */\nexport function sealValuationSnapshot(options: SealValuationSnapshotOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'stage', 'config'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'seal_valuation_snapshot',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ValueExpiryArguments {\n\tvault?: RawTransactionArgument<string>;\n\tmarket: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n}\nexport interface ValueExpiryOptions {\n\tpackage?: string;\n\targuments: ValueExpiryArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Fold one snapshotted market's SNAPSHOT-INSTANT NAV into the running total. A\n * market frozen as settled is swept and contributes 0; one frozen with a pricer is\n * valued via `expiry_market::snapshot_nav` over its captured cash and tree\n * shadows, then has its stamp cleared (releasing the tree snapshot), so later\n * trades and the next flush start clean.\n *\n * The resumable stage: any transaction after the seal, one market per transaction\n * (`constants::max_payout_tree_nodes`), reading no oracle and no clock.\n * MEASUREMENT-ONLY for every member — settled members were swept during the\n * snapshot stage and every frozen figure was captured there, so this call moves no\n * cash and `rebalance_expiry_cash` runs at any time. A market that expired\n * mid-window is valued at its frozen pre-expiry mark; its settlement does not wait\n * for this call, because settlement is never blocked by a flush.\n */\nexport function valueExpiry(options: ValueExpiryOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'market', 'config'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'value_expiry',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface FinishFlushArguments {\n\tvault?: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n}\nexport interface FinishFlushOptions {\n\tpackage?: string;\n\targuments?: FinishFlushArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Finish a full-pool valuation and run the LP flush: prove every snapshotted\n * market was valued exactly once, price the pool NAV, then drain the\n * supply/withdraw queues at that frozen mark (mint PLP for supplies, burn PLP and\n * pay USDC for withdrawals), release the valuation flag, retire the in-flight\n * valuation, and return the LP-attributable pool-wide USDC NAV (frozen idle + Σ\n * active NAV, net of the pending-protocol-profit exclusion priced from the frozen\n * profit basis — every term as of the snapshot instant). Each drain fills only\n * requests submitted before the flush's snapshot instant (the recorded queue\n * cutoffs); younger requests wait for the next mark.\n *\n * `supply_budget` and `withdraw_budget` bound how many requests each queue may\n * process this flush (`None` = unbounded). Fills — whole or partial — and\n * protocol-refunded heads — non-executable, or quoting below the request's own\n * minimum output — all count as processed. At `ProtocolConfig`'s shipped attempt\n * count of one, a head that misses its limit is refunded by the flush that reaches\n * it; above one it stays queued and stops that queue for the flush. The budgets\n * are independent, so a supply backlog does not consume withdrawal capacity.\n *\n * Capacity bounds each pass on top of the budgets and refunds nothing: supplies\n * fill only up to `ProtocolConfig`'s LP pool-value cap, withdrawals only up to\n * idle. A head larger than the room left fills to the room, spends flush budget,\n * and keeps its remainder queued at a rescaled limit; a head with no usable room\n * carries untouched and spends none. Either way the pass stops, so an unbounded\n * budget does not mean every queued request is processed (RP-23).\n *\n * Because queueing is permissionless and a refunded request returns its escrow in\n * the same transaction, an operator should bound both budgets in production rather\n * than rely on queue length staying small — see RP-12.\n */\nexport function finishFlush(options: FinishFlushOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'config'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'finish_flush',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface RebalanceExpiryCashArguments {\n\tvault?: RawTransactionArgument<string>;\n\tmarket: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n}\nexport interface RebalanceExpiryCashOptions {\n\tpackage?: string;\n\targuments: RebalanceExpiryCashArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Move cash between pool idle liquidity and one expiry market.\n *\n * Permissionless and standalone: anyone may call it at any cadence. Handles all\n * three per-market cases — initial funding of a freshly registered (unfunded)\n * market, ongoing live rebalance/surplus-sweep toward target, and the\n * settled-market sweep (deactivate, return all free cash, materialize profit).\n * Call `expiry_market::try_settle` first in the same PTB when settlement may be\n * due. An expired unsettled market is a no-op until that transition succeeds. Mint\n * asserts backing but never pulls pool cash, so this is what makes a market\n * mintable. The market must already be registered to this vault\n * (`registry::create_and_share_expiry_market`). Runs at any time, including while\n * a flush is in flight — every figure the mark reads was frozen at the snapshot\n * instant, so no move here can reach it. The one refusal is the still-open\n * snapshot stage (start → seal, a single transaction): a cross-move landing\n * between a market's stamp and the seal's vault capture would skew the frozen\n * figures, so it is structurally rejected rather than corrected for.\n */\nexport function rebalanceExpiryCash(options: RebalanceExpiryCashOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'market', 'config'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'rebalance_expiry_cash',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface SponsorFeeIncentivesArguments {\n\tvault?: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n\tpayment: RawTransactionArgument<string>;\n}\nexport interface SponsorFeeIncentivesOptions {\n\tpackage?: string;\n\targuments: SponsorFeeIncentivesArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Sponsor taker fee incentives with USDC. Anyone may contribute; the payment joins\n * a pool-level reserve that is excluded from PLP NAV and later allocated to expiry\n * markets by the normal rebalance flow.\n */\nexport function sponsorFeeIncentives(options: SponsorFeeIncentivesOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'config', 'payment'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'sponsor_fee_incentives',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface LockCapitalArguments {\n\tvault?: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n\tAdminCap: RawTransactionArgument<string>;\n\tpayment: RawTransactionArgument<string>;\n}\nexport interface LockCapitalOptions {\n\tpackage?: string;\n\targuments: LockCapitalArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Bootstrap the pool exactly once: permanently lock `payment` USDC of minimum\n * liquidity. Mints matching PLP (1:1) into the book's locked balance — never\n * withdrawable, so the caller receives no shares — and joins the USDC into idle.\n * This keeps `total_supply > 0` while the vault exists and gives rounding dust a\n * non-withdrawable PLP holder. Requires root authority and zero existing supply.\n * Supply, withdrawal, and flush flows remain disabled until the locked liquidity\n * has been created.\n */\nexport function lockCapital(options: LockCapitalOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'config', 'AdminCap', 'payment'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'lock_capital',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface RequestSupplyArguments {\n\tvault?: RawTransactionArgument<string>;\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n\tamount: RawTransactionArgument<number | bigint>;\n\tminPlpOut: RawTransactionArgument<number | bigint>;\n}\nexport interface RequestSupplyOptions {\n\tpackage?: string;\n\targuments: RequestSupplyArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Queue a supply request: pull `amount` USDC from account custody into queue\n * escrow, recording the account's receive address as the fill recipient. The pull\n * auto-settles any flush-delivered USDC first. The flush charges the protocol's\n * supply fee — zero by default — on the USDC it takes in and prices shares on the\n * remainder, so `min_plp_out` is measured after that fee. The account receives\n * minted PLP only at a mark that mints at least `min_plp_out` for the whole\n * `amount` — a **price floor**, not a promise of that many shares: if the pool cap\n * leaves room for only part of the deposit, the fill is proportionally smaller at\n * the same price and the remainder stays queued with its limit rescaled. At the\n * shipped attempt count of one, a flush whose mark quotes less cancels and refunds\n * the request there and then; a higher configured count lets it rest and retry\n * that many flushes first. Returns the queue index, the handle used to cancel\n * before the flush.\n */\nexport function requestSupply(options: RequestSupplyOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'u64',\n\t\t'u64',\n\t\t'0x2::accumulator::AccumulatorRoot',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'wrapper', 'auth', 'config', 'amount', 'minPlpOut'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'request_supply',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface RequestWithdrawArguments {\n\tvault?: RawTransactionArgument<string>;\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n\tamount: RawTransactionArgument<number | bigint>;\n\tminUsdcOut: RawTransactionArgument<number | bigint>;\n}\nexport interface RequestWithdrawOptions {\n\tpackage?: string;\n\targuments: RequestWithdrawArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Queue a withdraw request: pull `amount` PLP shares from account custody into\n * queue escrow, recording the account's receive address as the fill recipient. The\n * pull auto-settles any flush-delivered PLP first. The flush withholds the\n * protocol's withdraw fee from the marked payout, so `min_usdc_out` is measured\n * after the fee. The account is paid only at a mark that quotes at least\n * `min_usdc_out` for the whole `amount` — a **price floor**, not a promise of that\n * much USDC: if idle liquidity covers only part of the payout, only the shares\n * idle affords are burned, the fill is proportionally smaller at the same price,\n * and the remainder stays queued with its limit rescaled. At the shipped attempt\n * count of one, a flush whose mark quotes less cancels and refunds the request\n * there and then; a higher configured count lets it rest and retry that many\n * flushes first. Returns the queue index used to cancel before the flush.\n */\nexport function requestWithdraw(options: RequestWithdrawOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'u64',\n\t\t'u64',\n\t\t'0x2::accumulator::AccumulatorRoot',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'wrapper', 'auth', 'config', 'amount', 'minUsdcOut'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'request_withdraw',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface CancelSupplyRequestArguments {\n\tvault?: RawTransactionArgument<string>;\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n\tindex: RawTransactionArgument<number | bigint>;\n}\nexport interface CancelSupplyRequestOptions {\n\tpackage?: string;\n\targuments: CancelSupplyRequestArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Cancel a still-pending supply request, refunding its escrowed USDC straight into\n * the requesting account. `account` must be the request's recorded recipient.\n */\nexport function cancelSupplyRequest(options: CancelSupplyRequestOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'u64',\n\t\t'0x2::accumulator::AccumulatorRoot',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'wrapper', 'auth', 'config', 'index'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'cancel_supply_request',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface CancelWithdrawRequestArguments {\n\tvault?: RawTransactionArgument<string>;\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n\tindex: RawTransactionArgument<number | bigint>;\n}\nexport interface CancelWithdrawRequestOptions {\n\tpackage?: string;\n\targuments: CancelWithdrawRequestArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Cancel a still-pending withdraw request, refunding its escrowed PLP straight\n * into the requesting account. `account` must be the request's recorded recipient.\n */\nexport function cancelWithdrawRequest(options: CancelWithdrawRequestOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'u64',\n\t\t'0x2::accumulator::AccumulatorRoot',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'wrapper', 'auth', 'config', 'index'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'cancel_withdraw_request',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,cAAc;AACpB,MAAa,MAAM,IAAI,WAAW;CACjC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,qBAAqB,IAAI,WAAW;CAChD,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,gBAAgB,IAAI,WAAW;CAC3C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,gBAAgB,IAAI,WAAW;CAC3C,MAAM,GAAG,YAAY;CACrB,QAAQ;EAEP,yBAAyB,IAAI,OAAO,IAAI,QAAQ;EAEhD,uBAAuB,IAAI,OAAO,IAAI,QAAQ;EAE9C,WAAW;EASX,gBAAgBA,OAAe,IAAI,SAAS,IAAI,OAAOC,aAAqB,CAAC;EAK7E,QAAQ,IAAI,MAAM;EAElB,eAAe;EAQf,eAAe,IAAI,OAAO,IAAI;EAC9B,iBAAiB,IAAI,OAAO,IAAI;EAMhC,uBAAuB;EACvB,yBAAyB;EASzB,qBAAqB;EACrB,6BAA6B;EAC7B,4BAA4B;EAC5B,gCAAgC;EAChC;CACD,CAAC;AACF,MAAa,YAAY,IAAI,WAAW;CACvC,MAAM,GAAG,YAAY;CACrB,QAA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AACrF,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBACV;GACC,GAAG,QAAQ;GACX,OAAO,QAAQ,WAAW,SAAS,QAAQ,QAAQ;GACnD,QAAQ,QAAQ,WAAW,UAAU,QAAQ,QAAQ;GACrD,EACD,gBACA,eACA;EACD,CAAC;;;;;;AAsBJ,SAAgB,oBAAoB,SAAqC;CACxE,MAAM,iBACL,QAAQ,WAAW,QAAQ,QAAQ,oBAAoB;CACxD,MAAM,iBAAiB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,MAAM,iBAAiB;EAAC;EAAS;EAAW;EAAQ;EAAU;EAAQ;AACtE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBACV;GACC,GAAG,QAAQ;GACX,OAAO,QAAQ,WAAW,SAAS,QAAQ,QAAQ;GACnD,QAAQ,QAAQ,WAAW,UAAU,QAAQ,QAAQ;GACrD,EACD,gBACA,eACA;EACD,CAAC;;;;;;AAsBJ,SAAgB,sBAAsB,SAAuC;CAC5E,MAAM,iBACL,QAAQ,WAAW,QAAQ,QAAQ,oBAAoB;CACxD,MAAM,iBAAiB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,MAAM,iBAAiB;EAAC;EAAS;EAAW;EAAQ;EAAU;EAAQ;AACtE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBACV;GACC,GAAG,QAAQ;GACX,OAAO,QAAQ,WAAW,SAAS,QAAQ,QAAQ;GACnD,QAAQ,QAAQ,WAAW,UAAU,QAAQ,QAAQ;GACrD,EACD,gBACA,eACA;EACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"plp.mjs","names":["vec_map.VecMap","pricing.FrozenPricer","balance.Balance","lp_book.LpBook","pool_accounting.Ledger"],"sources":["../../../src/contracts/deepbook_predict/plp.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * PLP token and pool vault.\n *\n * PoolVault owns the PLP treasury cap, idle USDC, the protocol reserve,\n * sponsor-funded fee incentives, per-expiry cash accounting, and the queued LP\n * supply/withdraw requests. It coordinates the full-pool NAV valuation — an atomic\n * oracle snapshot followed by resumable per-market valuation transactions, with\n * trading live throughout (see `PoolValuation`) — and the unified per-market cash\n * flow (initial funding, live rebalance/sweep, and settled-market sweep with\n * terminal profit materialization). LPs queue supply/withdraw requests routed\n * through a loaded Account; each flush (`finish_flush`) drains the requests that\n * predate its snapshot at the frozen pool NAV, minting/burning PLP and delivering\n * fills to each account via the balance accumulator.\n */\n\nimport {\n\tMoveStruct,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n\ttype ConfigValue,\n} from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U64 } from '../../bcs/integers.js';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nimport * as vec_map from './deps/sui/vec_map.js';\nimport * as pricing from './pricing.js';\nimport * as balance from './deps/sui/balance.js';\nimport * as lp_book from './lp_book.js';\nimport * as pool_accounting from './pool_accounting.js';\nconst $moduleName = '@local-pkg/deepbook_predict::plp';\nexport const PLP = new MoveStruct({\n\tname: `${$moduleName}::PLP`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const PoolValuationProof = new MoveStruct({\n\tname: `${$moduleName}::PoolValuationProof`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const SnapshotStage = new MoveStruct({\n\tname: `${$moduleName}::SnapshotStage`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const PoolValuation = new MoveStruct({\n\tname: `${$moduleName}::PoolValuation`,\n\tfields: {\n\t\t/** Active expiry markets snapshotted at start; every one must be valued. */\n\t\texpected_expiry_markets: bcs.vector(bcs.Address),\n\t\t/** Markets valued so far this flush; folded against `expected` at finish. */\n\t\tvalued_expiry_markets: bcs.vector(bcs.Address),\n\t\t/** Running Σ of each valued market's snapshot NAV (settled markets contribute 0). */\n\t\ttotal_nav: U64,\n\t\t/**\n\t\t * Oracle state frozen during the snapshot stage, one entry per expected market.\n\t\t * Keyed by market id so a `Pricer` can never be applied to the wrong market.\n\t\t * `none` marks a market that was already settled at snapshot time and therefore\n\t\t * contributes 0. This map is what makes the valuation stage deterministic: it\n\t\t * decides both the mark AND the sweep-vs-value branch, so no later transaction's\n\t\t * clock or oracle state can change a market's contribution.\n\t\t */\n\t\tfrozen_pricers: vec_map.VecMap(bcs.Address, bcs.option(pricing.FrozenPricer)),\n\t\t/**\n\t\t * Set by `seal_valuation_snapshot`; no market may be valued before it. Nothing may\n\t\t * be snapshotted after it because sealing consumes the `SnapshotStage`.\n\t\t */\n\t\tsealed: bcs.bool(),\n\t\t/** Clock time the flush was started, for the stuck-flush deadline. */\n\t\tstarted_at_ms: U64,\n\t\t/**\n\t\t * Drain budgets committed at start (the cap owner's choice), bounding how many\n\t\t * requests each queue processes at finish. Committing them here — not at finish —\n\t\t * is what lets `finish_flush` run permissionless: a stranger may complete a flush\n\t\t * but only ever drains at these budgets, so completion can help LPs, never starve\n\t\t * them by finishing with a zero budget.\n\t\t */\n\t\tsupply_budget: bcs.option(U64),\n\t\twithdraw_budget: bcs.option(U64),\n\t\t/**\n\t\t * Each LP queue's `next_index` at the snapshot instant: the drain fills only\n\t\t * requests indexed strictly below these, so nobody can watch the frozen mark form\n\t\t * and then submit against a price they already know is stale.\n\t\t */\n\t\tsupply_request_cutoff: U64,\n\t\twithdraw_request_cutoff: U64,\n\t\t/**\n\t\t * Vault-side figures captured by `seal_valuation_snapshot`. With every market's\n\t\t * cash frozen in its stamp and these frozen here, the mark is a pure function of\n\t\t * the snapshot instant: no in-window cash move — maintenance, settled sweep,\n\t\t * market funding, reserve realization — can reach it. Settled members are swept\n\t\t * during the snapshot stage, so their recoverable cash sits inside\n\t\t * `frozen_idle_balance`.\n\t\t */\n\t\tfrozen_idle_balance: U64,\n\t\tfrozen_profit_basis_credits: U64,\n\t\tfrozen_profit_basis_debits: U64,\n\t\tfrozen_pending_protocol_profit: U64,\n\t},\n});\nexport const PoolVault = new MoveStruct({\n\tname: `${$moduleName}::PoolVault`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\t/**\n\t\t * Protocol-owned USDC excluded from PLP redemption. No package entrypoint\n\t\t * withdraws this balance.\n\t\t */\n\t\tprotocol_reserve_balance: balance.Balance,\n\t\t/** Sponsor-funded USDC reserved for taker fee sponsorship, excluded from PLP NAV. */\n\t\tfee_incentive_reserve: balance.Balance,\n\t\t/** PLP share issuance plus queued supply/withdraw escrow. */\n\t\tlp: lp_book.LpBook,\n\t\t/** Idle USDC custody, registered expiries, and per-expiry cash-flow rows. */\n\t\texpiry_accounting: pool_accounting.Ledger,\n\t\t/**\n\t\t * In-flight full-pool valuation, held across transactions. `Some` exactly while\n\t\t * the `ProtocolConfig` valuation flag is engaged.\n\t\t */\n\t\tvaluation: bcs.option(PoolValuation),\n\t},\n});\nexport interface IdArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface IdOptions {\n\tpackage?: string;\n\targuments?: IdArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the pool vault object ID for external discovery and PTB construction. */\nexport function id(options: IdOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'id',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface IdleBalanceArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface IdleBalanceOptions {\n\tpackage?: string;\n\targuments?: IdleBalanceArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return idle USDC for SDK and devInspect state reads. */\nexport function idleBalance(options: IdleBalanceOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'idle_balance',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ProtocolReserveBalanceArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ProtocolReserveBalanceOptions {\n\tpackage?: string;\n\targuments?: ProtocolReserveBalanceArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return protocol-owned USDC for SDK and devInspect state reads. */\nexport function protocolReserveBalance(options: ProtocolReserveBalanceOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'protocol_reserve_balance',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface FeeIncentiveReserveArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface FeeIncentiveReserveOptions {\n\tpackage?: string;\n\targuments?: FeeIncentiveReserveArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return sponsor-funded fee reserves for SDK and devInspect state reads. */\nexport function feeIncentiveReserve(options: FeeIncentiveReserveOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'fee_incentive_reserve',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface PlpTotalSupplyArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface PlpTotalSupplyOptions {\n\tpackage?: string;\n\targuments?: PlpTotalSupplyArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return total PLP supply for SDK and devInspect state reads. */\nexport function plpTotalSupply(options: PlpTotalSupplyOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'plp_total_supply',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface SupplyRequestsPendingArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface SupplyRequestsPendingOptions {\n\tpackage?: string;\n\targuments?: SupplyRequestsPendingArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return pending LP supply count for SDK and devInspect queue reads. */\nexport function supplyRequestsPending(options: SupplyRequestsPendingOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'supply_requests_pending',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface WithdrawRequestsPendingArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface WithdrawRequestsPendingOptions {\n\tpackage?: string;\n\targuments?: WithdrawRequestsPendingArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return pending LP withdrawal count for SDK and devInspect queue reads. */\nexport function withdrawRequestsPending(options: WithdrawRequestsPendingOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'withdraw_requests_pending',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ActiveExpiryMarketsArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ActiveExpiryMarketsOptions {\n\tpackage?: string;\n\targuments?: ActiveExpiryMarketsArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return active expiry IDs for external PTB construction and pool inspection. */\nexport function activeExpiryMarkets(options: ActiveExpiryMarketsOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'active_expiry_markets',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ActiveLiveExpiryCountArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ActiveLiveExpiryCountOptions {\n\tpackage?: string;\n\targuments?: ActiveLiveExpiryCountArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the pre-expiry active count for SDK and devInspect capacity reads. */\nexport function activeLiveExpiryCount(options: ActiveLiveExpiryCountOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'active_live_expiry_count',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ProfitBasisDebitsArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ProfitBasisDebitsOptions {\n\tpackage?: string;\n\targuments?: ProfitBasisDebitsArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the profit-basis debits for external accounting observability. */\nexport function profitBasisDebits(options: ProfitBasisDebitsOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'profit_basis_debits',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ProfitBasisCreditsArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface ProfitBasisCreditsOptions {\n\tpackage?: string;\n\targuments?: ProfitBasisCreditsArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the profit-basis credits for external accounting observability. */\nexport function profitBasisCredits(options: ProfitBasisCreditsOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'profit_basis_credits',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface PendingProtocolProfitArguments {\n\tvault?: RawTransactionArgument<string>;\n}\nexport interface PendingProtocolProfitOptions {\n\tpackage?: string;\n\targuments?: PendingProtocolProfitArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return deferred protocol profit for external accounting observability. */\nexport function pendingProtocolProfit(options: PendingProtocolProfitOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['vault'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'pending_protocol_profit',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface StartPoolValuationArguments {\n\tconfig?: RawTransactionArgument<string>;\n\tvault?: RawTransactionArgument<string>;\n\tvaluationProof: TransactionArgument;\n\tsupplyBudget: RawTransactionArgument<number | bigint | null>;\n\twithdrawBudget: RawTransactionArgument<number | bigint | null>;\n}\nexport interface StartPoolValuationOptions {\n\tpackage?: string;\n\targuments: StartPoolValuationArguments;\n\tconfig?: {\n\t\tprotocolConfig: ConfigValue;\n\t\tpoolVault: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Begin a full-pool valuation using a registry-issued pool-valuation proof. The\n * proof grants control over when current oracle state is frozen for queued LP\n * fills. Starting engages the cross-transaction valuation flag, snapshots the\n * active expiry set and each LP queue's eligibility cutoff, and opens the atomic\n * snapshot stage: freeze every active market's pricer under the returned\n * `SnapshotStage`, then seal it in the same transaction.\n */\nexport function startPoolValuation(options: StartPoolValuationOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'0x1::option::Option<u64>',\n\t\t'0x1::option::Option<u64>',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['config', 'vault', 'valuationProof', 'supplyBudget', 'withdrawBudget'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'start_pool_valuation',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface SnapshotExpiryPricerArguments {\n\tvault?: RawTransactionArgument<string>;\n\tStage: TransactionArgument;\n\tmarket: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n\tpropbookRegistry?: RawTransactionArgument<string>;\n\tpyth: RawTransactionArgument<string>;\n\tbsValues: RawTransactionArgument<string>;\n\tbsSvi: RawTransactionArgument<string>;\n}\nexport interface SnapshotExpiryPricerOptions {\n\tpackage?: string;\n\targuments: SnapshotExpiryPricerArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\toracleRegistry: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Freeze one snapshotted market's oracle state for this flush and stamp the\n * market, capturing its cash rows and activating its payout-tree snapshot at this\n * instant.\n *\n * Holding `SnapshotStage` is what admits this call, and that potato cannot leave\n * the transaction `start_pool_valuation` minted it in — so every `Pricer` here is\n * loaded at one instant, which is what lets the valuation stage span transactions\n * without mixing marks (audit L10). This stage reads oracles only — it never walks\n * a payout tree — so all markets fit one PTB regardless of book size.\n *\n * The oracle feeding this stage must have been written in an EARLIER transaction:\n * `pricing::resolve_live_pricer` refuses a read stamped with the current\n * transaction digest (RP-24), so a keeper cannot refresh and snapshot in one PTB.\n *\n * A market already settled at snapshot time is recorded with no pricer, gets no\n * stamp (settled flows never touch live NAV), and contributes 0. An\n * expired-but-unsettled market aborts: it has no well-defined mark, and because\n * this stage is atomic the abort reverts the whole snapshot transaction, so the\n * flag is never left engaged. Settle it first, then start the flush; settlement is\n * never blocked by a flush, so that ordering is always available.\n */\nexport function snapshotExpiryPricer(options: SnapshotExpiryPricerOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = [\n\t\t'vault',\n\t\t'Stage',\n\t\t'market',\n\t\t'config',\n\t\t'propbookRegistry',\n\t\t'pyth',\n\t\t'bsValues',\n\t\t'bsSvi',\n\t];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'snapshot_expiry_pricer',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t\tpropbookRegistry: options.arguments?.propbookRegistry ?? options.config?.oracleRegistry,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface SealValuationSnapshotArguments {\n\tvault?: RawTransactionArgument<string>;\n\tstage: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n}\nexport interface SealValuationSnapshotOptions {\n\tpackage?: string;\n\targuments: SealValuationSnapshotArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Close the snapshot stage once every expected market has a frozen pricer, and\n * freeze the vault-side figures — idle, the profit basis, the pending protocol cut\n * — completing the snapshot.\n *\n * Consuming `SnapshotStage` is the simultaneity proof: the potato dies here, so no\n * later transaction can add oracle state to this flush, and every market is marked\n * at the instant the snapshot transaction executed. The vault capture is\n * consistent with the per-market stamps because `rebalance_expiry_cash` refuses to\n * run while the stage is open (`ESnapshotStageOpen`), so no idle↔market move can\n * land between a stamp and this capture. Valuation may then resume across as many\n * transactions as it needs.\n */\nexport function sealValuationSnapshot(options: SealValuationSnapshotOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'stage', 'config'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'seal_valuation_snapshot',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface ValueExpiryArguments {\n\tvault?: RawTransactionArgument<string>;\n\tmarket: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n}\nexport interface ValueExpiryOptions {\n\tpackage?: string;\n\targuments: ValueExpiryArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Fold one snapshotted market's SNAPSHOT-INSTANT NAV into the running total. A\n * market frozen as settled is swept and contributes 0; one frozen with a pricer is\n * valued via `expiry_market::snapshot_nav` over its captured cash and tree\n * shadows, then has its stamp cleared (releasing the tree snapshot), so later\n * trades and the next flush start clean.\n *\n * The resumable stage: any transaction after the seal, one market per transaction\n * (`constants::max_payout_tree_nodes`), reading no oracle and no clock.\n * MEASUREMENT-ONLY for every member — settled members were swept during the\n * snapshot stage and every frozen figure was captured there, so this call moves no\n * cash and `rebalance_expiry_cash` runs at any time. A market that expired\n * mid-window is valued at its frozen pre-expiry mark; its settlement does not wait\n * for this call, because settlement is never blocked by a flush.\n */\nexport function valueExpiry(options: ValueExpiryOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'market', 'config'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'value_expiry',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface FinishFlushArguments {\n\tvault?: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n}\nexport interface FinishFlushOptions {\n\tpackage?: string;\n\targuments?: FinishFlushArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Finish a full-pool valuation and run the LP flush: prove every snapshotted\n * market was valued exactly once, price the pool NAV, then drain the\n * supply/withdraw queues at that frozen mark (mint PLP for supplies, burn PLP and\n * pay USDC for withdrawals), release the valuation flag, retire the in-flight\n * valuation, and return the LP-attributable pool-wide USDC NAV (frozen idle + Σ\n * active NAV, net of the pending-protocol-profit exclusion priced from the frozen\n * profit basis — every term as of the snapshot instant). Each drain fills only\n * requests submitted before the flush's snapshot instant (the recorded queue\n * cutoffs); younger requests wait for the next mark.\n *\n * `supply_budget` and `withdraw_budget` bound how many requests each queue may\n * process this flush (`None` = unbounded). Fills — whole or partial — and\n * protocol-refunded heads — non-executable, or quoting below the request's own\n * minimum output — all count as processed. At `ProtocolConfig`'s shipped attempt\n * count of one, a head that misses its limit is refunded by the flush that reaches\n * it; above one it stays queued and stops that queue for the flush. The budgets\n * are independent, so a supply backlog does not consume withdrawal capacity.\n *\n * Capacity bounds each pass on top of the budgets and refunds nothing: supplies\n * fill only up to `ProtocolConfig`'s LP pool-value cap, withdrawals only up to\n * idle. A head larger than the room left fills to the room, spends flush budget,\n * and keeps its remainder queued at a rescaled limit; a head with no usable room\n * carries untouched and spends none. Either way the pass stops, so an unbounded\n * budget does not mean every queued request is processed (RP-23).\n *\n * Because queueing is permissionless and a refunded request returns its escrow in\n * the same transaction, an operator should bound both budgets in production rather\n * than rely on queue length staying small — see RP-12.\n */\nexport function finishFlush(options: FinishFlushOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'config'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'finish_flush',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface RebalanceExpiryCashArguments {\n\tvault?: RawTransactionArgument<string>;\n\tmarket: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n}\nexport interface RebalanceExpiryCashOptions {\n\tpackage?: string;\n\targuments: RebalanceExpiryCashArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Move cash between pool idle liquidity and one expiry market.\n *\n * Permissionless and standalone: anyone may call it at any cadence. Handles all\n * three per-market cases — initial funding of a freshly registered (unfunded)\n * market, ongoing live rebalance/surplus-sweep toward target, and the\n * settled-market sweep (deactivate, return all free cash, materialize profit).\n * Call `expiry_market::try_settle` first in the same PTB when settlement may be\n * due. An expired unsettled market is a no-op until that transition succeeds. Mint\n * asserts backing but never pulls pool cash, so this is what makes a market\n * mintable. The market must already be registered to this vault\n * (`registry::create_and_share_expiry_market`). Runs at any time, including while\n * a flush is in flight — every figure the mark reads was frozen at the snapshot\n * instant, so no move here can reach it. The one refusal is the still-open\n * snapshot stage (start → seal, a single transaction): a cross-move landing\n * between a market's stamp and the seal's vault capture would skew the frozen\n * figures, so it is structurally rejected rather than corrected for.\n */\nexport function rebalanceExpiryCash(options: RebalanceExpiryCashOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'market', 'config'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'rebalance_expiry_cash',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface SponsorFeeIncentivesArguments {\n\tvault?: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n\tpayment: RawTransactionArgument<string>;\n}\nexport interface SponsorFeeIncentivesOptions {\n\tpackage?: string;\n\targuments: SponsorFeeIncentivesArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Sponsor taker fee incentives with USDC. Anyone may contribute; the payment joins\n * a pool-level reserve that is excluded from PLP NAV and later allocated to expiry\n * markets by the normal rebalance flow.\n */\nexport function sponsorFeeIncentives(options: SponsorFeeIncentivesOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'config', 'payment'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'sponsor_fee_incentives',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface LockCapitalArguments {\n\tvault?: RawTransactionArgument<string>;\n\tconfig?: RawTransactionArgument<string>;\n\tAdminCap: RawTransactionArgument<string>;\n\tpayment: RawTransactionArgument<string>;\n}\nexport interface LockCapitalOptions {\n\tpackage?: string;\n\targuments: LockCapitalArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Bootstrap the pool exactly once: permanently lock `payment` USDC of minimum\n * liquidity. Mints matching PLP (1:1) into the book's locked balance — never\n * withdrawable, so the caller receives no shares — and joins the USDC into idle.\n * This keeps `total_supply > 0` while the vault exists and gives rounding dust a\n * non-withdrawable PLP holder. Requires root authority and zero existing supply.\n * Supply, withdrawal, and flush flows remain disabled until the locked liquidity\n * has been created.\n */\nexport function lockCapital(options: LockCapitalOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'config', 'AdminCap', 'payment'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'lock_capital',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface RequestSupplyArguments {\n\tvault?: RawTransactionArgument<string>;\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n\tamount: RawTransactionArgument<number | bigint>;\n\tminPlpOut: RawTransactionArgument<number | bigint>;\n}\nexport interface RequestSupplyOptions {\n\tpackage?: string;\n\targuments: RequestSupplyArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Queue a supply request: pull `amount` USDC from account custody into queue\n * escrow, recording the account's receive address as the fill recipient. The pull\n * auto-settles any flush-delivered USDC first. The flush charges the protocol's\n * supply fee — zero by default — on the USDC it takes in and prices shares on the\n * remainder, so `min_plp_out` is measured after that fee. The account receives\n * minted PLP only at a mark that mints at least `min_plp_out` for the whole\n * `amount` — a **price floor**, not a promise of that many shares: if the pool cap\n * leaves room for only part of the deposit, the fill is proportionally smaller at\n * the same price and the remainder stays queued with its limit rescaled. At the\n * shipped attempt count of one, a flush whose mark quotes less cancels and refunds\n * the request there and then; a higher configured count lets it rest and retry\n * that many flushes first. Returns the queue index, the handle used to cancel\n * before the flush.\n */\nexport function requestSupply(options: RequestSupplyOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'u64',\n\t\t'u64',\n\t\t'0x2::accumulator::AccumulatorRoot',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'wrapper', 'auth', 'config', 'amount', 'minPlpOut'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'request_supply',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface RequestWithdrawArguments {\n\tvault?: RawTransactionArgument<string>;\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n\tamount: RawTransactionArgument<number | bigint>;\n\tminUsdcOut: RawTransactionArgument<number | bigint>;\n}\nexport interface RequestWithdrawOptions {\n\tpackage?: string;\n\targuments: RequestWithdrawArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Queue a withdraw request: pull `amount` PLP shares from account custody into\n * queue escrow, recording the account's receive address as the fill recipient. The\n * pull auto-settles any flush-delivered PLP first. The flush withholds the\n * protocol's withdraw fee from the marked payout, so `min_usdc_out` is measured\n * after the fee. The account is paid only at a mark that quotes at least\n * `min_usdc_out` for the whole `amount` — a **price floor**, not a promise of that\n * much USDC: if idle liquidity covers only part of the payout, only the shares\n * idle affords are burned, the fill is proportionally smaller at the same price,\n * and the remainder stays queued with its limit rescaled. At the shipped attempt\n * count of one, a flush whose mark quotes less cancels and refunds the request\n * there and then; a higher configured count lets it rest and retry that many\n * flushes first. Returns the queue index used to cancel before the flush.\n */\nexport function requestWithdraw(options: RequestWithdrawOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'u64',\n\t\t'u64',\n\t\t'0x2::accumulator::AccumulatorRoot',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'wrapper', 'auth', 'config', 'amount', 'minUsdcOut'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'request_withdraw',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface CancelSupplyRequestArguments {\n\tvault?: RawTransactionArgument<string>;\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n\tindex: RawTransactionArgument<number | bigint>;\n}\nexport interface CancelSupplyRequestOptions {\n\tpackage?: string;\n\targuments: CancelSupplyRequestArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Cancel a still-pending supply request, refunding its escrowed USDC straight into\n * the requesting account. `account` must be the request's recorded recipient.\n */\nexport function cancelSupplyRequest(options: CancelSupplyRequestOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'u64',\n\t\t'0x2::accumulator::AccumulatorRoot',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'wrapper', 'auth', 'config', 'index'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'cancel_supply_request',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t\t\t},\n\t\t\t\targumentsTypes,\n\t\t\t\tparameterNames,\n\t\t\t),\n\t\t});\n}\nexport interface CancelWithdrawRequestArguments {\n\tvault?: RawTransactionArgument<string>;\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tconfig?: RawTransactionArgument<string>;\n\tindex: RawTransactionArgument<number | bigint>;\n}\nexport interface CancelWithdrawRequestOptions {\n\tpackage?: string;\n\targuments: CancelWithdrawRequestArguments;\n\tconfig?: {\n\t\tpoolVault: ConfigValue;\n\t\tprotocolConfig: ConfigValue;\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Cancel a still-pending withdraw request, refunding its escrowed PLP straight\n * into the requesting account. `account` must be the request's recorded recipient.\n */\nexport function cancelWithdrawRequest(options: CancelWithdrawRequestOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\tnull,\n\t\t'u64',\n\t\t'0x2::accumulator::AccumulatorRoot',\n\t\t'0x2::clock::Clock',\n\t] satisfies (string | null)[];\n\tconst parameterNames = ['vault', 'wrapper', 'auth', 'config', 'index'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'plp',\n\t\t\tfunction: 'cancel_withdraw_request',\n\t\t\targuments: normalizeMoveArguments(\n\t\t\t\t{\n\t\t\t\t\t...options.arguments,\n\t\t\t\t\tvault: options.arguments?.vault ?? options.config?.poolVault,\n\t\t\t\t\tconfig: options.arguments?.config ?? options.config?.protocolConfig,\n\t\t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D,EACD,gBACA,eACA;EACD,CAAC;;;;;;AAsBJ,SAAgB,sBAAsB,SAAuC;CAC5E,MAAM,iBACL,QAAQ,WAAW,QAAQ,QAAQ,oBAAoB;CACxD,MAAM,iBAAiB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,MAAM,iBAAiB;EAAC;EAAS;EAAW;EAAQ;EAAU;EAAQ;AACtE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBACV;GACC,GAAG,QAAQ;GACX,OAAO,QAAQ,WAAW,SAAS,QAAQ,QAAQ;GACnD,QAAQ,QAAQ,WAAW,UAAU,QAAQ,QAAQ;GACrD,EACD,gBACA,eACA;EACD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { MoveStruct, RawTransactionArgument } from "../utils/index.mjs";
|
|
2
|
+
import * as _mysten_sui_bcs164 from "@mysten/sui/bcs";
|
|
3
|
+
import * as _mysten_sui_transactions240 from "@mysten/sui/transactions";
|
|
4
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
5
|
+
|
|
6
|
+
//#region src/contracts/deepbook_predict/pool_valuation_cap.d.ts
|
|
7
|
+
declare namespace pool_valuation_cap_d_exports {
|
|
8
|
+
export { DestroyArguments, DestroyOptions, IdArguments, IdOptions, PoolValuationCap, destroy, id };
|
|
9
|
+
}
|
|
10
|
+
declare const PoolValuationCap: MoveStruct<{
|
|
11
|
+
id: _mysten_sui_bcs164.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
12
|
+
}, "@local-pkg/deepbook_predict::pool_valuation_cap::PoolValuationCap">;
|
|
13
|
+
interface IdArguments {
|
|
14
|
+
cap: RawTransactionArgument<string>;
|
|
15
|
+
}
|
|
16
|
+
interface IdOptions {
|
|
17
|
+
package?: string;
|
|
18
|
+
arguments: IdArguments | [cap: RawTransactionArgument<string>];
|
|
19
|
+
config?: {
|
|
20
|
+
predictPackageId?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Returns the capability identity used by the registry allowlist. */
|
|
24
|
+
declare function id(options: IdOptions): (tx: Transaction) => _mysten_sui_transactions240.TransactionResult;
|
|
25
|
+
interface DestroyArguments {
|
|
26
|
+
cap: RawTransactionArgument<string>;
|
|
27
|
+
}
|
|
28
|
+
interface DestroyOptions {
|
|
29
|
+
package?: string;
|
|
30
|
+
arguments: DestroyArguments | [cap: RawTransactionArgument<string>];
|
|
31
|
+
config?: {
|
|
32
|
+
predictPackageId?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Destroy a `PoolValuationCap` the holder no longer needs. */
|
|
36
|
+
declare function destroy(options: DestroyOptions): (tx: Transaction) => _mysten_sui_transactions240.TransactionResult;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { pool_valuation_cap_d_exports };
|
|
39
|
+
//# sourceMappingURL=pool_valuation_cap.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool_valuation_cap.d.mts","names":[],"sources":["../../../src/contracts/deepbook_predict/pool_valuation_cap.ts"],"mappings":";;;;;;;;;cAea,gBAAA,EAAgB,UAAA;;;UAMZ,WAAA;EAChB,GAAA,EAAK,sBAAA;AAAA;AAAA,UAEW,SAAA;EAChB,OAAA;EACA,SAAA,EAAW,WAAA,IAAe,GAAA,EAAK,sBAAA;EAC/B,MAAA;IACC,gBAAA;EAAA;AAAA;;iBAIc,EAAA,CAAG,OAAA,EAAS,SAAA,IAKnB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;AAAA,UAQP,gBAAA;EAChB,GAAA,EAAK,sBAAA;AAAA;AAAA,UAEW,cAAA;EAChB,OAAA;EACA,SAAA,EAAW,gBAAA,IAAoB,GAAA,EAAK,sBAAA;EACpC,MAAA;IACC,gBAAA;EAAA;AAAA;;iBAIc,OAAA,CAAQ,OAAA,EAAS,cAAA,IAKxB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.mjs";
|
|
3
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
4
|
+
|
|
5
|
+
//#region src/contracts/deepbook_predict/pool_valuation_cap.ts
|
|
6
|
+
/**************************************************************
|
|
7
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
8
|
+
**************************************************************/
|
|
9
|
+
/**
|
|
10
|
+
* Defines revocable authority to start the full-pool valuation (the flush) without
|
|
11
|
+
* granting market-creation, oracle-write, or root-admin power. `Registry` owns the
|
|
12
|
+
* allowlist and issues the transaction-local proof `plp::start_pool_valuation`
|
|
13
|
+
* consumes.
|
|
14
|
+
*/
|
|
15
|
+
var pool_valuation_cap_exports = /* @__PURE__ */ __exportAll({
|
|
16
|
+
PoolValuationCap: () => PoolValuationCap,
|
|
17
|
+
destroy: () => destroy,
|
|
18
|
+
id: () => id
|
|
19
|
+
});
|
|
20
|
+
const $moduleName = "@local-pkg/deepbook_predict::pool_valuation_cap";
|
|
21
|
+
const PoolValuationCap = new MoveStruct({
|
|
22
|
+
name: `${$moduleName}::PoolValuationCap`,
|
|
23
|
+
fields: { id: bcs.Address }
|
|
24
|
+
});
|
|
25
|
+
/** Returns the capability identity used by the registry allowlist. */
|
|
26
|
+
function id(options) {
|
|
27
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
28
|
+
const argumentsTypes = [null];
|
|
29
|
+
const parameterNames = ["cap"];
|
|
30
|
+
return (tx) => tx.moveCall({
|
|
31
|
+
package: packageAddress,
|
|
32
|
+
module: "pool_valuation_cap",
|
|
33
|
+
function: "id",
|
|
34
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** Destroy a `PoolValuationCap` the holder no longer needs. */
|
|
38
|
+
function destroy(options) {
|
|
39
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
40
|
+
const argumentsTypes = [null];
|
|
41
|
+
const parameterNames = ["cap"];
|
|
42
|
+
return (tx) => tx.moveCall({
|
|
43
|
+
package: packageAddress,
|
|
44
|
+
module: "pool_valuation_cap",
|
|
45
|
+
function: "destroy",
|
|
46
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { pool_valuation_cap_exports };
|
|
52
|
+
//# sourceMappingURL=pool_valuation_cap.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool_valuation_cap.mjs","names":[],"sources":["../../../src/contracts/deepbook_predict/pool_valuation_cap.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Defines revocable authority to start the full-pool valuation (the flush) without\n * granting market-creation, oracle-write, or root-admin power. `Registry` owns the\n * allowlist and issues the transaction-local proof `plp::start_pool_valuation`\n * consumes.\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/deepbook_predict::pool_valuation_cap';\nexport const PoolValuationCap = new MoveStruct({\n\tname: `${$moduleName}::PoolValuationCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport interface IdArguments {\n\tcap: RawTransactionArgument<string>;\n}\nexport interface IdOptions {\n\tpackage?: string;\n\targuments: IdArguments | [cap: RawTransactionArgument<string>];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Returns the capability identity used by the registry allowlist. */\nexport function id(options: IdOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'pool_valuation_cap',\n\t\t\tfunction: 'id',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface DestroyArguments {\n\tcap: RawTransactionArgument<string>;\n}\nexport interface DestroyOptions {\n\tpackage?: string;\n\targuments: DestroyArguments | [cap: RawTransactionArgument<string>];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Destroy a `PoolValuationCap` the holder no longer needs. */\nexport function destroy(options: DestroyOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'pool_valuation_cap',\n\t\t\tfunction: 'destroy',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAcA,MAAM,cAAc;AACpB,MAAa,mBAAmB,IAAI,WAAW;CAC9C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,IAAI,IAAI,SACR;CACD,CAAC;;AAYF,SAAgB,GAAG,SAAoB;CACtC,MAAM,iBACL,QAAQ,WAAW,QAAQ,QAAQ,oBAAoB;CACxD,MAAM,iBAAiB,CAAC,KAAK;CAC7B,MAAM,iBAAiB,CAAC,MAAM;AAC9B,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC;;;AAaJ,SAAgB,QAAQ,SAAyB;CAChD,MAAM,iBACL,QAAQ,WAAW,QAAQ,QAAQ,oBAAoB;CACxD,MAAM,iBAAiB,CAAC,KAAK;CAC7B,MAAM,iBAAiB,CAAC,MAAM;AAC9B,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { MoveStruct, MoveTuple, RawTransactionArgument } from "../utils/index.mjs";
|
|
2
|
+
import * as _mysten_sui_bcs165 from "@mysten/sui/bcs";
|
|
3
|
+
import * as _mysten_sui_transactions242 from "@mysten/sui/transactions";
|
|
4
|
+
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
5
|
+
|
|
6
|
+
//#region src/contracts/deepbook_predict/predict_account.d.ts
|
|
7
|
+
declare namespace predict_account_d_exports {
|
|
8
|
+
export { BuilderCodeIdArguments, BuilderCodeIdOptions, HasPositionArguments, HasPositionOptions, Position, PositionKey, PredictApp, PredictData, SetBuilderCodeArguments, SetBuilderCodeOptions, UnsetBuilderCodeArguments, UnsetBuilderCodeOptions, builderCodeId, hasPosition, setBuilderCode, unsetBuilderCode };
|
|
9
|
+
}
|
|
10
|
+
declare const PredictApp: MoveTuple<readonly [_mysten_sui_bcs165.BcsType<boolean, boolean, "bool">], "@local-pkg/deepbook_predict::predict_account::PredictApp">;
|
|
11
|
+
declare const PositionKey: MoveStruct<{
|
|
12
|
+
expiry_market_id: _mysten_sui_bcs165.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
13
|
+
order_id: _mysten_sui_bcs165.BcsType<bigint, string | number | bigint, "u256">;
|
|
14
|
+
}, "@local-pkg/deepbook_predict::predict_account::PositionKey">;
|
|
15
|
+
declare const Position: MoveStruct<{
|
|
16
|
+
/** Root order ID, carried forward unchanged across partial-close replacements. */root_id: _mysten_sui_bcs165.BcsType<bigint, string | number | bigint, "u256">;
|
|
17
|
+
/**
|
|
18
|
+
* On-chain time (`clock.timestamp_ms()`) the position was opened, carried forward
|
|
19
|
+
* unchanged across partial-close replacements. A live redeem in the same timestamp
|
|
20
|
+
* is rejected, blocking an atomic mint -> oracle-update -> redeem in one
|
|
21
|
+
* transaction.
|
|
22
|
+
*/
|
|
23
|
+
opened_at_ms: _mysten_sui_bcs165.BcsType<bigint, string | number | bigint, "u64">;
|
|
24
|
+
}, "@local-pkg/deepbook_predict::predict_account::Position">;
|
|
25
|
+
declare const PredictData: MoveStruct<{
|
|
26
|
+
/** Open positions scoped by expiry market. */positions: MoveStruct<{
|
|
27
|
+
id: _mysten_sui_bcs165.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
28
|
+
size: _mysten_sui_bcs165.BcsType<bigint, string | number | bigint, "u64">;
|
|
29
|
+
}, "0x2::table::Table<phantom K, phantom V>">; /** Sticky builder-code attribution for future trades, if set. */
|
|
30
|
+
builder_code_id: _mysten_sui_bcs165.BcsType<string | null, string | Uint8Array<ArrayBufferLike> | null | undefined, "Option<bytes[32]>">;
|
|
31
|
+
}, "@local-pkg/deepbook_predict::predict_account::PredictData">;
|
|
32
|
+
interface HasPositionArguments {
|
|
33
|
+
account: TransactionArgument;
|
|
34
|
+
expiryMarketId: RawTransactionArgument<string>;
|
|
35
|
+
orderId: RawTransactionArgument<number | bigint>;
|
|
36
|
+
}
|
|
37
|
+
interface HasPositionOptions {
|
|
38
|
+
package?: string;
|
|
39
|
+
arguments: HasPositionArguments | [account: TransactionArgument, expiryMarketId: RawTransactionArgument<string>, orderId: RawTransactionArgument<number | bigint>];
|
|
40
|
+
config?: {
|
|
41
|
+
predictPackageId?: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Return whether an account holds a position for SDK and devInspect state reads. */
|
|
45
|
+
declare function hasPosition(options: HasPositionOptions): (tx: Transaction) => _mysten_sui_transactions242.TransactionResult;
|
|
46
|
+
interface BuilderCodeIdArguments {
|
|
47
|
+
account: TransactionArgument;
|
|
48
|
+
}
|
|
49
|
+
interface BuilderCodeIdOptions {
|
|
50
|
+
package?: string;
|
|
51
|
+
arguments: BuilderCodeIdArguments | [account: TransactionArgument];
|
|
52
|
+
config?: {
|
|
53
|
+
predictPackageId?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Return the sticky builder-code ID, if set. */
|
|
57
|
+
declare function builderCodeId(options: BuilderCodeIdOptions): (tx: Transaction) => _mysten_sui_transactions242.TransactionResult;
|
|
58
|
+
interface SetBuilderCodeArguments {
|
|
59
|
+
wrapper: RawTransactionArgument<string>;
|
|
60
|
+
auth: TransactionArgument;
|
|
61
|
+
code: RawTransactionArgument<string>;
|
|
62
|
+
}
|
|
63
|
+
interface SetBuilderCodeOptions {
|
|
64
|
+
package?: string;
|
|
65
|
+
arguments: SetBuilderCodeArguments | [wrapper: RawTransactionArgument<string>, auth: TransactionArgument, code: RawTransactionArgument<string>];
|
|
66
|
+
config?: {
|
|
67
|
+
predictPackageId?: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Set sticky builder-code attribution for future trades using valid account auth.
|
|
72
|
+
* Owner auth and authorized-app auth both satisfy the account borrow boundary.
|
|
73
|
+
*/
|
|
74
|
+
declare function setBuilderCode(options: SetBuilderCodeOptions): (tx: Transaction) => _mysten_sui_transactions242.TransactionResult;
|
|
75
|
+
interface UnsetBuilderCodeArguments {
|
|
76
|
+
wrapper: RawTransactionArgument<string>;
|
|
77
|
+
auth: TransactionArgument;
|
|
78
|
+
}
|
|
79
|
+
interface UnsetBuilderCodeOptions {
|
|
80
|
+
package?: string;
|
|
81
|
+
arguments: UnsetBuilderCodeArguments | [wrapper: RawTransactionArgument<string>, auth: TransactionArgument];
|
|
82
|
+
config?: {
|
|
83
|
+
predictPackageId?: string;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/** Clear sticky builder-code attribution using valid owner or authorized-app auth. */
|
|
87
|
+
declare function unsetBuilderCode(options: UnsetBuilderCodeOptions): (tx: Transaction) => _mysten_sui_transactions242.TransactionResult;
|
|
88
|
+
//#endregion
|
|
89
|
+
export { predict_account_d_exports };
|
|
90
|
+
//# sourceMappingURL=predict_account.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predict_account.d.mts","names":[],"sources":["../../../src/contracts/deepbook_predict/predict_account.ts"],"mappings":";;;;;;;;;cA4Ba,UAAA,EAAU,SAAA,WAGrB,kBAAA,CAHqB,OAAA;AAAA,cAIV,WAAA,EAAW,UAAA;;;;cAOX,QAAA,EAAQ,UAAA;6FAanB,kBAAA,CAAA,OAAA;EAxBW;;;;;AAIb;;;cAqBa,WAAA,EAAW,UAAA;;;;iDArBA;;;UA8BP,oBAAA;EAChB,OAAA,EAAS,mBAAA;EACT,cAAA,EAAgB,sBAAA;EAChB,OAAA,EAAS,sBAAA;AAAA;AAAA,UAEO,kBAAA;EAChB,OAAA;EACA,SAAA,EACG,oBAAA,IAEA,OAAA,EAAS,mBAAA,EACT,cAAA,EAAgB,sBAAA,UAChB,OAAA,EAAS,sBAAA;EAEZ,MAAA;IACC,gBAAA;EAAA;AAAA;;iBAIc,WAAA,CAAY,OAAA,EAAS,kBAAA,IAK5B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;AAAA,UAQP,sBAAA;EAChB,OAAA,EAAS,mBAAA;AAAA;AAAA,UAEO,oBAAA;EAChB,OAAA;EACA,SAAA,EAAW,sBAAA,IAA0B,OAAA,EAAS,mBAAA;EAC9C,MAAA;IACC,gBAAA;EAAA;AAAA;;iBAIc,aAAA,CAAc,OAAA,EAAS,oBAAA,IAK9B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;AAAA,UAQP,uBAAA;EAChB,OAAA,EAAS,sBAAA;EACT,IAAA,EAAM,mBAAA;EACN,IAAA,EAAM,sBAAA;AAAA;AAAA,UAEU,qBAAA;EAChB,OAAA;EACA,SAAA,EACG,uBAAA,IAEA,OAAA,EAAS,sBAAA,UACT,IAAA,EAAM,mBAAA,EACN,IAAA,EAAM,sBAAA;EAET,MAAA;IACC,gBAAA;EAAA;AAAA;;;;;iBAOc,cAAA,CAAe,OAAA,EAAS,qBAAA,IAK/B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;AAAA,UAQP,yBAAA;EAChB,OAAA,EAAS,sBAAA;EACT,IAAA,EAAM,mBAAA;AAAA;AAAA,UAEU,uBAAA;EAChB,OAAA;EACA,SAAA,EACG,yBAAA,IACC,OAAA,EAAS,sBAAA,UAAgC,IAAA,EAAM,mBAAA;EACnD,MAAA;IACC,gBAAA;EAAA;AAAA;;iBAIc,gBAAA,CAAiB,OAAA,EAAS,uBAAA,IAKjC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/rolldown_runtime.mjs";
|
|
1
2
|
import { MoveStruct, MoveTuple, normalizeMoveArguments } from "../utils/index.mjs";
|
|
2
3
|
import { U256, U64 } from "../../bcs/integers.mjs";
|
|
3
4
|
import { Table } from "./deps/sui/table.mjs";
|
|
@@ -19,6 +20,16 @@ import { bcs } from "@mysten/sui/bcs";
|
|
|
19
20
|
* account `Auth`; the account package decides which owner or authorized
|
|
20
21
|
* application may obtain that mutable borrow.
|
|
21
22
|
*/
|
|
23
|
+
var predict_account_exports = /* @__PURE__ */ __exportAll({
|
|
24
|
+
Position: () => Position,
|
|
25
|
+
PositionKey: () => PositionKey,
|
|
26
|
+
PredictApp: () => PredictApp,
|
|
27
|
+
PredictData: () => PredictData,
|
|
28
|
+
builderCodeId: () => builderCodeId,
|
|
29
|
+
hasPosition: () => hasPosition,
|
|
30
|
+
setBuilderCode: () => setBuilderCode,
|
|
31
|
+
unsetBuilderCode: () => unsetBuilderCode
|
|
32
|
+
});
|
|
22
33
|
const $moduleName = "@local-pkg/deepbook_predict::predict_account";
|
|
23
34
|
const PredictApp = new MoveTuple({
|
|
24
35
|
name: `${$moduleName}::PredictApp`,
|
|
@@ -65,6 +76,18 @@ function hasPosition(options) {
|
|
|
65
76
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
66
77
|
});
|
|
67
78
|
}
|
|
79
|
+
/** Return the sticky builder-code ID, if set. */
|
|
80
|
+
function builderCodeId(options) {
|
|
81
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
82
|
+
const argumentsTypes = [null];
|
|
83
|
+
const parameterNames = ["account"];
|
|
84
|
+
return (tx) => tx.moveCall({
|
|
85
|
+
package: packageAddress,
|
|
86
|
+
module: "predict_account",
|
|
87
|
+
function: "builder_code_id",
|
|
88
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
68
91
|
/**
|
|
69
92
|
* Set sticky builder-code attribution for future trades using valid account auth.
|
|
70
93
|
* Owner auth and authorized-app auth both satisfy the account borrow boundary.
|
|
@@ -102,5 +125,5 @@ function unsetBuilderCode(options) {
|
|
|
102
125
|
}
|
|
103
126
|
|
|
104
127
|
//#endregion
|
|
105
|
-
export { PositionKey, PredictData, hasPosition, setBuilderCode, unsetBuilderCode };
|
|
128
|
+
export { PositionKey, PredictData, hasPosition, predict_account_exports, setBuilderCode, unsetBuilderCode };
|
|
106
129
|
//# sourceMappingURL=predict_account.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict_account.mjs","names":["table.Table"],"sources":["../../../src/contracts/deepbook_predict/predict_account.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Predict's per-account state, stored as an app-data slot on a shared `Account`\n * (the `account` package).\n *\n * This is Predict's account-local state: open positions and sticky builder-code\n * attribution. USDC/PLP custody lives in `Account`. The `PredictApp` witness\n * namespaces this slot, so only Predict writes it.\n *\n * Position mutations are package-internal. Builder-code configuration accepts an\n * account `Auth`; the account package decides which owner or authorized\n * application may obtain that mutable borrow.\n */\n\nimport {\n\tMoveTuple,\n\tMoveStruct,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n} from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U256, U64 } from '../../bcs/integers.js';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nimport * as table from './deps/sui/table.js';\nconst $moduleName = '@local-pkg/deepbook_predict::predict_account';\nexport const PredictApp = new MoveTuple({\n\tname: `${$moduleName}::PredictApp`,\n\tfields: [bcs.bool()],\n});\nexport const PositionKey = new MoveStruct({\n\tname: `${$moduleName}::PositionKey`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\torder_id: U256,\n\t},\n});\nexport const Position = new MoveStruct({\n\tname: `${$moduleName}::Position`,\n\tfields: {\n\t\t/** Root order ID, carried forward unchanged across partial-close replacements. */\n\t\troot_id: U256,\n\t\t/**\n\t\t * On-chain time (`clock.timestamp_ms()`) the position was opened, carried forward\n\t\t * unchanged across partial-close replacements. A live redeem in the same timestamp\n\t\t * is rejected, blocking an atomic mint -> oracle-update -> redeem in one\n\t\t * transaction.\n\t\t */\n\t\topened_at_ms: U64,\n\t},\n});\nexport const PredictData = new MoveStruct({\n\tname: `${$moduleName}::PredictData`,\n\tfields: {\n\t\t/** Open positions scoped by expiry market. */\n\t\tpositions: table.Table,\n\t\t/** Sticky builder-code attribution for future trades, if set. */\n\t\tbuilder_code_id: bcs.option(bcs.Address),\n\t},\n});\nexport interface HasPositionArguments {\n\taccount: TransactionArgument;\n\texpiryMarketId: RawTransactionArgument<string>;\n\torderId: RawTransactionArgument<number | bigint>;\n}\nexport interface HasPositionOptions {\n\tpackage?: string;\n\targuments:\n\t\t| HasPositionArguments\n\t\t| [\n\t\t\t\taccount: TransactionArgument,\n\t\t\t\texpiryMarketId: RawTransactionArgument<string>,\n\t\t\t\torderId: RawTransactionArgument<number | bigint>,\n\t\t ];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return whether an account holds a position for SDK and devInspect state reads. */\nexport function hasPosition(options: HasPositionOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, '0x2::object::ID', 'u256'] satisfies (string | null)[];\n\tconst parameterNames = ['account', 'expiryMarketId', 'orderId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'predict_account',\n\t\t\tfunction: 'has_position',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface BuilderCodeIdArguments {\n\taccount: TransactionArgument;\n}\nexport interface BuilderCodeIdOptions {\n\tpackage?: string;\n\targuments: BuilderCodeIdArguments | [account: TransactionArgument];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the sticky builder-code ID, if set. */\nexport function builderCodeId(options: BuilderCodeIdOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['account'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'predict_account',\n\t\t\tfunction: 'builder_code_id',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SetBuilderCodeArguments {\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tcode: RawTransactionArgument<string>;\n}\nexport interface SetBuilderCodeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| SetBuilderCodeArguments\n\t\t| [\n\t\t\t\twrapper: RawTransactionArgument<string>,\n\t\t\t\tauth: TransactionArgument,\n\t\t\t\tcode: RawTransactionArgument<string>,\n\t\t ];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Set sticky builder-code attribution for future trades using valid account auth.\n * Owner auth and authorized-app auth both satisfy the account borrow boundary.\n */\nexport function setBuilderCode(options: SetBuilderCodeOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['wrapper', 'auth', 'code'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'predict_account',\n\t\t\tfunction: 'set_builder_code',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface UnsetBuilderCodeArguments {\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n}\nexport interface UnsetBuilderCodeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| UnsetBuilderCodeArguments\n\t\t| [wrapper: RawTransactionArgument<string>, auth: TransactionArgument];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Clear sticky builder-code attribution using valid owner or authorized-app auth. */\nexport function unsetBuilderCode(options: UnsetBuilderCodeOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['wrapper', 'auth'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'predict_account',\n\t\t\tfunction: 'unset_builder_code',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"predict_account.mjs","names":["table.Table"],"sources":["../../../src/contracts/deepbook_predict/predict_account.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Predict's per-account state, stored as an app-data slot on a shared `Account`\n * (the `account` package).\n *\n * This is Predict's account-local state: open positions and sticky builder-code\n * attribution. USDC/PLP custody lives in `Account`. The `PredictApp` witness\n * namespaces this slot, so only Predict writes it.\n *\n * Position mutations are package-internal. Builder-code configuration accepts an\n * account `Auth`; the account package decides which owner or authorized\n * application may obtain that mutable borrow.\n */\n\nimport {\n\tMoveTuple,\n\tMoveStruct,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n} from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U256, U64 } from '../../bcs/integers.js';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nimport * as table from './deps/sui/table.js';\nconst $moduleName = '@local-pkg/deepbook_predict::predict_account';\nexport const PredictApp = new MoveTuple({\n\tname: `${$moduleName}::PredictApp`,\n\tfields: [bcs.bool()],\n});\nexport const PositionKey = new MoveStruct({\n\tname: `${$moduleName}::PositionKey`,\n\tfields: {\n\t\texpiry_market_id: bcs.Address,\n\t\torder_id: U256,\n\t},\n});\nexport const Position = new MoveStruct({\n\tname: `${$moduleName}::Position`,\n\tfields: {\n\t\t/** Root order ID, carried forward unchanged across partial-close replacements. */\n\t\troot_id: U256,\n\t\t/**\n\t\t * On-chain time (`clock.timestamp_ms()`) the position was opened, carried forward\n\t\t * unchanged across partial-close replacements. A live redeem in the same timestamp\n\t\t * is rejected, blocking an atomic mint -> oracle-update -> redeem in one\n\t\t * transaction.\n\t\t */\n\t\topened_at_ms: U64,\n\t},\n});\nexport const PredictData = new MoveStruct({\n\tname: `${$moduleName}::PredictData`,\n\tfields: {\n\t\t/** Open positions scoped by expiry market. */\n\t\tpositions: table.Table,\n\t\t/** Sticky builder-code attribution for future trades, if set. */\n\t\tbuilder_code_id: bcs.option(bcs.Address),\n\t},\n});\nexport interface HasPositionArguments {\n\taccount: TransactionArgument;\n\texpiryMarketId: RawTransactionArgument<string>;\n\torderId: RawTransactionArgument<number | bigint>;\n}\nexport interface HasPositionOptions {\n\tpackage?: string;\n\targuments:\n\t\t| HasPositionArguments\n\t\t| [\n\t\t\t\taccount: TransactionArgument,\n\t\t\t\texpiryMarketId: RawTransactionArgument<string>,\n\t\t\t\torderId: RawTransactionArgument<number | bigint>,\n\t\t ];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return whether an account holds a position for SDK and devInspect state reads. */\nexport function hasPosition(options: HasPositionOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, '0x2::object::ID', 'u256'] satisfies (string | null)[];\n\tconst parameterNames = ['account', 'expiryMarketId', 'orderId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'predict_account',\n\t\t\tfunction: 'has_position',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface BuilderCodeIdArguments {\n\taccount: TransactionArgument;\n}\nexport interface BuilderCodeIdOptions {\n\tpackage?: string;\n\targuments: BuilderCodeIdArguments | [account: TransactionArgument];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Return the sticky builder-code ID, if set. */\nexport function builderCodeId(options: BuilderCodeIdOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['account'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'predict_account',\n\t\t\tfunction: 'builder_code_id',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SetBuilderCodeArguments {\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n\tcode: RawTransactionArgument<string>;\n}\nexport interface SetBuilderCodeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| SetBuilderCodeArguments\n\t\t| [\n\t\t\t\twrapper: RawTransactionArgument<string>,\n\t\t\t\tauth: TransactionArgument,\n\t\t\t\tcode: RawTransactionArgument<string>,\n\t\t ];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/**\n * Set sticky builder-code attribution for future trades using valid account auth.\n * Owner auth and authorized-app auth both satisfy the account borrow boundary.\n */\nexport function setBuilderCode(options: SetBuilderCodeOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['wrapper', 'auth', 'code'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'predict_account',\n\t\t\tfunction: 'set_builder_code',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface UnsetBuilderCodeArguments {\n\twrapper: RawTransactionArgument<string>;\n\tauth: TransactionArgument;\n}\nexport interface UnsetBuilderCodeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| UnsetBuilderCodeArguments\n\t\t| [wrapper: RawTransactionArgument<string>, auth: TransactionArgument];\n\tconfig?: {\n\t\tpredictPackageId?: string;\n\t};\n}\n/** Clear sticky builder-code attribution using valid owner or authorized-app auth. */\nexport function unsetBuilderCode(options: UnsetBuilderCodeOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['wrapper', 'auth'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'predict_account',\n\t\t\tfun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