import { ConfigValue, MoveStruct, RawTransactionArgument } from "../utils/index.mjs"; import * as _mysten_sui_bcs52 from "@mysten/sui/bcs"; import * as _mysten_sui_transactions260 from "@mysten/sui/transactions"; import { Transaction, TransactionArgument } from "@mysten/sui/transactions"; //#region src/contracts/deepbook_predict/plp.d.ts declare namespace plp_d_exports { export { ActiveExpiryMarketsArguments, ActiveExpiryMarketsOptions, ActiveLiveExpiryCountArguments, ActiveLiveExpiryCountOptions, AddUsdcToPlpArguments, AddUsdcToPlpOptions, CancelSupplyRequestArguments, CancelSupplyRequestOptions, CancelWithdrawRequestArguments, CancelWithdrawRequestOptions, FeeIncentiveReserveArguments, FeeIncentiveReserveOptions, FinishFlushArguments, FinishFlushOptions, IdArguments, IdOptions, IdleBalanceArguments, IdleBalanceOptions, LockCapitalArguments, LockCapitalOptions, PLP, PendingProtocolProfitArguments, PendingProtocolProfitOptions, PlpTotalSupplyArguments, PlpTotalSupplyOptions, PoolValuation, PoolValuationProof, PoolVault, ProfitBasisCreditsArguments, ProfitBasisCreditsOptions, ProfitBasisDebitsArguments, ProfitBasisDebitsOptions, ProtocolReserveBalanceArguments, ProtocolReserveBalanceOptions, RebalanceExpiryCashArguments, RebalanceExpiryCashOptions, RequestSupplyArguments, RequestSupplyOptions, RequestWithdrawArguments, RequestWithdrawOptions, SealValuationSnapshotArguments, SealValuationSnapshotOptions, SnapshotExpiryPricerArguments, SnapshotExpiryPricerOptions, SnapshotStage, SponsorFeeIncentivesArguments, SponsorFeeIncentivesOptions, StartPoolValuationArguments, StartPoolValuationOptions, SupplyRequestsPendingArguments, SupplyRequestsPendingOptions, ValueExpiryArguments, ValueExpiryOptions, WithdrawFeeIncentivesArguments, WithdrawFeeIncentivesOptions, WithdrawRequestsPendingArguments, WithdrawRequestsPendingOptions, activeExpiryMarkets, activeLiveExpiryCount, addUsdcToPlp, cancelSupplyRequest, cancelWithdrawRequest, feeIncentiveReserve, finishFlush, id, idleBalance, lockCapital, pendingProtocolProfit, plpTotalSupply, profitBasisCredits, profitBasisDebits, protocolReserveBalance, rebalanceExpiryCash, requestSupply, requestWithdraw, sealValuationSnapshot, snapshotExpiryPricer, sponsorFeeIncentives, startPoolValuation, supplyRequestsPending, valueExpiry, withdrawFeeIncentives, withdrawRequestsPending }; } declare const PLP: MoveStruct<{ dummy_field: _mysten_sui_bcs52.BcsType; }, "@local-pkg/deepbook_predict::plp::PLP">; declare const PoolValuationProof: MoveStruct<{ dummy_field: _mysten_sui_bcs52.BcsType; }, "@local-pkg/deepbook_predict::plp::PoolValuationProof">; declare const SnapshotStage: MoveStruct<{ dummy_field: _mysten_sui_bcs52.BcsType; }, "@local-pkg/deepbook_predict::plp::SnapshotStage">; declare const PoolValuation: MoveStruct<{ /** Active expiry markets snapshotted at start; every one must be valued. */expected_expiry_markets: _mysten_sui_bcs52.BcsType> & { length: number; }, string>; /** Markets valued so far this flush; folded against `expected` at finish. */ valued_expiry_markets: _mysten_sui_bcs52.BcsType> & { length: number; }, string>; /** Running Σ of each valued market's snapshot NAV (settled markets contribute 0). */ total_nav: _mysten_sui_bcs52.BcsType; /** * Oracle state frozen during the snapshot stage, one entry per expected market. * Keyed by market id so a `Pricer` can never be applied to the wrong market. * `none` marks a market that was already settled at snapshot time and therefore * contributes 0. This map is what makes the valuation stage deterministic: it * decides both the mark AND the sweep-vs-value branch, so no later transaction's * clock or oracle state can change a market's contribution. */ frozen_pricers: MoveStruct<{ contents: _mysten_sui_bcs52.BcsType<{ key: string; value: { expiry_market_id: string; forward: bigint; svi: { a_magnitude: bigint; a_is_negative: boolean; b: bigint; rho: { magnitude: bigint; is_negative: boolean; }; m: { magnitude: bigint; is_negative: boolean; }; sigma: bigint; }; pyth_spot_source_timestamp_ms: bigint; block_scholes_spot_source_timestamp_ms: bigint; block_scholes_forward_source_timestamp_ms: bigint; block_scholes_svi_source_timestamp_ms: bigint; } | null; }[], Iterable<{ key: string | Uint8Array; value: { expiry_market_id: string | Uint8Array; forward: string | number | bigint; svi: { a_magnitude: string | number | bigint; a_is_negative: boolean; b: string | number | bigint; rho: { magnitude: string | number | bigint; is_negative: boolean; }; m: { magnitude: string | number | bigint; is_negative: boolean; }; sigma: string | number | bigint; }; pyth_spot_source_timestamp_ms: string | number | bigint; block_scholes_spot_source_timestamp_ms: string | number | bigint; block_scholes_forward_source_timestamp_ms: string | number | bigint; block_scholes_svi_source_timestamp_ms: string | number | bigint; } | null | undefined; }> & { length: number; }, string>; }, "0x2::vec_map::VecMap>">; /** * Set by `seal_valuation_snapshot`; no market may be valued before it. Nothing may * be snapshotted after it because sealing consumes the `SnapshotStage`. */ sealed: _mysten_sui_bcs52.BcsType; /** Clock time the flush was started, for the stuck-flush deadline. */ started_at_ms: _mysten_sui_bcs52.BcsType; /** * Drain budgets committed at start (the cap owner's choice), bounding how many * requests each queue processes at finish. `finish_flush` takes no budget, so the * flush operator who completes it drains at exactly these. */ supply_budget: _mysten_sui_bcs52.BcsType">; withdraw_budget: _mysten_sui_bcs52.BcsType">; /** * Each LP queue's `next_index` at the snapshot instant: the drain fills only * requests indexed strictly below these, so nobody can watch the frozen mark form * and then submit against a price they already know is stale. */ supply_request_cutoff: _mysten_sui_bcs52.BcsType; withdraw_request_cutoff: _mysten_sui_bcs52.BcsType; /** * Vault-side figures captured by `seal_valuation_snapshot`. With every market's * cash frozen in its stamp and these frozen here, the mark is a pure function of * the snapshot instant: no in-window cash move — maintenance, settled sweep, * market funding, reserve realization — can reach it. Settled members are swept * during the snapshot stage, so their recoverable cash sits inside * `frozen_idle_balance`. */ frozen_idle_balance: _mysten_sui_bcs52.BcsType; frozen_profit_basis_credits: _mysten_sui_bcs52.BcsType; frozen_profit_basis_debits: _mysten_sui_bcs52.BcsType; frozen_pending_protocol_profit: _mysten_sui_bcs52.BcsType; }, "@local-pkg/deepbook_predict::plp::PoolValuation">; declare const PoolVault: MoveStruct<{ id: _mysten_sui_bcs52.BcsType, "bytes[32]">; /** * Protocol-owned USDC excluded from PLP redemption. No package entrypoint * withdraws this balance. */ protocol_reserve_balance: MoveStruct<{ value: _mysten_sui_bcs52.BcsType; }, "0x2::balance::Balance">; /** * Sponsor-funded USDC reserved for taker fee sponsorship, excluded from PLP NAV. * Admin may reclaim it through `withdraw_fee_incentives`. */ fee_incentive_reserve: MoveStruct<{ value: _mysten_sui_bcs52.BcsType; }, "0x2::balance::Balance">; /** PLP share issuance plus queued supply/withdraw escrow. */ lp: MoveStruct<{ treasury_cap: MoveStruct<{ id: _mysten_sui_bcs52.BcsType, "bytes[32]">; total_supply: MoveStruct<{ value: _mysten_sui_bcs52.BcsType; }, "0x2::balance::Supply">; }, "0x2::coin::TreasuryCap">; supply_queue: MoveStruct<{ pages: MoveStruct<{ id: _mysten_sui_bcs52.BcsType, "bytes[32]">; size: _mysten_sui_bcs52.BcsType; }, "0x2::table::Table">; head_page_id: _mysten_sui_bcs52.BcsType">; tail_page_id: _mysten_sui_bcs52.BcsType">; next_index: _mysten_sui_bcs52.BcsType; pending: _mysten_sui_bcs52.BcsType; escrow: MoveStruct<{ value: _mysten_sui_bcs52.BcsType; }, "0x2::balance::Balance">; }, "@local-pkg/deepbook_predict::lp_book::RequestQueue">; withdraw_queue: MoveStruct<{ pages: MoveStruct<{ id: _mysten_sui_bcs52.BcsType, "bytes[32]">; size: _mysten_sui_bcs52.BcsType; }, "0x2::table::Table">; head_page_id: _mysten_sui_bcs52.BcsType">; tail_page_id: _mysten_sui_bcs52.BcsType">; next_index: _mysten_sui_bcs52.BcsType; pending: _mysten_sui_bcs52.BcsType; escrow: MoveStruct<{ value: _mysten_sui_bcs52.BcsType; }, "0x2::balance::Balance">; }, "@local-pkg/deepbook_predict::lp_book::RequestQueue">; locked_lp: MoveStruct<{ value: _mysten_sui_bcs52.BcsType; }, "0x2::balance::Balance">; }, "@local-pkg/deepbook_predict::lp_book::LpBook">; /** Idle USDC custody, registered expiries, and per-expiry cash-flow rows. */ expiry_accounting: MoveStruct<{ idle_balance: MoveStruct<{ value: _mysten_sui_bcs52.BcsType; }, "0x2::balance::Balance">; active_expiry_markets: _mysten_sui_bcs52.BcsType<{ expiry_market_id: string; expiry_ms: bigint; }[], Iterable<{ expiry_market_id: string | Uint8Array; expiry_ms: string | number | bigint; }> & { length: number; }, string>; registered_expiries: MoveStruct<{ id: _mysten_sui_bcs52.BcsType, "bytes[32]">; size: _mysten_sui_bcs52.BcsType; }, "0x2::table::Table">; profit_basis_debits: _mysten_sui_bcs52.BcsType; profit_basis_credits: _mysten_sui_bcs52.BcsType; net_losses_to_fill: _mysten_sui_bcs52.BcsType; pending_protocol_profit: _mysten_sui_bcs52.BcsType; }, "@local-pkg/deepbook_predict::pool_accounting::Ledger">; /** * In-flight full-pool valuation, held across transactions. `Some` exactly while * the `ProtocolConfig` valuation flag is engaged. */ valuation: _mysten_sui_bcs52.BcsType<{ expected_expiry_markets: string[]; valued_expiry_markets: string[]; total_nav: bigint; frozen_pricers: { contents: { key: string; value: { expiry_market_id: string; forward: bigint; svi: { a_magnitude: bigint; a_is_negative: boolean; b: bigint; rho: { magnitude: bigint; is_negative: boolean; }; m: { magnitude: bigint; is_negative: boolean; }; sigma: bigint; }; pyth_spot_source_timestamp_ms: bigint; block_scholes_spot_source_timestamp_ms: bigint; block_scholes_forward_source_timestamp_ms: bigint; block_scholes_svi_source_timestamp_ms: bigint; } | null; }[]; }; sealed: boolean; started_at_ms: bigint; supply_budget: bigint | null; withdraw_budget: bigint | null; supply_request_cutoff: bigint; withdraw_request_cutoff: bigint; frozen_idle_balance: bigint; frozen_profit_basis_credits: bigint; frozen_profit_basis_debits: bigint; frozen_pending_protocol_profit: bigint; } | null, { expected_expiry_markets: Iterable> & { length: number; }; valued_expiry_markets: Iterable> & { length: number; }; total_nav: string | number | bigint; frozen_pricers: { contents: Iterable<{ key: string | Uint8Array; value: { expiry_market_id: string | Uint8Array; forward: string | number | bigint; svi: { a_magnitude: string | number | bigint; a_is_negative: boolean; b: string | number | bigint; rho: { magnitude: string | number | bigint; is_negative: boolean; }; m: { magnitude: string | number | bigint; is_negative: boolean; }; sigma: string | number | bigint; }; pyth_spot_source_timestamp_ms: string | number | bigint; block_scholes_spot_source_timestamp_ms: string | number | bigint; block_scholes_forward_source_timestamp_ms: string | number | bigint; block_scholes_svi_source_timestamp_ms: string | number | bigint; } | null | undefined; }> & { length: number; }; }; sealed: boolean; started_at_ms: string | number | bigint; supply_budget: string | number | bigint | null | undefined; withdraw_budget: string | number | bigint | null | undefined; supply_request_cutoff: string | number | bigint; withdraw_request_cutoff: string | number | bigint; frozen_idle_balance: string | number | bigint; frozen_profit_basis_credits: string | number | bigint; frozen_profit_basis_debits: string | number | bigint; frozen_pending_protocol_profit: string | number | bigint; } | null | undefined, "Option<@local-pkg/deepbook_predict::plp::PoolValuation>">; }, "@local-pkg/deepbook_predict::plp::PoolVault">; interface IdArguments { vault?: RawTransactionArgument; } interface IdOptions { package?: string; arguments?: IdArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return the pool vault object ID for external discovery and PTB construction. */ declare function id(options: IdOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface IdleBalanceArguments { vault?: RawTransactionArgument; } interface IdleBalanceOptions { package?: string; arguments?: IdleBalanceArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return idle USDC for SDK and devInspect state reads. */ declare function idleBalance(options: IdleBalanceOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface ProtocolReserveBalanceArguments { vault?: RawTransactionArgument; } interface ProtocolReserveBalanceOptions { package?: string; arguments?: ProtocolReserveBalanceArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return protocol-owned USDC for SDK and devInspect state reads. */ declare function protocolReserveBalance(options: ProtocolReserveBalanceOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface FeeIncentiveReserveArguments { vault?: RawTransactionArgument; } interface FeeIncentiveReserveOptions { package?: string; arguments?: FeeIncentiveReserveArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return sponsor-funded fee reserves for SDK and devInspect state reads. */ declare function feeIncentiveReserve(options: FeeIncentiveReserveOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface PlpTotalSupplyArguments { vault?: RawTransactionArgument; } interface PlpTotalSupplyOptions { package?: string; arguments?: PlpTotalSupplyArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return total PLP supply for SDK and devInspect state reads. */ declare function plpTotalSupply(options: PlpTotalSupplyOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface SupplyRequestsPendingArguments { vault?: RawTransactionArgument; } interface SupplyRequestsPendingOptions { package?: string; arguments?: SupplyRequestsPendingArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return pending LP supply count for SDK and devInspect queue reads. */ declare function supplyRequestsPending(options: SupplyRequestsPendingOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface WithdrawRequestsPendingArguments { vault?: RawTransactionArgument; } interface WithdrawRequestsPendingOptions { package?: string; arguments?: WithdrawRequestsPendingArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return pending LP withdrawal count for SDK and devInspect queue reads. */ declare function withdrawRequestsPending(options: WithdrawRequestsPendingOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface ActiveExpiryMarketsArguments { vault?: RawTransactionArgument; } interface ActiveExpiryMarketsOptions { package?: string; arguments?: ActiveExpiryMarketsArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return active expiry IDs for external PTB construction and pool inspection. */ declare function activeExpiryMarkets(options: ActiveExpiryMarketsOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface ActiveLiveExpiryCountArguments { vault?: RawTransactionArgument; } interface ActiveLiveExpiryCountOptions { package?: string; arguments?: ActiveLiveExpiryCountArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return the pre-expiry active count for SDK and devInspect capacity reads. */ declare function activeLiveExpiryCount(options: ActiveLiveExpiryCountOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface ProfitBasisDebitsArguments { vault?: RawTransactionArgument; } interface ProfitBasisDebitsOptions { package?: string; arguments?: ProfitBasisDebitsArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return the profit-basis debits for external accounting observability. */ declare function profitBasisDebits(options: ProfitBasisDebitsOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface ProfitBasisCreditsArguments { vault?: RawTransactionArgument; } interface ProfitBasisCreditsOptions { package?: string; arguments?: ProfitBasisCreditsArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return the profit-basis credits for external accounting observability. */ declare function profitBasisCredits(options: ProfitBasisCreditsOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface PendingProtocolProfitArguments { vault?: RawTransactionArgument; } interface PendingProtocolProfitOptions { package?: string; arguments?: PendingProtocolProfitArguments; config?: { poolVault: ConfigValue; predictPackageId?: string; }; } /** Return deferred protocol profit for external accounting observability. */ declare function pendingProtocolProfit(options: PendingProtocolProfitOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface StartPoolValuationArguments { config?: RawTransactionArgument; vault?: RawTransactionArgument; valuationProof: TransactionArgument; supplyBudget: RawTransactionArgument; withdrawBudget: RawTransactionArgument; } interface StartPoolValuationOptions { package?: string; arguments: StartPoolValuationArguments; config?: { protocolConfig: ConfigValue; poolVault: ConfigValue; predictPackageId?: string; }; } /** * Begin a full-pool valuation using a registry-issued pool-valuation proof. The * proof grants control over when current oracle state is frozen for queued LP * fills. Starting engages the cross-transaction valuation flag, snapshots the * active expiry set and each LP queue's eligibility cutoff, and opens the atomic * snapshot stage: freeze every active market's pricer under the returned * `SnapshotStage`, then seal it in the same transaction. */ declare function startPoolValuation(options: StartPoolValuationOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface SnapshotExpiryPricerArguments { vault?: RawTransactionArgument; Stage: TransactionArgument; market: RawTransactionArgument; config?: RawTransactionArgument; propbookRegistry?: RawTransactionArgument; pyth: RawTransactionArgument; bsValues: RawTransactionArgument; bsSvi: RawTransactionArgument; } interface SnapshotExpiryPricerOptions { package?: string; arguments: SnapshotExpiryPricerArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; oracleRegistry: ConfigValue; predictPackageId?: string; }; } /** * Freeze one snapshotted market's oracle state for this flush and stamp the * market, capturing its cash rows and activating its payout-tree snapshot at this * instant. * * Holding `SnapshotStage` is what admits this call, and that potato cannot leave * the transaction `start_pool_valuation` minted it in — so every `Pricer` here is * loaded at one instant, which is what lets the valuation stage span transactions * without mixing marks (audit L10). This stage reads oracles only — it never walks * a payout tree — so all markets fit one PTB regardless of book size. * * The oracle feeding this stage must have been written in an EARLIER transaction: * `pricing::resolve_live` refuses a read stamped with the current transaction * digest (RP-24), so a keeper cannot refresh and snapshot in one PTB. * * A market already settled at snapshot time is recorded with no pricer, gets no * stamp (settled flows never touch live NAV), and contributes 0. An * expired-but-unsettled market aborts: it has no well-defined mark, and because * this stage is atomic the abort reverts the whole snapshot transaction, so the * flag is never left engaged. Settle it first, then start the flush; settlement is * never blocked by a flush, so that ordering is always available. */ declare function snapshotExpiryPricer(options: SnapshotExpiryPricerOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface SealValuationSnapshotArguments { vault?: RawTransactionArgument; stage: TransactionArgument; config?: RawTransactionArgument; } interface SealValuationSnapshotOptions { package?: string; arguments: SealValuationSnapshotArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Close the snapshot stage once every expected market has a frozen pricer, and * freeze the vault-side figures — idle, the profit basis, the pending protocol cut * — completing the snapshot. * * Consuming `SnapshotStage` is the simultaneity proof: the potato dies here, so no * later transaction can add oracle state to this flush, and every market is marked * at the instant the snapshot transaction executed. The vault capture is * consistent with the per-market stamps because `rebalance_expiry_cash` refuses to * run while the stage is open (`ESnapshotStageOpen`), so no idle↔market move can * land between a stamp and this capture. Valuation may then resume across as many * transactions as it needs. */ declare function sealValuationSnapshot(options: SealValuationSnapshotOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface ValueExpiryArguments { vault?: RawTransactionArgument; market: RawTransactionArgument; config?: RawTransactionArgument; } interface ValueExpiryOptions { package?: string; arguments: ValueExpiryArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Fold one snapshotted market's SNAPSHOT-INSTANT NAV into the running total. A * market frozen as settled is swept and contributes 0; one frozen with a pricer is * valued via `expiry_market::snapshot_nav` over its captured cash and tree * shadows, then has its stamp cleared (releasing the tree snapshot), so later * trades and the next flush start clean. * * The resumable stage: any transaction after the seal, one market per transaction * (`constants::max_payout_tree_nodes`), reading no oracle and no clock. * MEASUREMENT-ONLY for every member — settled members were swept during the * snapshot stage and every frozen figure was captured there, so this call moves no * cash and `rebalance_expiry_cash` runs at any time. A market that expired * mid-window is valued at its frozen pre-expiry mark; its settlement does not wait * for this call, because settlement is never blocked by a flush. */ declare function valueExpiry(options: ValueExpiryOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface FinishFlushArguments { vault?: RawTransactionArgument; config?: RawTransactionArgument; } interface FinishFlushOptions { package?: string; arguments?: FinishFlushArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Finish a full-pool valuation and run the LP flush: prove every snapshotted * market was valued exactly once, price the pool NAV, then drain the * supply/withdraw queues at that frozen mark (mint PLP for supplies, burn PLP and * pay USDC for withdrawals), release the valuation flag, retire the in-flight * valuation, and return the LP-attributable pool-wide USDC NAV (frozen idle + Σ * active NAV, net of the pending-protocol-profit exclusion priced from the frozen * profit basis — every term as of the snapshot instant). Each drain fills only * requests submitted before the flush's snapshot instant (the recorded queue * cutoffs); younger requests wait for the next mark. * * `supply_budget` and `withdraw_budget` bound how many requests each queue may * process this flush (`None` = unbounded). Fills — whole or partial — and * protocol-refunded heads — non-executable, or quoting below the request's own * minimum output — all count as processed. At `ProtocolConfig`'s shipped attempt * count of one, a head that misses its limit is refunded by the flush that reaches * it; above one it stays queued and stops that queue for the flush. The budgets * are independent, so a supply backlog does not consume withdrawal capacity. * * Capacity bounds each pass on top of the budgets and refunds nothing: supplies * fill only up to `ProtocolConfig`'s LP pool-value cap, withdrawals only up to * idle. A head larger than the room left fills to the room, spends flush budget, * and keeps its remainder queued at a rescaled limit; a head with no usable room * carries untouched and spends none. Either way the pass stops, so an unbounded * budget does not mean every queued request is processed (RP-23). * * Because queueing is permissionless and a refunded request returns its escrow in * the same transaction, an operator should bound both budgets in production rather * than rely on queue length staying small — see RP-12. * * Only an allowlisted flush operator may call it * (`protocol_config::ENotFlushOperator`). Fills move idle cash, so restricting who * completes a flush keeps idle predictable for the keeper that funds markets for * queued orders. */ declare function finishFlush(options: FinishFlushOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface RebalanceExpiryCashArguments { vault?: RawTransactionArgument; market: RawTransactionArgument; config?: RawTransactionArgument; } interface RebalanceExpiryCashOptions { package?: string; arguments: RebalanceExpiryCashArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Move cash between pool idle liquidity and one expiry market. * * Permissionless and standalone: anyone may call it at any cadence. Handles all * three per-market cases — initial funding of a freshly registered (unfunded) * market, ongoing live rebalance/surplus-sweep toward target, and the * settled-market sweep (deactivate, return all free cash, materialize profit). The * live target covers the market's queued orders' cash need (the waiting cash need * in `expiry_market::order_flow_state`), so the keeper calls this after each * enqueue to fund those orders' fills, and a sweep never takes that cash back. * Call `expiry_market::try_settle` first in the same PTB when settlement may be * due. An expired unsettled market is a no-op until that transition succeeds. Mint * asserts backing but never pulls pool cash, so this is what makes a market * mintable. The market must already be registered to this vault * (`registry::create_and_share_expiry_market`). Runs at any time, including while * a flush is in flight — every figure the mark reads was frozen at the snapshot * instant, so no move here can reach it. The one refusal is the still-open * snapshot stage (start → seal, a single transaction): a cross-move landing * between a market's stamp and the seal's vault capture would skew the frozen * figures, so it is structurally rejected rather than corrected for. */ declare function rebalanceExpiryCash(options: RebalanceExpiryCashOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface SponsorFeeIncentivesArguments { vault?: RawTransactionArgument; config?: RawTransactionArgument; payment: RawTransactionArgument; } interface SponsorFeeIncentivesOptions { package?: string; arguments: SponsorFeeIncentivesArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Sponsor taker fee incentives with USDC. Anyone may contribute; the payment joins * a pool-level reserve that is excluded from PLP NAV and later allocated to expiry * markets by the normal rebalance flow. A contribution is not earmarked to its * sponsor: admin can withdraw any of the reserve through * `withdraw_fee_incentives`. */ declare function sponsorFeeIncentives(options: SponsorFeeIncentivesOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface WithdrawFeeIncentivesArguments { vault?: RawTransactionArgument; AdminCap: RawTransactionArgument; config?: RawTransactionArgument; amount: RawTransactionArgument; } interface WithdrawFeeIncentivesOptions { package?: string; arguments: WithdrawFeeIncentivesArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Withdraw `amount` USDC of sponsor-funded fee incentives from the pool-level * reserve, for sponsorship the protocol no longer wants to spend. Admin-only. * * Reaches the reserve only. Incentives already allocated to a live market stay in * that market's `fee_incentive_balance` and return to the reserve when its * settled-market sweep runs, after which they can be withdrawn here; setting * `protocol_config::set_fee_incentive_subsidy_rate` to zero stops them being spent * in the meantime. The per-expiry lifetime allocation counters are not credited * back: they bound what a market may ever receive, and a withdrawal does not * change what a market already received. * * Not gated on the valuation flag, in either stage of a flush: the reserve is * excluded from PLP NAV and no flush figure, frozen or live, reads it, so a * withdrawal cannot reach the mark. */ declare function withdrawFeeIncentives(options: WithdrawFeeIncentivesOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface AddUsdcToPlpArguments { vault?: RawTransactionArgument; config?: RawTransactionArgument; payment: RawTransactionArgument; } interface AddUsdcToPlpOptions { package?: string; arguments: AddUsdcToPlpArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Add USDC straight to pool idle liquidity without minting any PLP. Anyone may * call it; the payment is an outright gift to the existing share base, so the * caller receives nothing back and no share of it is recoverable. * * This is the incentive/top-up path: because no shares are issued, the whole * `payment` lands inside the value the next flush's mark divides by an unchanged * `total_supply`, which raises NAV per PLP for every current holder. It * deliberately does not touch the profit basis — the basis tracks cash sent to and * returned from expiries, so an outside contribution is neither a debit nor a * credit, and the protocol reserve therefore takes no cut of it (`pool_value` * leaves `exclusion` unchanged while `gross_pool_value` grows). Sending the same * USDC through `request_supply` instead mints shares against it, so only the * supply fee would reach existing holders — zero as shipped. * * Three gates, each closing a state this entrypoint would otherwise manufacture: * * - **Bootstrapped pool.** At `total_supply == 0` there is no share base to * credit; the USDC would only inflate the genesis lock's non-withdrawable stake. * - **Contribution price ceiling.** Pool cash after the contribution — idle plus * the net cash deployed into active expiries — may price at most * `contribution_price_ceiling_factor` USDC per PLP, a tenth of the band a flush * mark needs to be fillable. Above the band every supply and withdraw head is * refunded (RP-2) and `total_supply` grows only through a supply fill, so * nothing brings the price back down — a terminal state that an unbounded * contribution against a small share base would otherwise reach for the price of * the contribution. The ceiling sits well inside the band because later fills * only push the price up (rounding and retained fees stay in the pool), so a * pool left exactly at the band would leave it on the next uneven or fee-charged * fill. The test is one-sided because a contribution can only move the price up. * It reads pool cash rather than pool NAV — NAV needs a flush — and counts * deployed cash because the mark does: `rebalance_expiry_cash` is * permissionless, so an idle-only test could be emptied into a market and passed * again. Cash is exactly the protocol-controlled share: the guard forbids this * entrypoint from _manufacturing_ the degenerate ratio and leaves market-driven * NAV moves (trader premiums and P&L) to RP-1/RP-2, which own them. * - **No flush in flight.** The seal freezes idle mid-flush, so an ungated * contribution would land on one side or the other of that capture depending * only on when the contributor's transaction executed — either paying that * flush's queued withdrawals or not. `sponsor_fee_incentives` takes the same * gate. `rebalance_expiry_cash` may run mid-window because it only moves cash * between two figures the seal already froze; new value is different. */ declare function addUsdcToPlp(options: AddUsdcToPlpOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface LockCapitalArguments { vault?: RawTransactionArgument; config?: RawTransactionArgument; AdminCap: RawTransactionArgument; payment: RawTransactionArgument; } interface LockCapitalOptions { package?: string; arguments: LockCapitalArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Bootstrap the pool exactly once: permanently lock `payment` USDC of minimum * liquidity. Mints matching PLP (1:1) into the book's locked balance — never * withdrawable, so the caller receives no shares — and joins the USDC into idle. * This keeps `total_supply > 0` while the vault exists and gives rounding dust a * non-withdrawable PLP holder. Requires root authority and zero existing supply. * Supply, withdrawal, and flush flows remain disabled until the locked liquidity * has been created. */ declare function lockCapital(options: LockCapitalOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface RequestSupplyArguments { vault?: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; config?: RawTransactionArgument; amount: RawTransactionArgument; minPlpOut: RawTransactionArgument; } interface RequestSupplyOptions { package?: string; arguments: RequestSupplyArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Queue a supply request: pull `amount` USDC from account custody into queue * escrow, recording the account's receive address as the fill recipient. The pull * auto-settles any flush-delivered USDC first. The flush charges the protocol's * supply fee — zero by default — on the USDC it takes in and prices shares on the * remainder, so `min_plp_out` is measured after that fee. The account receives * minted PLP only at a mark that mints at least `min_plp_out` for the whole * `amount` — a **price floor**, not a promise of that many shares: if the pool cap * leaves room for only part of the deposit, the fill is proportionally smaller at * the same price and the remainder stays queued with its limit rescaled. At the * shipped attempt count of one, a flush whose mark quotes less cancels and refunds * the request there and then; a higher configured count lets it rest and retry * that many flushes first. Returns the queue index, the handle used to cancel * before the flush. */ declare function requestSupply(options: RequestSupplyOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface RequestWithdrawArguments { vault?: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; config?: RawTransactionArgument; amount: RawTransactionArgument; minUsdcOut: RawTransactionArgument; } interface RequestWithdrawOptions { package?: string; arguments: RequestWithdrawArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Queue a withdraw request: pull `amount` PLP shares from account custody into * queue escrow, recording the account's receive address as the fill recipient. The * pull auto-settles any flush-delivered PLP first. The flush withholds the * protocol's withdraw fee from the marked payout, so `min_usdc_out` is measured * after the fee. The account is paid only at a mark that quotes at least * `min_usdc_out` for the whole `amount` — a **price floor**, not a promise of that * much USDC: if idle liquidity covers only part of the payout, only the shares * idle affords are burned, the fill is proportionally smaller at the same price, * and the remainder stays queued with its limit rescaled. At the shipped attempt * count of one, a flush whose mark quotes less cancels and refunds the request * there and then; a higher configured count lets it rest and retry that many * flushes first. Returns the queue index used to cancel before the flush. */ declare function requestWithdraw(options: RequestWithdrawOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface CancelSupplyRequestArguments { vault?: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; config?: RawTransactionArgument; index: RawTransactionArgument; } interface CancelSupplyRequestOptions { package?: string; arguments: CancelSupplyRequestArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Cancel a still-pending supply request, refunding its escrowed USDC straight into * the requesting account. `account` must be the request's recorded recipient. */ declare function cancelSupplyRequest(options: CancelSupplyRequestOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; interface CancelWithdrawRequestArguments { vault?: RawTransactionArgument; wrapper: RawTransactionArgument; auth: TransactionArgument; config?: RawTransactionArgument; index: RawTransactionArgument; } interface CancelWithdrawRequestOptions { package?: string; arguments: CancelWithdrawRequestArguments; config?: { poolVault: ConfigValue; protocolConfig: ConfigValue; predictPackageId?: string; }; } /** * Cancel a still-pending withdraw request, refunding its escrowed PLP straight * into the requesting account. `account` must be the request's recorded recipient. */ declare function cancelWithdrawRequest(options: CancelWithdrawRequestOptions): (tx: Transaction) => _mysten_sui_transactions260.TransactionResult; //#endregion export { plp_d_exports }; //# sourceMappingURL=plp.d.mts.map