@mysten/deepbook-v3 2.1.4 → 2.4.0

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.
Files changed (193) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/PREDICT.md +154 -48
  3. package/README.md +18 -13
  4. package/dist/account.d.mts.map +1 -1
  5. package/dist/account.mjs +3 -1
  6. package/dist/account.mjs.map +1 -1
  7. package/dist/client.d.mts +2 -2
  8. package/dist/contracts/account/account.d.mts +23 -23
  9. package/dist/contracts/account/account.d.mts.map +1 -1
  10. package/dist/contracts/account/account_events.d.mts +20 -20
  11. package/dist/contracts/account/account_registry.d.mts +19 -19
  12. package/dist/contracts/deepbook/account.d.mts +18 -18
  13. package/dist/contracts/deepbook/account.d.mts.map +1 -1
  14. package/dist/contracts/deepbook/balances.d.mts +4 -4
  15. package/dist/contracts/deepbook/balances.d.mts.map +1 -1
  16. package/dist/contracts/deepbook/deep_price.d.mts +3 -3
  17. package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
  18. package/dist/contracts/deepbook/order.d.mts +12 -12
  19. package/dist/contracts/deepbook_predict/admin.d.mts +27 -0
  20. package/dist/contracts/deepbook_predict/admin.d.mts.map +1 -0
  21. package/dist/contracts/deepbook_predict/admin.mjs +38 -0
  22. package/dist/contracts/deepbook_predict/admin.mjs.map +1 -0
  23. package/dist/contracts/deepbook_predict/builder_code.d.mts +81 -0
  24. package/dist/contracts/deepbook_predict/builder_code.d.mts.map +1 -0
  25. package/dist/contracts/deepbook_predict/builder_code.mjs +103 -0
  26. package/dist/contracts/deepbook_predict/builder_code.mjs.map +1 -0
  27. package/dist/contracts/deepbook_predict/builder_code_events.d.mts +25 -0
  28. package/dist/contracts/deepbook_predict/builder_code_events.d.mts.map +1 -0
  29. package/dist/contracts/deepbook_predict/builder_code_events.mjs +7 -1
  30. package/dist/contracts/deepbook_predict/builder_code_events.mjs.map +1 -1
  31. package/dist/contracts/deepbook_predict/config_events.d.mts +104 -0
  32. package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -0
  33. package/dist/contracts/deepbook_predict/config_events.mjs +155 -0
  34. package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -0
  35. package/dist/contracts/deepbook_predict/deps/sui/vec_map.mjs +37 -0
  36. package/dist/contracts/deepbook_predict/deps/sui/vec_map.mjs.map +1 -0
  37. package/dist/contracts/deepbook_predict/ewma_config.mjs +28 -0
  38. package/dist/contracts/deepbook_predict/ewma_config.mjs.map +1 -0
  39. package/dist/contracts/deepbook_predict/expiry_cash.mjs +1 -1
  40. package/dist/contracts/deepbook_predict/expiry_cash.mjs.map +1 -1
  41. package/dist/contracts/deepbook_predict/expiry_market.d.mts +859 -0
  42. package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -0
  43. package/dist/contracts/deepbook_predict/expiry_market.mjs +662 -7
  44. package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
  45. package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +39 -0
  46. package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts.map +1 -0
  47. package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs +51 -0
  48. package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs.map +1 -0
  49. package/dist/contracts/deepbook_predict/market_manager.d.mts +159 -0
  50. package/dist/contracts/deepbook_predict/market_manager.d.mts.map +1 -0
  51. package/dist/contracts/deepbook_predict/market_manager.mjs +88 -2
  52. package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -1
  53. package/dist/contracts/deepbook_predict/order_events.d.mts +101 -0
  54. package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -0
  55. package/dist/contracts/deepbook_predict/order_events.mjs +7 -1
  56. package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
  57. package/dist/contracts/deepbook_predict/pause_cap.d.mts +39 -0
  58. package/dist/contracts/deepbook_predict/pause_cap.d.mts.map +1 -0
  59. package/dist/contracts/deepbook_predict/pause_cap.mjs +51 -0
  60. package/dist/contracts/deepbook_predict/pause_cap.mjs.map +1 -0
  61. package/dist/contracts/deepbook_predict/plp.d.mts +801 -0
  62. package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -0
  63. package/dist/contracts/deepbook_predict/plp.mjs +511 -32
  64. package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
  65. package/dist/contracts/deepbook_predict/pool_accounting.mjs +7 -7
  66. package/dist/contracts/deepbook_predict/pool_accounting.mjs.map +1 -1
  67. package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +39 -0
  68. package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts.map +1 -0
  69. package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs +52 -0
  70. package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs.map +1 -0
  71. package/dist/contracts/deepbook_predict/predict_account.d.mts +90 -0
  72. package/dist/contracts/deepbook_predict/predict_account.d.mts.map +1 -0
  73. package/dist/contracts/deepbook_predict/predict_account.mjs +25 -2
  74. package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
  75. package/dist/contracts/deepbook_predict/pricing.d.mts +127 -0
  76. package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -0
  77. package/dist/contracts/deepbook_predict/pricing.mjs +37 -1
  78. package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
  79. package/dist/contracts/deepbook_predict/pricing_config.mjs +28 -0
  80. package/dist/contracts/deepbook_predict/pricing_config.mjs.map +1 -0
  81. package/dist/contracts/deepbook_predict/protocol_config.d.mts +665 -0
  82. package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -0
  83. package/dist/contracts/deepbook_predict/protocol_config.mjs +841 -0
  84. package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -0
  85. package/dist/contracts/deepbook_predict/range_codec.d.mts +30 -0
  86. package/dist/contracts/deepbook_predict/range_codec.d.mts.map +1 -0
  87. package/dist/contracts/deepbook_predict/range_codec.mjs +6 -1
  88. package/dist/contracts/deepbook_predict/range_codec.mjs.map +1 -1
  89. package/dist/contracts/deepbook_predict/registry.d.mts +382 -0
  90. package/dist/contracts/deepbook_predict/registry.d.mts.map +1 -0
  91. package/dist/contracts/deepbook_predict/registry.mjs +458 -2
  92. package/dist/contracts/deepbook_predict/registry.mjs.map +1 -1
  93. package/dist/contracts/deepbook_predict/strike_exposure.mjs.map +1 -1
  94. package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +13 -1
  95. package/dist/contracts/deepbook_predict/strike_payout_tree.mjs.map +1 -1
  96. package/dist/contracts/deepbook_predict/vault_events.d.mts +199 -0
  97. package/dist/contracts/deepbook_predict/vault_events.d.mts.map +1 -0
  98. package/dist/contracts/deepbook_predict/vault_events.mjs +38 -8
  99. package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
  100. package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
  101. package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -1
  102. package/dist/contracts/deepbook_sessions/sessions.d.mts +22 -22
  103. package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
  104. package/dist/deployments/index.d.mts +3 -2
  105. package/dist/deployments/index.d.mts.map +1 -1
  106. package/dist/deployments/index.mjs +4 -1
  107. package/dist/deployments/index.mjs.map +1 -1
  108. package/dist/deployments/mainnet.d.mts +14 -0
  109. package/dist/deployments/mainnet.d.mts.map +1 -0
  110. package/dist/deployments/mainnet.mjs +73 -0
  111. package/dist/deployments/mainnet.mjs.map +1 -0
  112. package/dist/deployments/testnet.mjs +23 -23
  113. package/dist/deployments/testnet.mjs.map +1 -1
  114. package/dist/deployments/types.d.mts +1 -1
  115. package/dist/predict/client.d.mts +28 -6
  116. package/dist/predict/client.d.mts.map +1 -1
  117. package/dist/predict/client.mjs +7 -6
  118. package/dist/predict/client.mjs.map +1 -1
  119. package/dist/predict/config/index.d.mts +2 -0
  120. package/dist/predict/config/index.d.mts.map +1 -1
  121. package/dist/predict/config/index.mjs +4 -1
  122. package/dist/predict/config/index.mjs.map +1 -1
  123. package/dist/predict/config/mainnet.d.mts +17 -0
  124. package/dist/predict/config/mainnet.d.mts.map +1 -0
  125. package/dist/predict/config/mainnet.mjs +26 -0
  126. package/dist/predict/config/mainnet.mjs.map +1 -0
  127. package/dist/predict/config/types.d.mts +6 -0
  128. package/dist/predict/config/types.d.mts.map +1 -1
  129. package/dist/predict/index.d.mts +21 -2
  130. package/dist/predict/index.mjs +20 -1
  131. package/dist/predict/pricing.d.mts +6 -6
  132. package/dist/predict/pricing.d.mts.map +1 -1
  133. package/dist/predict/pricing.mjs +6 -6
  134. package/dist/predict/pricing.mjs.map +1 -1
  135. package/dist/predict/reads/balances.mjs.map +1 -1
  136. package/dist/predict/reads/markets.mjs +1 -1
  137. package/dist/predict/reads/markets.mjs.map +1 -1
  138. package/dist/predict/reads/pricing.d.mts +2 -1
  139. package/dist/predict/reads/pricing.d.mts.map +1 -1
  140. package/dist/predict/reads/pricing.mjs.map +1 -1
  141. package/dist/sessions.d.mts.map +1 -1
  142. package/dist/sessions.mjs +3 -1
  143. package/dist/sessions.mjs.map +1 -1
  144. package/dist/transactions/balanceManager.d.mts +12 -12
  145. package/dist/transactions/balanceManager.d.mts.map +1 -1
  146. package/dist/transactions/deepbook.d.mts +20 -20
  147. package/dist/transactions/deepbook.d.mts.map +1 -1
  148. package/dist/transactions/deepbookAdmin.d.mts +4 -4
  149. package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
  150. package/dist/transactions/marginAdmin.d.mts +7 -7
  151. package/dist/transactions/marginLiquidations.d.mts +3 -3
  152. package/dist/transactions/marginMaintainer.d.mts +5 -5
  153. package/dist/transactions/marginManager.d.mts +32 -32
  154. package/dist/transactions/marginPool.d.mts +18 -18
  155. package/dist/transactions/marginPool.d.mts.map +1 -1
  156. package/dist/transactions/marginRegistry.d.mts +16 -16
  157. package/dist/transactions/marginTPSL.d.mts +10 -10
  158. package/dist/transactions/poolProxy.d.mts +8 -8
  159. package/package.json +3 -3
  160. package/src/account.ts +3 -1
  161. package/src/contracts/deepbook_predict/builder_code.ts +3 -3
  162. package/src/contracts/deepbook_predict/config_events.ts +9 -2
  163. package/src/contracts/deepbook_predict/deps/sui/vec_map.ts +33 -0
  164. package/src/contracts/deepbook_predict/expiry_cash.ts +1 -1
  165. package/src/contracts/deepbook_predict/expiry_market.ts +70 -11
  166. package/src/contracts/deepbook_predict/market_lifecycle_cap.ts +3 -10
  167. package/src/contracts/deepbook_predict/market_manager.ts +2 -2
  168. package/src/contracts/deepbook_predict/order_events.ts +6 -6
  169. package/src/contracts/deepbook_predict/plp.ts +263 -81
  170. package/src/contracts/deepbook_predict/pool_accounting.ts +14 -14
  171. package/src/contracts/deepbook_predict/pool_valuation_cap.ts +69 -0
  172. package/src/contracts/deepbook_predict/predict_account.ts +1 -1
  173. package/src/contracts/deepbook_predict/pricing.ts +16 -4
  174. package/src/contracts/deepbook_predict/protocol_config.ts +202 -7
  175. package/src/contracts/deepbook_predict/registry.ts +91 -17
  176. package/src/contracts/deepbook_predict/strike_exposure.ts +1 -1
  177. package/src/contracts/deepbook_predict/strike_payout_tree.ts +27 -0
  178. package/src/contracts/deepbook_predict/vault_events.ts +45 -14
  179. package/src/contracts/propbook/block_scholes_store.ts +8 -42
  180. package/src/deployments/index.ts +13 -3
  181. package/src/deployments/mainnet.ts +107 -0
  182. package/src/deployments/testnet.ts +25 -25
  183. package/src/deployments/types.ts +1 -1
  184. package/src/predict/client.ts +48 -17
  185. package/src/predict/config/index.ts +7 -2
  186. package/src/predict/config/mainnet.ts +27 -0
  187. package/src/predict/config/types.ts +7 -1
  188. package/src/predict/index.ts +31 -2
  189. package/src/predict/pricing.ts +11 -9
  190. package/src/predict/reads/balances.ts +1 -1
  191. package/src/predict/reads/markets.ts +1 -1
  192. package/src/predict/reads/pricing.ts +2 -1
  193. package/src/sessions.ts +4 -1
@@ -0,0 +1,801 @@
1
+ import { ConfigValue, MoveStruct, RawTransactionArgument } from "../utils/index.mjs";
2
+ import * as _mysten_sui_bcs109 from "@mysten/sui/bcs";
3
+ import * as _mysten_sui_transactions216 from "@mysten/sui/transactions";
4
+ import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
5
+
6
+ //#region src/contracts/deepbook_predict/plp.d.ts
7
+ declare namespace plp_d_exports {
8
+ export { ActiveExpiryMarketsArguments, ActiveExpiryMarketsOptions, ActiveLiveExpiryCountArguments, ActiveLiveExpiryCountOptions, 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, WithdrawRequestsPendingArguments, WithdrawRequestsPendingOptions, activeExpiryMarkets, activeLiveExpiryCount, cancelSupplyRequest, cancelWithdrawRequest, feeIncentiveReserve, finishFlush, id, idleBalance, lockCapital, pendingProtocolProfit, plpTotalSupply, profitBasisCredits, profitBasisDebits, protocolReserveBalance, rebalanceExpiryCash, requestSupply, requestWithdraw, sealValuationSnapshot, snapshotExpiryPricer, sponsorFeeIncentives, startPoolValuation, supplyRequestsPending, valueExpiry, withdrawRequestsPending };
9
+ }
10
+ declare const PLP: MoveStruct<{
11
+ dummy_field: _mysten_sui_bcs109.BcsType<boolean, boolean, "bool">;
12
+ }, "@local-pkg/deepbook_predict::plp::PLP">;
13
+ declare const PoolValuationProof: MoveStruct<{
14
+ dummy_field: _mysten_sui_bcs109.BcsType<boolean, boolean, "bool">;
15
+ }, "@local-pkg/deepbook_predict::plp::PoolValuationProof">;
16
+ declare const SnapshotStage: MoveStruct<{
17
+ dummy_field: _mysten_sui_bcs109.BcsType<boolean, boolean, "bool">;
18
+ }, "@local-pkg/deepbook_predict::plp::SnapshotStage">;
19
+ declare const PoolValuation: MoveStruct<{
20
+ /** Active expiry markets snapshotted at start; every one must be valued. */expected_expiry_markets: _mysten_sui_bcs109.BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
21
+ length: number;
22
+ }, string>; /** Markets valued so far this flush; folded against `expected` at finish. */
23
+ valued_expiry_markets: _mysten_sui_bcs109.BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
24
+ length: number;
25
+ }, string>; /** Running Σ of each valued market's snapshot NAV (settled markets contribute 0). */
26
+ total_nav: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
27
+ /**
28
+ * Oracle state frozen during the snapshot stage, one entry per expected market.
29
+ * Keyed by market id so a `Pricer` can never be applied to the wrong market.
30
+ * `none` marks a market that was already settled at snapshot time and therefore
31
+ * contributes 0. This map is what makes the valuation stage deterministic: it
32
+ * decides both the mark AND the sweep-vs-value branch, so no later transaction's
33
+ * clock or oracle state can change a market's contribution.
34
+ */
35
+ frozen_pricers: MoveStruct<{
36
+ contents: _mysten_sui_bcs109.BcsType<{
37
+ key: string;
38
+ value: {
39
+ expiry_market_id: string;
40
+ forward: bigint;
41
+ svi: {
42
+ a_magnitude: bigint;
43
+ a_is_negative: boolean;
44
+ b: bigint;
45
+ rho: {
46
+ magnitude: bigint;
47
+ is_negative: boolean;
48
+ };
49
+ m: {
50
+ magnitude: bigint;
51
+ is_negative: boolean;
52
+ };
53
+ sigma: bigint;
54
+ };
55
+ pyth_spot_source_timestamp_ms: bigint;
56
+ block_scholes_spot_source_timestamp_ms: bigint;
57
+ block_scholes_forward_source_timestamp_ms: bigint;
58
+ block_scholes_svi_source_timestamp_ms: bigint;
59
+ } | null;
60
+ }[], Iterable<{
61
+ key: string | Uint8Array<ArrayBufferLike>;
62
+ value: {
63
+ expiry_market_id: string | Uint8Array<ArrayBufferLike>;
64
+ forward: string | number | bigint;
65
+ svi: {
66
+ a_magnitude: string | number | bigint;
67
+ a_is_negative: boolean;
68
+ b: string | number | bigint;
69
+ rho: {
70
+ magnitude: string | number | bigint;
71
+ is_negative: boolean;
72
+ };
73
+ m: {
74
+ magnitude: string | number | bigint;
75
+ is_negative: boolean;
76
+ };
77
+ sigma: string | number | bigint;
78
+ };
79
+ pyth_spot_source_timestamp_ms: string | number | bigint;
80
+ block_scholes_spot_source_timestamp_ms: string | number | bigint;
81
+ block_scholes_forward_source_timestamp_ms: string | number | bigint;
82
+ block_scholes_svi_source_timestamp_ms: string | number | bigint;
83
+ } | null | undefined;
84
+ }> & {
85
+ length: number;
86
+ }, string>;
87
+ }, "0x2::vec_map::VecMap<bytes[32], Option<@local-pkg/deepbook_predict::pricing::FrozenPricer>>">;
88
+ /**
89
+ * Set by `seal_valuation_snapshot`; no market may be valued before it. Nothing may
90
+ * be snapshotted after it because sealing consumes the `SnapshotStage`.
91
+ */
92
+ sealed: _mysten_sui_bcs109.BcsType<boolean, boolean, "bool">; /** Clock time the flush was started, for the stuck-flush deadline. */
93
+ started_at_ms: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
94
+ /**
95
+ * Drain budgets committed at start (the cap owner's choice), bounding how many
96
+ * requests each queue processes at finish. Committing them here — not at finish —
97
+ * is what lets `finish_flush` run permissionless: a stranger may complete a flush
98
+ * but only ever drains at these budgets, so completion can help LPs, never starve
99
+ * them by finishing with a zero budget.
100
+ */
101
+ supply_budget: _mysten_sui_bcs109.BcsType<bigint | null, string | number | bigint | null | undefined, "Option<u64>">;
102
+ withdraw_budget: _mysten_sui_bcs109.BcsType<bigint | null, string | number | bigint | null | undefined, "Option<u64>">;
103
+ /**
104
+ * Each LP queue's `next_index` at the snapshot instant: the drain fills only
105
+ * requests indexed strictly below these, so nobody can watch the frozen mark form
106
+ * and then submit against a price they already know is stale.
107
+ */
108
+ supply_request_cutoff: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
109
+ withdraw_request_cutoff: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
110
+ /**
111
+ * Vault-side figures captured by `seal_valuation_snapshot`. With every market's
112
+ * cash frozen in its stamp and these frozen here, the mark is a pure function of
113
+ * the snapshot instant: no in-window cash move — maintenance, settled sweep,
114
+ * market funding, reserve realization — can reach it. Settled members are swept
115
+ * during the snapshot stage, so their recoverable cash sits inside
116
+ * `frozen_idle_balance`.
117
+ */
118
+ frozen_idle_balance: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
119
+ frozen_profit_basis_credits: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
120
+ frozen_profit_basis_debits: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
121
+ frozen_pending_protocol_profit: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
122
+ }, "@local-pkg/deepbook_predict::plp::PoolValuation">;
123
+ declare const PoolVault: MoveStruct<{
124
+ id: _mysten_sui_bcs109.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
125
+ /**
126
+ * Protocol-owned USDC excluded from PLP redemption. No package entrypoint
127
+ * withdraws this balance.
128
+ */
129
+ protocol_reserve_balance: MoveStruct<{
130
+ value: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
131
+ }, "0x2::balance::Balance<phantom T>">; /** Sponsor-funded USDC reserved for taker fee sponsorship, excluded from PLP NAV. */
132
+ fee_incentive_reserve: MoveStruct<{
133
+ value: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
134
+ }, "0x2::balance::Balance<phantom T>">; /** PLP share issuance plus queued supply/withdraw escrow. */
135
+ lp: MoveStruct<{
136
+ treasury_cap: MoveStruct<{
137
+ id: _mysten_sui_bcs109.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
138
+ total_supply: MoveStruct<{
139
+ value: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
140
+ }, "0x2::balance::Supply<phantom T>">;
141
+ }, "0x2::coin::TreasuryCap<phantom T>">;
142
+ supply_queue: MoveStruct<{
143
+ pages: MoveStruct<{
144
+ id: _mysten_sui_bcs109.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
145
+ size: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
146
+ }, "0x2::table::Table<phantom K, phantom V>">;
147
+ head_page_id: _mysten_sui_bcs109.BcsType<bigint | null, string | number | bigint | null | undefined, "Option<u64>">;
148
+ tail_page_id: _mysten_sui_bcs109.BcsType<bigint | null, string | number | bigint | null | undefined, "Option<u64>">;
149
+ next_index: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
150
+ pending: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
151
+ escrow: MoveStruct<{
152
+ value: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
153
+ }, "0x2::balance::Balance<phantom T>">;
154
+ }, "@local-pkg/deepbook_predict::lp_book::RequestQueue<phantom T>">;
155
+ withdraw_queue: MoveStruct<{
156
+ pages: MoveStruct<{
157
+ id: _mysten_sui_bcs109.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
158
+ size: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
159
+ }, "0x2::table::Table<phantom K, phantom V>">;
160
+ head_page_id: _mysten_sui_bcs109.BcsType<bigint | null, string | number | bigint | null | undefined, "Option<u64>">;
161
+ tail_page_id: _mysten_sui_bcs109.BcsType<bigint | null, string | number | bigint | null | undefined, "Option<u64>">;
162
+ next_index: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
163
+ pending: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
164
+ escrow: MoveStruct<{
165
+ value: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
166
+ }, "0x2::balance::Balance<phantom T>">;
167
+ }, "@local-pkg/deepbook_predict::lp_book::RequestQueue<phantom T>">;
168
+ locked_lp: MoveStruct<{
169
+ value: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
170
+ }, "0x2::balance::Balance<phantom T>">;
171
+ }, "@local-pkg/deepbook_predict::lp_book::LpBook<phantom LP>">; /** Idle USDC custody, registered expiries, and per-expiry cash-flow rows. */
172
+ expiry_accounting: MoveStruct<{
173
+ idle_balance: MoveStruct<{
174
+ value: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
175
+ }, "0x2::balance::Balance<phantom T>">;
176
+ active_expiry_markets: _mysten_sui_bcs109.BcsType<{
177
+ expiry_market_id: string;
178
+ expiry_ms: bigint;
179
+ }[], Iterable<{
180
+ expiry_market_id: string | Uint8Array<ArrayBufferLike>;
181
+ expiry_ms: string | number | bigint;
182
+ }> & {
183
+ length: number;
184
+ }, string>;
185
+ registered_expiries: MoveStruct<{
186
+ id: _mysten_sui_bcs109.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
187
+ size: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
188
+ }, "0x2::table::Table<phantom K, phantom V>">;
189
+ profit_basis_debits: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
190
+ profit_basis_credits: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
191
+ net_losses_to_fill: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
192
+ pending_protocol_profit: _mysten_sui_bcs109.BcsType<bigint, string | number | bigint, "u64">;
193
+ }, "@local-pkg/deepbook_predict::pool_accounting::Ledger">;
194
+ /**
195
+ * In-flight full-pool valuation, held across transactions. `Some` exactly while
196
+ * the `ProtocolConfig` valuation flag is engaged.
197
+ */
198
+ valuation: _mysten_sui_bcs109.BcsType<{
199
+ expected_expiry_markets: string[];
200
+ valued_expiry_markets: string[];
201
+ total_nav: bigint;
202
+ frozen_pricers: {
203
+ contents: {
204
+ key: string;
205
+ value: {
206
+ expiry_market_id: string;
207
+ forward: bigint;
208
+ svi: {
209
+ a_magnitude: bigint;
210
+ a_is_negative: boolean;
211
+ b: bigint;
212
+ rho: {
213
+ magnitude: bigint;
214
+ is_negative: boolean;
215
+ };
216
+ m: {
217
+ magnitude: bigint;
218
+ is_negative: boolean;
219
+ };
220
+ sigma: bigint;
221
+ };
222
+ pyth_spot_source_timestamp_ms: bigint;
223
+ block_scholes_spot_source_timestamp_ms: bigint;
224
+ block_scholes_forward_source_timestamp_ms: bigint;
225
+ block_scholes_svi_source_timestamp_ms: bigint;
226
+ } | null;
227
+ }[];
228
+ };
229
+ sealed: boolean;
230
+ started_at_ms: bigint;
231
+ supply_budget: bigint | null;
232
+ withdraw_budget: bigint | null;
233
+ supply_request_cutoff: bigint;
234
+ withdraw_request_cutoff: bigint;
235
+ frozen_idle_balance: bigint;
236
+ frozen_profit_basis_credits: bigint;
237
+ frozen_profit_basis_debits: bigint;
238
+ frozen_pending_protocol_profit: bigint;
239
+ } | null, {
240
+ expected_expiry_markets: Iterable<string | Uint8Array<ArrayBufferLike>> & {
241
+ length: number;
242
+ };
243
+ valued_expiry_markets: Iterable<string | Uint8Array<ArrayBufferLike>> & {
244
+ length: number;
245
+ };
246
+ total_nav: string | number | bigint;
247
+ frozen_pricers: {
248
+ contents: Iterable<{
249
+ key: string | Uint8Array<ArrayBufferLike>;
250
+ value: {
251
+ expiry_market_id: string | Uint8Array<ArrayBufferLike>;
252
+ forward: string | number | bigint;
253
+ svi: {
254
+ a_magnitude: string | number | bigint;
255
+ a_is_negative: boolean;
256
+ b: string | number | bigint;
257
+ rho: {
258
+ magnitude: string | number | bigint;
259
+ is_negative: boolean;
260
+ };
261
+ m: {
262
+ magnitude: string | number | bigint;
263
+ is_negative: boolean;
264
+ };
265
+ sigma: string | number | bigint;
266
+ };
267
+ pyth_spot_source_timestamp_ms: string | number | bigint;
268
+ block_scholes_spot_source_timestamp_ms: string | number | bigint;
269
+ block_scholes_forward_source_timestamp_ms: string | number | bigint;
270
+ block_scholes_svi_source_timestamp_ms: string | number | bigint;
271
+ } | null | undefined;
272
+ }> & {
273
+ length: number;
274
+ };
275
+ };
276
+ sealed: boolean;
277
+ started_at_ms: string | number | bigint;
278
+ supply_budget: string | number | bigint | null | undefined;
279
+ withdraw_budget: string | number | bigint | null | undefined;
280
+ supply_request_cutoff: string | number | bigint;
281
+ withdraw_request_cutoff: string | number | bigint;
282
+ frozen_idle_balance: string | number | bigint;
283
+ frozen_profit_basis_credits: string | number | bigint;
284
+ frozen_profit_basis_debits: string | number | bigint;
285
+ frozen_pending_protocol_profit: string | number | bigint;
286
+ } | null | undefined, "Option<@local-pkg/deepbook_predict::plp::PoolValuation>">;
287
+ }, "@local-pkg/deepbook_predict::plp::PoolVault">;
288
+ interface IdArguments {
289
+ vault?: RawTransactionArgument<string>;
290
+ }
291
+ interface IdOptions {
292
+ package?: string;
293
+ arguments?: IdArguments;
294
+ config?: {
295
+ poolVault: ConfigValue;
296
+ predictPackageId?: string;
297
+ };
298
+ }
299
+ /** Return the pool vault object ID for external discovery and PTB construction. */
300
+ declare function id(options: IdOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
301
+ interface IdleBalanceArguments {
302
+ vault?: RawTransactionArgument<string>;
303
+ }
304
+ interface IdleBalanceOptions {
305
+ package?: string;
306
+ arguments?: IdleBalanceArguments;
307
+ config?: {
308
+ poolVault: ConfigValue;
309
+ predictPackageId?: string;
310
+ };
311
+ }
312
+ /** Return idle USDC for SDK and devInspect state reads. */
313
+ declare function idleBalance(options: IdleBalanceOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
314
+ interface ProtocolReserveBalanceArguments {
315
+ vault?: RawTransactionArgument<string>;
316
+ }
317
+ interface ProtocolReserveBalanceOptions {
318
+ package?: string;
319
+ arguments?: ProtocolReserveBalanceArguments;
320
+ config?: {
321
+ poolVault: ConfigValue;
322
+ predictPackageId?: string;
323
+ };
324
+ }
325
+ /** Return protocol-owned USDC for SDK and devInspect state reads. */
326
+ declare function protocolReserveBalance(options: ProtocolReserveBalanceOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
327
+ interface FeeIncentiveReserveArguments {
328
+ vault?: RawTransactionArgument<string>;
329
+ }
330
+ interface FeeIncentiveReserveOptions {
331
+ package?: string;
332
+ arguments?: FeeIncentiveReserveArguments;
333
+ config?: {
334
+ poolVault: ConfigValue;
335
+ predictPackageId?: string;
336
+ };
337
+ }
338
+ /** Return sponsor-funded fee reserves for SDK and devInspect state reads. */
339
+ declare function feeIncentiveReserve(options: FeeIncentiveReserveOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
340
+ interface PlpTotalSupplyArguments {
341
+ vault?: RawTransactionArgument<string>;
342
+ }
343
+ interface PlpTotalSupplyOptions {
344
+ package?: string;
345
+ arguments?: PlpTotalSupplyArguments;
346
+ config?: {
347
+ poolVault: ConfigValue;
348
+ predictPackageId?: string;
349
+ };
350
+ }
351
+ /** Return total PLP supply for SDK and devInspect state reads. */
352
+ declare function plpTotalSupply(options: PlpTotalSupplyOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
353
+ interface SupplyRequestsPendingArguments {
354
+ vault?: RawTransactionArgument<string>;
355
+ }
356
+ interface SupplyRequestsPendingOptions {
357
+ package?: string;
358
+ arguments?: SupplyRequestsPendingArguments;
359
+ config?: {
360
+ poolVault: ConfigValue;
361
+ predictPackageId?: string;
362
+ };
363
+ }
364
+ /** Return pending LP supply count for SDK and devInspect queue reads. */
365
+ declare function supplyRequestsPending(options: SupplyRequestsPendingOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
366
+ interface WithdrawRequestsPendingArguments {
367
+ vault?: RawTransactionArgument<string>;
368
+ }
369
+ interface WithdrawRequestsPendingOptions {
370
+ package?: string;
371
+ arguments?: WithdrawRequestsPendingArguments;
372
+ config?: {
373
+ poolVault: ConfigValue;
374
+ predictPackageId?: string;
375
+ };
376
+ }
377
+ /** Return pending LP withdrawal count for SDK and devInspect queue reads. */
378
+ declare function withdrawRequestsPending(options: WithdrawRequestsPendingOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
379
+ interface ActiveExpiryMarketsArguments {
380
+ vault?: RawTransactionArgument<string>;
381
+ }
382
+ interface ActiveExpiryMarketsOptions {
383
+ package?: string;
384
+ arguments?: ActiveExpiryMarketsArguments;
385
+ config?: {
386
+ poolVault: ConfigValue;
387
+ predictPackageId?: string;
388
+ };
389
+ }
390
+ /** Return active expiry IDs for external PTB construction and pool inspection. */
391
+ declare function activeExpiryMarkets(options: ActiveExpiryMarketsOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
392
+ interface ActiveLiveExpiryCountArguments {
393
+ vault?: RawTransactionArgument<string>;
394
+ }
395
+ interface ActiveLiveExpiryCountOptions {
396
+ package?: string;
397
+ arguments?: ActiveLiveExpiryCountArguments;
398
+ config?: {
399
+ poolVault: ConfigValue;
400
+ predictPackageId?: string;
401
+ };
402
+ }
403
+ /** Return the pre-expiry active count for SDK and devInspect capacity reads. */
404
+ declare function activeLiveExpiryCount(options: ActiveLiveExpiryCountOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
405
+ interface ProfitBasisDebitsArguments {
406
+ vault?: RawTransactionArgument<string>;
407
+ }
408
+ interface ProfitBasisDebitsOptions {
409
+ package?: string;
410
+ arguments?: ProfitBasisDebitsArguments;
411
+ config?: {
412
+ poolVault: ConfigValue;
413
+ predictPackageId?: string;
414
+ };
415
+ }
416
+ /** Return the profit-basis debits for external accounting observability. */
417
+ declare function profitBasisDebits(options: ProfitBasisDebitsOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
418
+ interface ProfitBasisCreditsArguments {
419
+ vault?: RawTransactionArgument<string>;
420
+ }
421
+ interface ProfitBasisCreditsOptions {
422
+ package?: string;
423
+ arguments?: ProfitBasisCreditsArguments;
424
+ config?: {
425
+ poolVault: ConfigValue;
426
+ predictPackageId?: string;
427
+ };
428
+ }
429
+ /** Return the profit-basis credits for external accounting observability. */
430
+ declare function profitBasisCredits(options: ProfitBasisCreditsOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
431
+ interface PendingProtocolProfitArguments {
432
+ vault?: RawTransactionArgument<string>;
433
+ }
434
+ interface PendingProtocolProfitOptions {
435
+ package?: string;
436
+ arguments?: PendingProtocolProfitArguments;
437
+ config?: {
438
+ poolVault: ConfigValue;
439
+ predictPackageId?: string;
440
+ };
441
+ }
442
+ /** Return deferred protocol profit for external accounting observability. */
443
+ declare function pendingProtocolProfit(options: PendingProtocolProfitOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
444
+ interface StartPoolValuationArguments {
445
+ config?: RawTransactionArgument<string>;
446
+ vault?: RawTransactionArgument<string>;
447
+ valuationProof: TransactionArgument;
448
+ supplyBudget: RawTransactionArgument<number | bigint | null>;
449
+ withdrawBudget: RawTransactionArgument<number | bigint | null>;
450
+ }
451
+ interface StartPoolValuationOptions {
452
+ package?: string;
453
+ arguments: StartPoolValuationArguments;
454
+ config?: {
455
+ protocolConfig: ConfigValue;
456
+ poolVault: ConfigValue;
457
+ predictPackageId?: string;
458
+ };
459
+ }
460
+ /**
461
+ * Begin a full-pool valuation using a registry-issued pool-valuation proof. The
462
+ * proof grants control over when current oracle state is frozen for queued LP
463
+ * fills. Starting engages the cross-transaction valuation flag, snapshots the
464
+ * active expiry set and each LP queue's eligibility cutoff, and opens the atomic
465
+ * snapshot stage: freeze every active market's pricer under the returned
466
+ * `SnapshotStage`, then seal it in the same transaction.
467
+ */
468
+ declare function startPoolValuation(options: StartPoolValuationOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
469
+ interface SnapshotExpiryPricerArguments {
470
+ vault?: RawTransactionArgument<string>;
471
+ Stage: TransactionArgument;
472
+ market: RawTransactionArgument<string>;
473
+ config?: RawTransactionArgument<string>;
474
+ propbookRegistry?: RawTransactionArgument<string>;
475
+ pyth: RawTransactionArgument<string>;
476
+ bsValues: RawTransactionArgument<string>;
477
+ bsSvi: RawTransactionArgument<string>;
478
+ }
479
+ interface SnapshotExpiryPricerOptions {
480
+ package?: string;
481
+ arguments: SnapshotExpiryPricerArguments;
482
+ config?: {
483
+ poolVault: ConfigValue;
484
+ protocolConfig: ConfigValue;
485
+ oracleRegistry: ConfigValue;
486
+ predictPackageId?: string;
487
+ };
488
+ }
489
+ /**
490
+ * Freeze one snapshotted market's oracle state for this flush and stamp the
491
+ * market, capturing its cash rows and activating its payout-tree snapshot at this
492
+ * instant.
493
+ *
494
+ * Holding `SnapshotStage` is what admits this call, and that potato cannot leave
495
+ * the transaction `start_pool_valuation` minted it in — so every `Pricer` here is
496
+ * loaded at one instant, which is what lets the valuation stage span transactions
497
+ * without mixing marks (audit L10). This stage reads oracles only — it never walks
498
+ * a payout tree — so all markets fit one PTB regardless of book size.
499
+ *
500
+ * The oracle feeding this stage must have been written in an EARLIER transaction:
501
+ * `pricing::resolve_live_pricer` refuses a read stamped with the current
502
+ * transaction digest (RP-24), so a keeper cannot refresh and snapshot in one PTB.
503
+ *
504
+ * A market already settled at snapshot time is recorded with no pricer, gets no
505
+ * stamp (settled flows never touch live NAV), and contributes 0. An
506
+ * expired-but-unsettled market aborts: it has no well-defined mark, and because
507
+ * this stage is atomic the abort reverts the whole snapshot transaction, so the
508
+ * flag is never left engaged. Settle it first, then start the flush; settlement is
509
+ * never blocked by a flush, so that ordering is always available.
510
+ */
511
+ declare function snapshotExpiryPricer(options: SnapshotExpiryPricerOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
512
+ interface SealValuationSnapshotArguments {
513
+ vault?: RawTransactionArgument<string>;
514
+ stage: TransactionArgument;
515
+ config?: RawTransactionArgument<string>;
516
+ }
517
+ interface SealValuationSnapshotOptions {
518
+ package?: string;
519
+ arguments: SealValuationSnapshotArguments;
520
+ config?: {
521
+ poolVault: ConfigValue;
522
+ protocolConfig: ConfigValue;
523
+ predictPackageId?: string;
524
+ };
525
+ }
526
+ /**
527
+ * Close the snapshot stage once every expected market has a frozen pricer, and
528
+ * freeze the vault-side figures — idle, the profit basis, the pending protocol cut
529
+ * — completing the snapshot.
530
+ *
531
+ * Consuming `SnapshotStage` is the simultaneity proof: the potato dies here, so no
532
+ * later transaction can add oracle state to this flush, and every market is marked
533
+ * at the instant the snapshot transaction executed. The vault capture is
534
+ * consistent with the per-market stamps because `rebalance_expiry_cash` refuses to
535
+ * run while the stage is open (`ESnapshotStageOpen`), so no idle↔market move can
536
+ * land between a stamp and this capture. Valuation may then resume across as many
537
+ * transactions as it needs.
538
+ */
539
+ declare function sealValuationSnapshot(options: SealValuationSnapshotOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
540
+ interface ValueExpiryArguments {
541
+ vault?: RawTransactionArgument<string>;
542
+ market: RawTransactionArgument<string>;
543
+ config?: RawTransactionArgument<string>;
544
+ }
545
+ interface ValueExpiryOptions {
546
+ package?: string;
547
+ arguments: ValueExpiryArguments;
548
+ config?: {
549
+ poolVault: ConfigValue;
550
+ protocolConfig: ConfigValue;
551
+ predictPackageId?: string;
552
+ };
553
+ }
554
+ /**
555
+ * Fold one snapshotted market's SNAPSHOT-INSTANT NAV into the running total. A
556
+ * market frozen as settled is swept and contributes 0; one frozen with a pricer is
557
+ * valued via `expiry_market::snapshot_nav` over its captured cash and tree
558
+ * shadows, then has its stamp cleared (releasing the tree snapshot), so later
559
+ * trades and the next flush start clean.
560
+ *
561
+ * The resumable stage: any transaction after the seal, one market per transaction
562
+ * (`constants::max_payout_tree_nodes`), reading no oracle and no clock.
563
+ * MEASUREMENT-ONLY for every member — settled members were swept during the
564
+ * snapshot stage and every frozen figure was captured there, so this call moves no
565
+ * cash and `rebalance_expiry_cash` runs at any time. A market that expired
566
+ * mid-window is valued at its frozen pre-expiry mark; its settlement does not wait
567
+ * for this call, because settlement is never blocked by a flush.
568
+ */
569
+ declare function valueExpiry(options: ValueExpiryOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
570
+ interface FinishFlushArguments {
571
+ vault?: RawTransactionArgument<string>;
572
+ config?: RawTransactionArgument<string>;
573
+ }
574
+ interface FinishFlushOptions {
575
+ package?: string;
576
+ arguments?: FinishFlushArguments;
577
+ config?: {
578
+ poolVault: ConfigValue;
579
+ protocolConfig: ConfigValue;
580
+ predictPackageId?: string;
581
+ };
582
+ }
583
+ /**
584
+ * Finish a full-pool valuation and run the LP flush: prove every snapshotted
585
+ * market was valued exactly once, price the pool NAV, then drain the
586
+ * supply/withdraw queues at that frozen mark (mint PLP for supplies, burn PLP and
587
+ * pay USDC for withdrawals), release the valuation flag, retire the in-flight
588
+ * valuation, and return the LP-attributable pool-wide USDC NAV (frozen idle + Σ
589
+ * active NAV, net of the pending-protocol-profit exclusion priced from the frozen
590
+ * profit basis — every term as of the snapshot instant). Each drain fills only
591
+ * requests submitted before the flush's snapshot instant (the recorded queue
592
+ * cutoffs); younger requests wait for the next mark.
593
+ *
594
+ * `supply_budget` and `withdraw_budget` bound how many requests each queue may
595
+ * process this flush (`None` = unbounded). Fills — whole or partial — and
596
+ * protocol-refunded heads — non-executable, or quoting below the request's own
597
+ * minimum output — all count as processed. At `ProtocolConfig`'s shipped attempt
598
+ * count of one, a head that misses its limit is refunded by the flush that reaches
599
+ * it; above one it stays queued and stops that queue for the flush. The budgets
600
+ * are independent, so a supply backlog does not consume withdrawal capacity.
601
+ *
602
+ * Capacity bounds each pass on top of the budgets and refunds nothing: supplies
603
+ * fill only up to `ProtocolConfig`'s LP pool-value cap, withdrawals only up to
604
+ * idle. A head larger than the room left fills to the room, spends flush budget,
605
+ * and keeps its remainder queued at a rescaled limit; a head with no usable room
606
+ * carries untouched and spends none. Either way the pass stops, so an unbounded
607
+ * budget does not mean every queued request is processed (RP-23).
608
+ *
609
+ * Because queueing is permissionless and a refunded request returns its escrow in
610
+ * the same transaction, an operator should bound both budgets in production rather
611
+ * than rely on queue length staying small — see RP-12.
612
+ */
613
+ declare function finishFlush(options: FinishFlushOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
614
+ interface RebalanceExpiryCashArguments {
615
+ vault?: RawTransactionArgument<string>;
616
+ market: RawTransactionArgument<string>;
617
+ config?: RawTransactionArgument<string>;
618
+ }
619
+ interface RebalanceExpiryCashOptions {
620
+ package?: string;
621
+ arguments: RebalanceExpiryCashArguments;
622
+ config?: {
623
+ poolVault: ConfigValue;
624
+ protocolConfig: ConfigValue;
625
+ predictPackageId?: string;
626
+ };
627
+ }
628
+ /**
629
+ * Move cash between pool idle liquidity and one expiry market.
630
+ *
631
+ * Permissionless and standalone: anyone may call it at any cadence. Handles all
632
+ * three per-market cases — initial funding of a freshly registered (unfunded)
633
+ * market, ongoing live rebalance/surplus-sweep toward target, and the
634
+ * settled-market sweep (deactivate, return all free cash, materialize profit).
635
+ * Call `expiry_market::try_settle` first in the same PTB when settlement may be
636
+ * due. An expired unsettled market is a no-op until that transition succeeds. Mint
637
+ * asserts backing but never pulls pool cash, so this is what makes a market
638
+ * mintable. The market must already be registered to this vault
639
+ * (`registry::create_and_share_expiry_market`). Runs at any time, including while
640
+ * a flush is in flight — every figure the mark reads was frozen at the snapshot
641
+ * instant, so no move here can reach it. The one refusal is the still-open
642
+ * snapshot stage (start → seal, a single transaction): a cross-move landing
643
+ * between a market's stamp and the seal's vault capture would skew the frozen
644
+ * figures, so it is structurally rejected rather than corrected for.
645
+ */
646
+ declare function rebalanceExpiryCash(options: RebalanceExpiryCashOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
647
+ interface SponsorFeeIncentivesArguments {
648
+ vault?: RawTransactionArgument<string>;
649
+ config?: RawTransactionArgument<string>;
650
+ payment: RawTransactionArgument<string>;
651
+ }
652
+ interface SponsorFeeIncentivesOptions {
653
+ package?: string;
654
+ arguments: SponsorFeeIncentivesArguments;
655
+ config?: {
656
+ poolVault: ConfigValue;
657
+ protocolConfig: ConfigValue;
658
+ predictPackageId?: string;
659
+ };
660
+ }
661
+ /**
662
+ * Sponsor taker fee incentives with USDC. Anyone may contribute; the payment joins
663
+ * a pool-level reserve that is excluded from PLP NAV and later allocated to expiry
664
+ * markets by the normal rebalance flow.
665
+ */
666
+ declare function sponsorFeeIncentives(options: SponsorFeeIncentivesOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
667
+ interface LockCapitalArguments {
668
+ vault?: RawTransactionArgument<string>;
669
+ config?: RawTransactionArgument<string>;
670
+ AdminCap: RawTransactionArgument<string>;
671
+ payment: RawTransactionArgument<string>;
672
+ }
673
+ interface LockCapitalOptions {
674
+ package?: string;
675
+ arguments: LockCapitalArguments;
676
+ config?: {
677
+ poolVault: ConfigValue;
678
+ protocolConfig: ConfigValue;
679
+ predictPackageId?: string;
680
+ };
681
+ }
682
+ /**
683
+ * Bootstrap the pool exactly once: permanently lock `payment` USDC of minimum
684
+ * liquidity. Mints matching PLP (1:1) into the book's locked balance — never
685
+ * withdrawable, so the caller receives no shares — and joins the USDC into idle.
686
+ * This keeps `total_supply > 0` while the vault exists and gives rounding dust a
687
+ * non-withdrawable PLP holder. Requires root authority and zero existing supply.
688
+ * Supply, withdrawal, and flush flows remain disabled until the locked liquidity
689
+ * has been created.
690
+ */
691
+ declare function lockCapital(options: LockCapitalOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
692
+ interface RequestSupplyArguments {
693
+ vault?: RawTransactionArgument<string>;
694
+ wrapper: RawTransactionArgument<string>;
695
+ auth: TransactionArgument;
696
+ config?: RawTransactionArgument<string>;
697
+ amount: RawTransactionArgument<number | bigint>;
698
+ minPlpOut: RawTransactionArgument<number | bigint>;
699
+ }
700
+ interface RequestSupplyOptions {
701
+ package?: string;
702
+ arguments: RequestSupplyArguments;
703
+ config?: {
704
+ poolVault: ConfigValue;
705
+ protocolConfig: ConfigValue;
706
+ predictPackageId?: string;
707
+ };
708
+ }
709
+ /**
710
+ * Queue a supply request: pull `amount` USDC from account custody into queue
711
+ * escrow, recording the account's receive address as the fill recipient. The pull
712
+ * auto-settles any flush-delivered USDC first. The flush charges the protocol's
713
+ * supply fee — zero by default — on the USDC it takes in and prices shares on the
714
+ * remainder, so `min_plp_out` is measured after that fee. The account receives
715
+ * minted PLP only at a mark that mints at least `min_plp_out` for the whole
716
+ * `amount` — a **price floor**, not a promise of that many shares: if the pool cap
717
+ * leaves room for only part of the deposit, the fill is proportionally smaller at
718
+ * the same price and the remainder stays queued with its limit rescaled. At the
719
+ * shipped attempt count of one, a flush whose mark quotes less cancels and refunds
720
+ * the request there and then; a higher configured count lets it rest and retry
721
+ * that many flushes first. Returns the queue index, the handle used to cancel
722
+ * before the flush.
723
+ */
724
+ declare function requestSupply(options: RequestSupplyOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
725
+ interface RequestWithdrawArguments {
726
+ vault?: RawTransactionArgument<string>;
727
+ wrapper: RawTransactionArgument<string>;
728
+ auth: TransactionArgument;
729
+ config?: RawTransactionArgument<string>;
730
+ amount: RawTransactionArgument<number | bigint>;
731
+ minUsdcOut: RawTransactionArgument<number | bigint>;
732
+ }
733
+ interface RequestWithdrawOptions {
734
+ package?: string;
735
+ arguments: RequestWithdrawArguments;
736
+ config?: {
737
+ poolVault: ConfigValue;
738
+ protocolConfig: ConfigValue;
739
+ predictPackageId?: string;
740
+ };
741
+ }
742
+ /**
743
+ * Queue a withdraw request: pull `amount` PLP shares from account custody into
744
+ * queue escrow, recording the account's receive address as the fill recipient. The
745
+ * pull auto-settles any flush-delivered PLP first. The flush withholds the
746
+ * protocol's withdraw fee from the marked payout, so `min_usdc_out` is measured
747
+ * after the fee. The account is paid only at a mark that quotes at least
748
+ * `min_usdc_out` for the whole `amount` — a **price floor**, not a promise of that
749
+ * much USDC: if idle liquidity covers only part of the payout, only the shares
750
+ * idle affords are burned, the fill is proportionally smaller at the same price,
751
+ * and the remainder stays queued with its limit rescaled. At the shipped attempt
752
+ * count of one, a flush whose mark quotes less cancels and refunds the request
753
+ * there and then; a higher configured count lets it rest and retry that many
754
+ * flushes first. Returns the queue index used to cancel before the flush.
755
+ */
756
+ declare function requestWithdraw(options: RequestWithdrawOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
757
+ interface CancelSupplyRequestArguments {
758
+ vault?: RawTransactionArgument<string>;
759
+ wrapper: RawTransactionArgument<string>;
760
+ auth: TransactionArgument;
761
+ config?: RawTransactionArgument<string>;
762
+ index: RawTransactionArgument<number | bigint>;
763
+ }
764
+ interface CancelSupplyRequestOptions {
765
+ package?: string;
766
+ arguments: CancelSupplyRequestArguments;
767
+ config?: {
768
+ poolVault: ConfigValue;
769
+ protocolConfig: ConfigValue;
770
+ predictPackageId?: string;
771
+ };
772
+ }
773
+ /**
774
+ * Cancel a still-pending supply request, refunding its escrowed USDC straight into
775
+ * the requesting account. `account` must be the request's recorded recipient.
776
+ */
777
+ declare function cancelSupplyRequest(options: CancelSupplyRequestOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
778
+ interface CancelWithdrawRequestArguments {
779
+ vault?: RawTransactionArgument<string>;
780
+ wrapper: RawTransactionArgument<string>;
781
+ auth: TransactionArgument;
782
+ config?: RawTransactionArgument<string>;
783
+ index: RawTransactionArgument<number | bigint>;
784
+ }
785
+ interface CancelWithdrawRequestOptions {
786
+ package?: string;
787
+ arguments: CancelWithdrawRequestArguments;
788
+ config?: {
789
+ poolVault: ConfigValue;
790
+ protocolConfig: ConfigValue;
791
+ predictPackageId?: string;
792
+ };
793
+ }
794
+ /**
795
+ * Cancel a still-pending withdraw request, refunding its escrowed PLP straight
796
+ * into the requesting account. `account` must be the request's recorded recipient.
797
+ */
798
+ declare function cancelWithdrawRequest(options: CancelWithdrawRequestOptions): (tx: Transaction) => _mysten_sui_transactions216.TransactionResult;
799
+ //#endregion
800
+ export { plp_d_exports };
801
+ //# sourceMappingURL=plp.d.mts.map