@mysten/deepbook-v3 2.6.4 → 2.8.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 (250) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/PREDICT.md +389 -61
  3. package/dist/contracts/account/account.d.mts +23 -23
  4. package/dist/contracts/account/account.d.mts.map +1 -1
  5. package/dist/contracts/account/account_registry.d.mts +13 -13
  6. package/dist/contracts/deepbook/account.d.mts +18 -18
  7. package/dist/contracts/deepbook/balances.d.mts +4 -4
  8. package/dist/contracts/deepbook/deep_price.d.mts +3 -3
  9. package/dist/contracts/deepbook/order.d.mts +12 -12
  10. package/dist/contracts/deepbook_predict/admin.d.mts +4 -4
  11. package/dist/contracts/deepbook_predict/builder_code.d.mts +11 -11
  12. package/dist/contracts/deepbook_predict/builder_code_events.d.mts +10 -10
  13. package/dist/contracts/deepbook_predict/config_events.d.mts +93 -68
  14. package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -1
  15. package/dist/contracts/deepbook_predict/config_events.mjs +45 -1
  16. package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -1
  17. package/dist/contracts/deepbook_predict/deps/std/type_name.mjs +17 -0
  18. package/dist/contracts/deepbook_predict/deps/std/type_name.mjs.map +1 -0
  19. package/dist/contracts/deepbook_predict/expiry_market.d.mts +652 -235
  20. package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -1
  21. package/dist/contracts/deepbook_predict/expiry_market.mjs +652 -186
  22. package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
  23. package/dist/contracts/deepbook_predict/lp_book.mjs +1 -1
  24. package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +5 -5
  25. package/dist/contracts/deepbook_predict/market_manager.d.mts +27 -27
  26. package/dist/contracts/deepbook_predict/order_events.d.mts +50 -50
  27. package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -1
  28. package/dist/contracts/deepbook_predict/order_events.mjs +3 -1
  29. package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
  30. package/dist/contracts/deepbook_predict/pause_cap.d.mts +5 -5
  31. package/dist/contracts/deepbook_predict/plp.d.mts +184 -82
  32. package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -1
  33. package/dist/contracts/deepbook_predict/plp.mjs +126 -7
  34. package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
  35. package/dist/contracts/deepbook_predict/pool_accounting.mjs +1 -1
  36. package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +5 -5
  37. package/dist/contracts/deepbook_predict/predict_account.d.mts +14 -14
  38. package/dist/contracts/deepbook_predict/pricing.d.mts +91 -58
  39. package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -1
  40. package/dist/contracts/deepbook_predict/pricing.mjs +30 -3
  41. package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
  42. package/dist/contracts/deepbook_predict/pricing_config.mjs.map +1 -1
  43. package/dist/contracts/deepbook_predict/protocol_config.d.mts +400 -92
  44. package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -1
  45. package/dist/contracts/deepbook_predict/protocol_config.mjs +451 -61
  46. package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -1
  47. package/dist/contracts/deepbook_predict/range_codec.d.mts +2 -2
  48. package/dist/contracts/deepbook_predict/registry.d.mts +28 -28
  49. package/dist/contracts/deepbook_predict/strike_exposure.mjs +1 -1
  50. package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +17 -12
  51. package/dist/contracts/deepbook_predict/strike_payout_tree.mjs.map +1 -1
  52. package/dist/contracts/deepbook_predict/vault_events.d.mts +154 -106
  53. package/dist/contracts/deepbook_predict/vault_events.d.mts.map +1 -1
  54. package/dist/contracts/deepbook_predict/vault_events.mjs +57 -1
  55. package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
  56. package/dist/contracts/deepbook_predict_math/config-arguments.d.mts +10 -0
  57. package/dist/contracts/deepbook_predict_math/config-arguments.d.mts.map +1 -0
  58. package/dist/contracts/deepbook_predict_math/lazer_price.d.mts +106 -0
  59. package/dist/contracts/deepbook_predict_math/lazer_price.d.mts.map +1 -0
  60. package/dist/contracts/deepbook_predict_math/lazer_price.mjs +125 -0
  61. package/dist/contracts/deepbook_predict_math/lazer_price.mjs.map +1 -0
  62. package/dist/contracts/deepbook_predict_math/math.d.mts +284 -0
  63. package/dist/contracts/deepbook_predict_math/math.d.mts.map +1 -0
  64. package/dist/contracts/deepbook_predict_math/math.mjs +364 -0
  65. package/dist/contracts/deepbook_predict_math/math.mjs.map +1 -0
  66. package/dist/contracts/deepbook_predict_orders/config-arguments.d.mts +13 -0
  67. package/dist/contracts/deepbook_predict_orders/config-arguments.d.mts.map +1 -0
  68. package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts +215 -0
  69. package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts.map +1 -0
  70. package/dist/contracts/deepbook_predict_orders/delayed_execution_config.mjs +215 -0
  71. package/dist/contracts/deepbook_predict_orders/delayed_execution_config.mjs.map +1 -0
  72. package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs +87 -0
  73. package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs.map +1 -0
  74. package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.mjs +52 -0
  75. package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.mjs.map +1 -0
  76. package/dist/contracts/deepbook_predict_orders/deps/fixed_math/i64.mjs +25 -0
  77. package/dist/contracts/deepbook_predict_orders/deps/fixed_math/i64.mjs.map +1 -0
  78. package/dist/contracts/deepbook_predict_orders/deps/sui/balance.mjs +21 -0
  79. package/dist/contracts/deepbook_predict_orders/deps/sui/balance.mjs.map +1 -0
  80. package/dist/contracts/deepbook_predict_orders/deps/sui/table.mjs +39 -0
  81. package/dist/contracts/deepbook_predict_orders/deps/sui/table.mjs.map +1 -0
  82. package/dist/contracts/deepbook_predict_orders/desk.d.mts +187 -0
  83. package/dist/contracts/deepbook_predict_orders/desk.d.mts.map +1 -0
  84. package/dist/contracts/deepbook_predict_orders/desk.mjs +261 -0
  85. package/dist/contracts/deepbook_predict_orders/desk.mjs.map +1 -0
  86. package/dist/contracts/deepbook_predict_orders/order_queue.d.mts +1042 -0
  87. package/dist/contracts/deepbook_predict_orders/order_queue.d.mts.map +1 -0
  88. package/dist/contracts/deepbook_predict_orders/order_queue.mjs +849 -0
  89. package/dist/contracts/deepbook_predict_orders/order_queue.mjs.map +1 -0
  90. package/dist/contracts/deepbook_predict_orders/queue.d.mts +683 -0
  91. package/dist/contracts/deepbook_predict_orders/queue.d.mts.map +1 -0
  92. package/dist/contracts/deepbook_predict_orders/queue.mjs +912 -0
  93. package/dist/contracts/deepbook_predict_orders/queue.mjs.map +1 -0
  94. package/dist/contracts/deepbook_predict_orders/queue_events.d.mts +195 -0
  95. package/dist/contracts/deepbook_predict_orders/queue_events.d.mts.map +1 -0
  96. package/dist/contracts/deepbook_predict_orders/queue_events.mjs +187 -0
  97. package/dist/contracts/deepbook_predict_orders/queue_events.mjs.map +1 -0
  98. package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
  99. package/dist/contracts/deepbook_sessions/sessions.d.mts +163 -28
  100. package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
  101. package/dist/contracts/deepbook_sessions/sessions.mjs +234 -5
  102. package/dist/contracts/deepbook_sessions/sessions.mjs.map +1 -1
  103. package/dist/deployments/mainnet.mjs +7 -4
  104. package/dist/deployments/mainnet.mjs.map +1 -1
  105. package/dist/deployments/testnet.mjs +7 -4
  106. package/dist/deployments/testnet.mjs.map +1 -1
  107. package/dist/predict/bindings/expiry-market.d.mts +77 -0
  108. package/dist/predict/bindings/expiry-market.d.mts.map +1 -0
  109. package/dist/predict/bindings/expiry-market.mjs +139 -0
  110. package/dist/predict/bindings/expiry-market.mjs.map +1 -0
  111. package/dist/predict/bindings/protocol-config.d.mts +39 -0
  112. package/dist/predict/bindings/protocol-config.d.mts.map +1 -0
  113. package/dist/predict/bindings/protocol-config.mjs +90 -0
  114. package/dist/predict/bindings/protocol-config.mjs.map +1 -0
  115. package/dist/predict/bindings/rename.mjs +9 -0
  116. package/dist/predict/bindings/rename.mjs.map +1 -0
  117. package/dist/predict/client.d.mts +595 -16
  118. package/dist/predict/client.d.mts.map +1 -1
  119. package/dist/predict/client.mjs +986 -10
  120. package/dist/predict/client.mjs.map +1 -1
  121. package/dist/predict/config/generated.d.mts +22 -1
  122. package/dist/predict/config/generated.d.mts.map +1 -1
  123. package/dist/predict/config/generated.mjs +30 -1
  124. package/dist/predict/config/generated.mjs.map +1 -1
  125. package/dist/predict/config/mainnet.mjs +11 -3
  126. package/dist/predict/config/mainnet.mjs.map +1 -1
  127. package/dist/predict/config/testnet.mjs +11 -3
  128. package/dist/predict/config/testnet.mjs.map +1 -1
  129. package/dist/predict/config/types.d.mts +50 -1
  130. package/dist/predict/config/types.d.mts.map +1 -1
  131. package/dist/predict/cost.d.mts +38 -11
  132. package/dist/predict/cost.d.mts.map +1 -1
  133. package/dist/predict/cost.mjs +37 -11
  134. package/dist/predict/cost.mjs.map +1 -1
  135. package/dist/predict/decode.d.mts +251 -1
  136. package/dist/predict/decode.d.mts.map +1 -1
  137. package/dist/predict/decode.mjs +342 -4
  138. package/dist/predict/decode.mjs.map +1 -1
  139. package/dist/predict/errors.d.mts +69 -6
  140. package/dist/predict/errors.d.mts.map +1 -1
  141. package/dist/predict/errors.mjs +277 -4
  142. package/dist/predict/errors.mjs.map +1 -1
  143. package/dist/predict/index.d.mts +21 -10
  144. package/dist/predict/index.mjs +24 -12
  145. package/dist/predict/queue-id.d.mts +13 -0
  146. package/dist/predict/queue-id.d.mts.map +1 -0
  147. package/dist/predict/queue-id.mjs +19 -0
  148. package/dist/predict/queue-id.mjs.map +1 -0
  149. package/dist/predict/queue.d.mts +505 -0
  150. package/dist/predict/queue.d.mts.map +1 -0
  151. package/dist/predict/queue.mjs +774 -0
  152. package/dist/predict/queue.mjs.map +1 -0
  153. package/dist/predict/reads/balances.mjs +1 -1
  154. package/dist/predict/reads/markets.mjs +46 -5
  155. package/dist/predict/reads/markets.mjs.map +1 -1
  156. package/dist/predict/reads/pool.mjs +1 -1
  157. package/dist/predict/reads/pricing.d.mts +1 -1
  158. package/dist/predict/reads/queue.d.mts +105 -0
  159. package/dist/predict/reads/queue.d.mts.map +1 -0
  160. package/dist/predict/reads/queue.mjs +445 -0
  161. package/dist/predict/reads/queue.mjs.map +1 -0
  162. package/dist/predict/ticks.d.mts +9 -1
  163. package/dist/predict/ticks.d.mts.map +1 -1
  164. package/dist/predict/ticks.mjs +18 -1
  165. package/dist/predict/ticks.mjs.map +1 -1
  166. package/dist/predict/tx/authed.mjs +1 -1
  167. package/dist/predict/tx/common.d.mts.map +1 -1
  168. package/dist/predict/tx/common.mjs +12 -1
  169. package/dist/predict/tx/common.mjs.map +1 -1
  170. package/dist/predict/tx/queue.d.mts +220 -0
  171. package/dist/predict/tx/queue.d.mts.map +1 -0
  172. package/dist/predict/tx/queue.mjs +399 -0
  173. package/dist/predict/tx/queue.mjs.map +1 -0
  174. package/dist/predict/tx/trade.d.mts.map +1 -1
  175. package/dist/predict/tx/trade.mjs +61 -43
  176. package/dist/predict/tx/trade.mjs.map +1 -1
  177. package/dist/sessions.d.mts +90 -2
  178. package/dist/sessions.d.mts.map +1 -1
  179. package/dist/sessions.mjs +107 -2
  180. package/dist/sessions.mjs.map +1 -1
  181. package/dist/transactions/balanceManager.d.mts +12 -12
  182. package/dist/transactions/balanceManager.d.mts.map +1 -1
  183. package/dist/transactions/deepbook.d.mts +20 -20
  184. package/dist/transactions/deepbook.d.mts.map +1 -1
  185. package/dist/transactions/deepbookAdmin.d.mts +4 -4
  186. package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
  187. package/dist/transactions/marginAdmin.d.mts +7 -7
  188. package/dist/transactions/marginAdmin.d.mts.map +1 -1
  189. package/dist/transactions/marginLiquidations.d.mts +3 -3
  190. package/dist/transactions/marginMaintainer.d.mts +5 -5
  191. package/dist/transactions/marginMaintainer.d.mts.map +1 -1
  192. package/dist/transactions/marginManager.d.mts +32 -32
  193. package/dist/transactions/marginManager.d.mts.map +1 -1
  194. package/dist/transactions/marginPool.d.mts +18 -18
  195. package/dist/transactions/marginRegistry.d.mts +16 -16
  196. package/dist/transactions/marginTPSL.d.mts +10 -10
  197. package/dist/transactions/marginTPSL.d.mts.map +1 -1
  198. package/dist/transactions/poolProxy.d.mts +8 -8
  199. package/dist/transactions/poolProxy.d.mts.map +1 -1
  200. package/package.json +4 -4
  201. package/src/contracts/deepbook_predict/config_events.ts +39 -0
  202. package/src/contracts/deepbook_predict/deps/std/type_name.ts +24 -0
  203. package/src/contracts/deepbook_predict/expiry_market.ts +960 -169
  204. package/src/contracts/deepbook_predict/order_events.ts +3 -1
  205. package/src/contracts/deepbook_predict/plp.ts +150 -9
  206. package/src/contracts/deepbook_predict/pricing.ts +46 -7
  207. package/src/contracts/deepbook_predict/pricing_config.ts +3 -1
  208. package/src/contracts/deepbook_predict/protocol_config.ts +648 -33
  209. package/src/contracts/deepbook_predict/strike_payout_tree.ts +25 -21
  210. package/src/contracts/deepbook_predict/vault_events.ts +65 -0
  211. package/src/contracts/deepbook_predict_math/config-arguments.ts +6 -0
  212. package/src/contracts/deepbook_predict_math/lazer_price.ts +196 -0
  213. package/src/contracts/deepbook_predict_math/math.ts +553 -0
  214. package/src/contracts/deepbook_predict_orders/config-arguments.ts +11 -0
  215. package/src/contracts/deepbook_predict_orders/delayed_execution_config.ts +430 -0
  216. package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.ts +108 -0
  217. package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.ts +58 -0
  218. package/src/contracts/deepbook_predict_orders/deps/fixed_math/i64.ts +21 -0
  219. package/src/contracts/deepbook_predict_orders/deps/sui/balance.ts +19 -0
  220. package/src/contracts/deepbook_predict_orders/deps/sui/table.ts +37 -0
  221. package/src/contracts/deepbook_predict_orders/desk.ts +419 -0
  222. package/src/contracts/deepbook_predict_orders/order_flow.ts +19 -0
  223. package/src/contracts/deepbook_predict_orders/order_queue.ts +1670 -0
  224. package/src/contracts/deepbook_predict_orders/queue.ts +1394 -0
  225. package/src/contracts/deepbook_predict_orders/queue_events.ts +189 -0
  226. package/src/contracts/deepbook_sessions/sessions.ts +355 -4
  227. package/src/deployments/mainnet.ts +7 -2
  228. package/src/deployments/testnet.ts +7 -2
  229. package/src/deployments/types.ts +14 -1
  230. package/src/predict/bindings/expiry-market.ts +127 -0
  231. package/src/predict/bindings/protocol-config.ts +59 -0
  232. package/src/predict/bindings/rename.ts +14 -0
  233. package/src/predict/client.ts +2076 -13
  234. package/src/predict/config/generated.ts +50 -0
  235. package/src/predict/config/mainnet.ts +16 -2
  236. package/src/predict/config/testnet.ts +16 -2
  237. package/src/predict/config/types.ts +51 -1
  238. package/src/predict/cost.ts +62 -14
  239. package/src/predict/decode.ts +691 -2
  240. package/src/predict/errors.ts +391 -14
  241. package/src/predict/index.ts +87 -6
  242. package/src/predict/queue-id.ts +22 -0
  243. package/src/predict/queue.ts +1231 -0
  244. package/src/predict/reads/markets.ts +30 -0
  245. package/src/predict/reads/queue.ts +606 -0
  246. package/src/predict/ticks.ts +35 -0
  247. package/src/predict/tx/common.ts +25 -1
  248. package/src/predict/tx/queue.ts +525 -0
  249. package/src/predict/tx/trade.ts +80 -49
  250. package/src/sessions.ts +206 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,158 @@
1
1
  # @mysten/deepbook-v3
2
2
 
3
+ ## 2.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 84b81a4: Record the Mainnet Predict v4 rollout (delayed execution) in the Mainnet config. Mainnet
8
+ Predict trading moves to queued orders, as Testnet did in 2.7.0.
9
+
10
+ - Predict: `0x08fa3ef1…ee53` (v3) →
11
+ `0x98235c5842831c9b5f51dc637cf34c91db2aca5510802eb6ebfec63f5b71a7bb` (v4), which is also
12
+ `packages.predictDelayedExecution`
13
+ - `deepbook_predict_orders`: `0x7cd41de311f8f3efb2c239b38773a4010fce3bef0120cd55f479843077c98903`
14
+ (v1), with its `OrderDesk` `0x87b0a87262aacf58eaff567eed2fb7cb0f9cbc1f5ce33ef79216cd26d13a1b5b`
15
+ and `QueueRegistry` `0x8d4f0c671862f065ac7f2c2cb24abc47cf75ed8fc8e5e52c1d4bdfa53eee164f`
16
+ - `deepbook_predict_math`: `0x19262d18a3ce9f1c304defbacc89f36585152acde73e626231200d10617fb9a7`
17
+ (v1)
18
+ - Pyth Lazer `State`: `0xd0db9c1e9212a98120384bf78d8b8c985d87b9ee6921dffcf9d1394062911573`
19
+ - Sessions: `0xec678aee…0a1a` (v2) →
20
+ `0xfd9ef53ca443517d6a3a4d8742e00eaa1e7f35b0997697caab8c3e62870c0ce5` (v3)
21
+
22
+ `predictV1` and `sessionsPackageIdV1` keep the original IDs.
23
+
24
+ **Move every Mainnet session client to this release before the cutover, spot included.** The
25
+ Mainnet cutover transaction raises the Sessions version watermark to 3. From then on, every call
26
+ into Sessions v1 or v2 aborts with `session_config::EPackageVersionDisabled`. That includes spot
27
+ session-key trading (`sessionsMoveCalls.placeLimitOrder`, `placeMarketOrder`, `cancelLiveOrder`,
28
+ `cancelLiveOrders` and `withdrawSettledAmounts`), `authorizeSession` and the Predict wrappers.
29
+ Older releases call v2. This release calls v3 for every Sessions builder: the `SessionsContract`
30
+ wrappers, and the `sessionsMoveCalls` builders given `getSessionsConfig('mainnet')`. v3 is a
31
+ compatible upgrade, so the spot builders' arguments are unchanged. Only `revokeSession` and
32
+ `sessionExpirationMs` aren't version-gated, so they keep working on every version. Queued Predict
33
+ orders through a session key need v3 too, because the `enqueue*` wrappers exist only there.
34
+
35
+ **Migrate off the immediate trades.** The Mainnet call target is now Predict v4, which always
36
+ aborts them with `EDelayedExecutionRequired`. On Mainnet, `tx.mint`, `tx.mintAmount`,
37
+ `tx.mintCost`, `tx.redeem` and `read.quoteRedeem` stop working, and so do the `SessionsContract`
38
+ wrappers `mintExactQuantity`, `mintExactAmount`, `mintExactCost` and `redeemLive`. Place orders
39
+ with `tx.enqueueMint`, `tx.enqueueMintAmount`, `tx.enqueueMintCost` and `tx.enqueueSell`, or with
40
+ `read.planMint` / `read.planSell` and `tx.enqueuePlan`. Follow each order with `read.order` or
41
+ `read.waitForOutcome`. Session keys use the `SessionsContract` `enqueue*` wrappers.
42
+ `tx.claimSettled` is unchanged. Staying on an older release doesn't keep the immediate trades: the
43
+ cutover raises Predict's version watermark to 4, which retires the v3 package those releases call.
44
+
45
+ `getConfig('mainnet')` now turns on the queued-order surface. Until the cutover, neither path
46
+ trades on Mainnet. Trading is paused, `read.executionMode()` reads `'awaiting-cutover'` until
47
+ Mainnet's version watermark reaches 4, and Predict's admission refuses enqueues until then.
48
+
49
+ ## 2.7.0
50
+
51
+ ### Minor Changes
52
+
53
+ - 352a0cc: Add the Predict delayed-execution order flow (DBU-885). Queued mints and early sells fill
54
+ at Pyth's signed price for a tick shortly after placement. Delayed execution spans three packages:
55
+ the Predict upgrade, the order-flow package `deepbook_predict_orders` (each market's
56
+ `MarketQueue`, the shared `OrderDesk`, every queued-order entry point and the queue events) and
57
+ the math library `deepbook_predict_math`.
58
+
59
+ - `PredictClient.tx` gains `enqueueMint`, `enqueueMintAmount`, `enqueueMintCost`, `enqueueSell`,
60
+ `refund`, `fill`, and the permissionless `claimParked` and `payOpen` for USDC a denied receive
61
+ address couldn't take. Each enqueue builder reads the market first and refuses an order the
62
+ queue or protocol gates would abort with a typed `PredictPreflightError`, and returns the
63
+ transaction with a preview of τ, the deadline, the escrow and the order fee. A sell whose cash
64
+ need is above spare cash gets `rebalance_expiry_cash` after the enqueue by default.
65
+ - `PredictClient.read` gains `queue`, `order`, `orders`, `waitForOutcome`, `quoteSell`,
66
+ `executionMode`, `pendingFunds` and `lazerPackages`, and `PredictClient` gains `queueIdFor`.
67
+ `executionMode` is `'retired'`, and the enqueue builders refuse with the `retired` code, once
68
+ Predict's version watermark is above the version this SDK calls
69
+ (`queue.PREDICT_PACKAGE_VERSION`) or the desk's is above the order-flow package's.
70
+ - `PredictClient.read.settlement(market)` reads a market's settlement price, which still works
71
+ after expiry, when `read.market` and the quotes abort `ELivePricingExpired`.
72
+ `cost.settledPayout(orderId, settlementPriceRaw, tickSizeRaw)` gives what an order pays at that
73
+ price, mirroring `strike_exposure::settled_order_payout`. Together they show a queued fill's
74
+ result once the keeper has paid and cleaned up its record.
75
+ - `PredictClient.read.feePolicy(market)` reads the fee policy a market snapshotted at creation,
76
+ which the `cost` functions take as `fees`. `cost.SHIPPED_FEE_POLICY` matches neither recorded
77
+ deployment's template any more, so its costs for a live market come out low.
78
+ - `PredictClient.read` gains `planMint` and `planSell` for order forms. A plan quotes the order at
79
+ the current price, also for a visitor without an account, and turns `slippageCents` (cents per
80
+ contract, never a percentage, or `'auto'` from `queue.slippageBand`) into the enqueue limits,
81
+ sized from the price without the fee subsidy, which is what enqueue admission checks. It returns
82
+ the payout, the payout multiple, the order fee read from the desk, the escrow and debit, the
83
+ balance, the most the market takes now, the timing, and the refusal the enqueue builder's own
84
+ preflight would give the plan's order (with the new `cost-above-payout` code). `planMint` throws
85
+ `entry-band` (a new code) for a strike outside the market's entry band, `min-premium` for a
86
+ budget or quantity below the minimum premium, and `past-cutoff` for a market past its expiry.
87
+ `PredictClient.tx.enqueuePlan` queues the order a plan describes. A plan carries its `target`
88
+ (owner, market, strike or record), and `enqueuePlan` refuses it for another order, after the
89
+ order fee rose, or when the balance escrows less than its budget. Each facade enqueue starts
90
+ with `queueTx.assertOrderFeeAtMost`, which aborts the transaction when the desk's fee rose above
91
+ the previewed one before it executes. `snapStrike` snaps a strike to a market's admission grid,
92
+ and `queue.budgetMintLimits`, `queue.exactMintLimits` and `queue.sellLimits` are the pure limit
93
+ helpers. Where the config records delayed execution, `quoteMint` and `quoteMintCost` read the
94
+ chain's quote functions and preview a queued fill.
95
+ - `decodeMoveAbort` names Predict's `pricing` aborts (such as `EBlockScholesPriceUnavailable`) the
96
+ admission, position and LP aborts (such as `strike_payout_tree::EMaxPayoutTreeNodes`), and the
97
+ `sessions`, `session_config` and `account_registry` aborts (such as `ESessionNotAuthorized`),
98
+ and `describePredictError` gives the oracle-unavailable and stale ones a retry text and the
99
+ session ones a readable one. The plan types (`MintPlan`, `SellPlan`, `PlanMintOptions`,
100
+ `PlanSellOptions`, `SlippageOptions`, `AppliedSlippage`) are exported.
101
+ - `PredictClient.decode` gains the queue event decoders (matched against the order-flow package's
102
+ original ID, including `recordFunds` for parked and claimed USDC), `policyUpdates` and
103
+ `expiryPnlRealized`. Refund reason 9 is a denied receive address. A held position carries its
104
+ `quantityRaw`, decoded from its order ID, so a partial sell's remainder is readable without
105
+ `cost.decodeOrderRange`. `realizedPnlRaw` sums the realized P&L changes.
106
+ - New config: `packages.predictDelayedExecution`, `packages.predictOrders`,
107
+ `packages.predictOrdersV1`, `packages.predictMath`, `objects.orderDesk` and
108
+ `objects.queueRegistry`, all optional. Queue IDs derive from the queue registry.
109
+ - New `queue` namespace (order codes, refund reasons, settlement phases, cash-need math,
110
+ `maxMintNow`, timing previews, `orderView`, `reduceOrderEvents`, `slippageBand`), `queueTx`
111
+ thunks (the enqueues, `createQueue`, `commit`, `resolve`, `refund`, `adminRefund`, `settleStep`,
112
+ `payOpen`, `claimParked`, `cleanup`, `fill`), `toOrdersConfig`, `deriveQueueId`,
113
+ `orderFlowWitnessType` and `describePredictError`, plus the generated bindings of both new
114
+ packages.
115
+ - `SessionsContract` gains `enqueueExactQuantity`, `enqueueExactAmount`, `enqueueExactCost` and
116
+ `enqueueRedeemOpen`, which take the order desk and the queue registry and need Sessions v3.
117
+ - The cost previews take the admin-set `feeIncentiveSubsidyRate`.
118
+ - Deprecated: the immediate `mint`, `mintAmount`, `mintCost` and `redeem` builders, their thunks
119
+ and Sessions wrappers, `read.quoteRedeem` and `FEE_INCENTIVE_SUBSIDY_RATE`. Predict v4 always
120
+ aborts the immediate trades.
121
+
122
+ The Testnet config records the Testnet rollout: Predict v5, Sessions v3,
123
+ `deepbook_predict_orders`, `deepbook_predict_math`, the order desk, the queue registry and the
124
+ Pyth Lazer state. The Mainnet config doesn't record delayed execution yet, so the queued surface
125
+ needs a custom `config` there until the Mainnet rollout is synced. `sync-deployment` now reads the
126
+ two new packages' `Published.toml` records.
127
+
128
+ ## 2.6.8
129
+
130
+ ## 2.6.7
131
+
132
+ ### Patch Changes
133
+
134
+ - 2ba222a: Upgrade axios to require version 1.20.0 or later, fixing reported security
135
+ vulnerabilities.
136
+
137
+ ## 2.6.6
138
+
139
+ ## 2.6.5
140
+
141
+ ### Patch Changes
142
+
143
+ - d5d8f63: Point Predict at its latest published packages and pick up `add_usdc_to_plp`:
144
+
145
+ - Mainnet Predict: `0x1cacb9bf…a837` (v2) →
146
+ `0x08fa3ef1b047d87b0b4ce1c7e5f8b42d8bfdea9a70547efe3cce5d8d6e47ee53` (v3)
147
+ - Testnet Predict: `0x30a03c33…25ce` (v2) →
148
+ `0x6c2c2d3c2394cf282f4b8462a99c2e814bda0c223796de10b47b36d35fd878f5` (v4)
149
+
150
+ `predictV1` keeps the original ids, and Sessions is already on its latest package on both
151
+ networks.
152
+
153
+ The regenerated Predict bindings add `plpMoveCalls.addUsdcToPlp`, which pays USDC into the pool
154
+ without minting PLP, and the `vaultEvents.UsdcAddedToPlp` event layout.
155
+
3
156
  ## 2.6.4
4
157
 
5
158
  ## 2.6.3