@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
@@ -0,0 +1,505 @@
1
+ import { DelayedExecutionPolicy as DelayedExecutionPolicy$1 } from "../contracts/deepbook_predict_orders/delayed_execution_config.mjs";
2
+ import { OrderView as OrderView$1 } from "../contracts/deepbook_predict_orders/order_queue.mjs";
3
+ import { QueueEvent } from "./decode.mjs";
4
+
5
+ //#region src/predict/queue.d.ts
6
+ declare namespace queue_d_exports {
7
+ export { DEADLINE_EXPIRY_MARGIN_MS, DELAYED_EXECUTION_VERSION, DelayedExecutionPolicy, HeldPosition, MaxMintInputs, MaxMintNow, MintBudgetInputs, MintCashNeedInputs, MintLimitsInputs, ORDER_FLOW_PACKAGE_VERSION, ORDER_KIND, ORDER_STATUS, OrderEventState, OrderKindName, OrderStatusName, OrderView, PREDICT_PACKAGE_VERSION, PYTH_CHANNEL, ParkedFunds, PricePerContract, QueueHeads, QueuedOrder, REFUND_REASON, REFUND_REASONS, REFUND_REQUEST_GRACE_MS, RefundReasonInfo, SETTLE_PHASE, SlippageBandInputs, TimingPreview, TimingPreviewInputs, budgetMintLimits, cashNeedBudget, cashNeedExactQuantity, cashNeedSell, channelTickMs, exactMintLimits, feeCovered, isMintKind, isSellKind, maxMintNow, mintBudget, mintCashNeed, orderCutoffMs, orderKindName, orderStatusName, orderView, policyFromBcs, previewTiming, reduceOrderEvents, refundReason, sellCashCheck, sellLimits, slippageBand };
8
+ }
9
+ /**
10
+ * Predict's `constants::current_version` from the upgrade that added delayed execution. Enqueue
11
+ * works once `ProtocolConfig.version_watermark` reaches it (Predict's admission aborts
12
+ * `ECutoverNotReached` until then). The retired immediate trades (`mint_exact_*`, `redeem_live`)
13
+ * always abort in that package, and the older packages they still run in are retired by the same
14
+ * bump. The same on both networks: it is the code's version constant, not the on-chain package
15
+ * version (Mainnet v4, Testnet v5).
16
+ */
17
+ declare const DELAYED_EXECUTION_VERSION = 4n;
18
+ /**
19
+ * Predict's `constants::current_version` of the package these bindings were generated from. Every
20
+ * version-gated Predict call checks `chk_version`, which aborts `EPackageVersionDisabled` once
21
+ * `ProtocolConfig.version_watermark` is above it, so a higher watermark retires the Predict code
22
+ * this SDK calls. Bump it with Predict when regenerating.
23
+ */
24
+ declare const PREDICT_PACKAGE_VERSION = 4n;
25
+ /**
26
+ * `desk::current_version` of the order-flow package these bindings were generated from. The desk's
27
+ * version floor retires older companion code, so a floor above it means the package this SDK calls
28
+ * aborts `EPackageVersionDisabled`. Bump it with the companion when regenerating.
29
+ */
30
+ declare const ORDER_FLOW_PACKAGE_VERSION = 1n;
31
+ /** `queue::phase_*`: what `settle_step` returns, the phase the next call runs. */
32
+ declare const SETTLE_PHASE: Readonly<{
33
+ /** Refunding the waiting orders (reason 5). */readonly DRAIN: 0; /** Paying the Open records, once Predict has settled the market. */
34
+ readonly PAY: 1;
35
+ /**
36
+ * The payout walk reached the last record and `MarketPayoutsCompleted` was emitted. A record
37
+ * the market couldn't pay (`OpenRecordPayoutSkipped`) stays Open and unpaid.
38
+ */
39
+ readonly DONE: 2;
40
+ }>;
41
+ /** `order_queue::status_*`. Never renumbered on chain; unknown codes still decode. */
42
+ declare const ORDER_STATUS: Readonly<{
43
+ readonly PENDING: 0;
44
+ readonly COMMITTED: 1;
45
+ readonly OPEN: 2;
46
+ readonly REFUNDED: 3;
47
+ readonly CLOSED: 4; /** Reserved: nothing sets it at launch. Counts as unfinished. */
48
+ readonly REFUND_DUE: 5;
49
+ }>;
50
+ /** `order_queue::kind_*`. `REDEEM_LIVE` is reserved and never used by v4. */
51
+ declare const ORDER_KIND: Readonly<{
52
+ readonly EXACT_QUANTITY: 0;
53
+ readonly EXACT_AMOUNT: 1;
54
+ readonly EXACT_COST: 2;
55
+ readonly REDEEM_LIVE: 3;
56
+ readonly REDEEM_OPEN: 4;
57
+ }>;
58
+ /** `order_queue::reason_*`. `0` in a record's result means filled. */
59
+ declare const REFUND_REASON: Readonly<{
60
+ readonly LIMITS: 1;
61
+ readonly ADMISSION: 2;
62
+ readonly NO_PRICE: 3;
63
+ readonly MISSING_NODE: 4;
64
+ readonly DEADLINE: 5;
65
+ readonly FREEZE: 6;
66
+ readonly ADMIN: 7;
67
+ readonly NO_CASH: 8;
68
+ readonly RECIPIENT_DENIED: 9;
69
+ }>;
70
+ /** The Pyth Lazer channels the queue prices on (`delayed_execution_config`). */
71
+ declare const PYTH_CHANNEL: Readonly<{
72
+ readonly FIXED_RATE_50MS: 2;
73
+ readonly FIXED_RATE_200MS: 3;
74
+ }>;
75
+ /** Predict's `constants::deadline_expiry_margin_ms`: every deadline is at least this long before expiry. */
76
+ declare const DEADLINE_EXPIRY_MARGIN_MS = 5000n;
77
+ /**
78
+ * How long after an order's deadline the app waits before offering "Refund my order". Keepers
79
+ * refund overdue orders on their own, so the button only matters when they are all down.
80
+ */
81
+ declare const REFUND_REQUEST_GRACE_MS = 5000n;
82
+ type OrderStatusName = 'pending' | 'committed' | 'open' | 'refunded' | 'closed' | 'refund-due' | 'unknown';
83
+ type OrderKindName = 'exact-quantity' | 'exact-amount' | 'exact-cost' | 'redeem-live' | 'redeem-open' | 'unknown';
84
+ /** A status code's name, or `'unknown'` for a code this SDK version predates. */
85
+ declare function orderStatusName(code: number): OrderStatusName;
86
+ /** A kind code's name, or `'unknown'` for a code this SDK version predates. */
87
+ declare function orderKindName(code: number): OrderKindName;
88
+ /** Whether a kind code is a queued mint (exact quantity, exact amount or exact cost). */
89
+ declare function isMintKind(kind: number): boolean;
90
+ /** Whether a kind code is a queued sell. */
91
+ declare function isSellKind(kind: number): boolean;
92
+ /** What a refund reason means for the trader. */
93
+ interface RefundReasonInfo {
94
+ code: number;
95
+ key: 'limits' | 'admission' | 'no-price' | 'missing-node' | 'deadline' | 'freeze' | 'admin' | 'no-cash' | 'recipient-denied' | 'unknown';
96
+ /** Display text for the refund. */
97
+ text: string;
98
+ /** Whether the order fee was kept (reasons 1 and 2). `null` for an unknown code. */
99
+ feeKept: boolean | null;
100
+ /** False for codes v4 reserves but never sets (3 and 6), and for unknown codes. */
101
+ live: boolean;
102
+ }
103
+ /** Every reason code v4 defines, with its text and fee treatment. */
104
+ declare const REFUND_REASONS: Readonly<Record<number, RefundReasonInfo>>;
105
+ /** A reason code's meaning. Unknown codes map to `key: 'unknown'` rather than throwing. */
106
+ declare function refundReason(code: number): RefundReasonInfo;
107
+ /**
108
+ * `delayed_execution_config::DelayedExecutionPolicy` with camelCase keys, as the companion's
109
+ * `OrderDesk` holds it (`desk::policy`). Times in ms, USDC raw.
110
+ */
111
+ interface DelayedExecutionPolicy {
112
+ delayMs: bigint;
113
+ stallTimeoutMs: bigint;
114
+ stuckThresholdMs: bigint;
115
+ gapWaitMs: bigint;
116
+ pythPriceBufferMs: bigint;
117
+ /** {@link PYTH_CHANNEL}: `2` is 50 ms, `3` is 200 ms. */
118
+ pythChannel: number;
119
+ sviMaxAgeMs: bigint;
120
+ mintCapacity: bigint;
121
+ sellCapacity: bigint;
122
+ perAccountCap: bigint;
123
+ /** Flat USDC fee charged at enqueue, raw. */
124
+ orderFee: bigint;
125
+ minSellQuantity: bigint;
126
+ settleRefundBatch: bigint;
127
+ settlePayoutBatch: bigint;
128
+ }
129
+ /** Map the generated policy layout to {@link DelayedExecutionPolicy}. */
130
+ declare function policyFromBcs(p: (typeof DelayedExecutionPolicy$1)['$inferType']): DelayedExecutionPolicy;
131
+ /** `delayed_execution_config::channel_tick_ms`: 50 ms for channel 2, 200 ms for channel 3. */
132
+ declare function channelTickMs(channel: number): bigint;
133
+ /** Exact-quantity mint cash need: `⌈quantity · (1 − p_min)⌉ + 1`. */
134
+ declare function cashNeedExactQuantity(quantity: bigint, minEntryProbability: bigint): bigint;
135
+ /**
136
+ * Budget mint cash need: `⌈(budget + 1) · (1 / p_min − 1)⌉ + 1`, rounded as Move rounds it (one
137
+ * `mul_div_up` of `(budget + 1) · (1e9 − p_min) / p_min`). Exact-amount mints pass
138
+ * `min(max_premium, budget)`. `p_min = 0` throws, as the Move division aborts.
139
+ */
140
+ declare function cashNeedBudget(budget: bigint, minEntryProbability: bigint): bigint;
141
+ /** Sell cash need: `⌈close_quantity · (1 − λ)⌉ + 1`. */
142
+ declare function cashNeedSell(closeQuantity: bigint, backingBufferLambda: bigint): bigint;
143
+ /**
144
+ * Whether the account can pay the order fee: a mint needs `available > fee` (it escrows a budget
145
+ * on top), a sell needs `available ≥ fee` (it escrows only the fee). `available` is
146
+ * `account::balance<USDC>`, unsettled accumulator funds included.
147
+ */
148
+ declare function feeCovered(side: 'mint' | 'sell', availableRaw: bigint, orderFeeRaw: bigint): boolean;
149
+ /** Inputs for {@link mintBudget}. */
150
+ interface MintBudgetInputs {
151
+ /** {@link ORDER_KIND}: a mint kind. */
152
+ kind: number;
153
+ maxCostRaw: bigint;
154
+ availableRaw: bigint;
155
+ orderFeeRaw: bigint;
156
+ /** Required for exact quantity: a fill never costs more than its quantity. */
157
+ quantityRaw?: bigint;
158
+ }
159
+ /**
160
+ * The budget a queued mint escrows: `min(max_cost, available − fee)`, and for exact quantity also
161
+ * at most the quantity. `null` when the balance doesn't cover the fee. Enqueue debits the budget
162
+ * plus the order fee, and the unspent budget comes back at the fill.
163
+ */
164
+ declare function mintBudget(inputs: MintBudgetInputs): bigint | null;
165
+ /** Inputs for {@link mintCashNeed}. */
166
+ interface MintCashNeedInputs {
167
+ kind: number;
168
+ /** The escrowed budget, from {@link mintBudget}. */
169
+ budgetRaw: bigint;
170
+ minEntryProbability: bigint;
171
+ /** Exact quantity: the quantity ordered. */
172
+ quantityRaw?: bigint;
173
+ /** Exact amount: the premium cap. */
174
+ maxPremiumRaw?: bigint;
175
+ }
176
+ /** A queued mint's cash need, picking the formula the contract picks for its kind. */
177
+ declare function mintCashNeed(inputs: MintCashNeedInputs): bigint;
178
+ /**
179
+ * A sell's cash need against the market's spare cash. Sells are never refused for market cash at
180
+ * placement: the keeper funds the market before τ, and a sell the market still can't cover at the
181
+ * fill is refunded in full (reason 8). `short` flags that risk, and the sell builder can add
182
+ * `rebalance_expiry_cash` after the enqueue to fund the market at once.
183
+ */
184
+ declare function sellCashCheck(closeQuantityRaw: bigint, spareCashRaw: bigint, backingBufferLambda: bigint): {
185
+ needRaw: bigint;
186
+ short: boolean;
187
+ };
188
+ /** Inputs for {@link maxMintNow}. */
189
+ interface MaxMintInputs {
190
+ /** `'exact-quantity'` sizes a quantity; `'budget'` sizes an exact-cost or exact-amount spend. */
191
+ shape: 'exact-quantity' | 'budget';
192
+ /** Market cash above required cash (`MarketQueueState.spareCash`). */
193
+ spareCashRaw: bigint;
194
+ /** The minimum entry probability from `expiry_market::order_flow_state`, 1e9-scaled. */
195
+ minEntryProbability: bigint;
196
+ /** `account::balance<USDC>`. Bounds a budget spend at `available − fee`. */
197
+ availableRaw?: bigint;
198
+ orderFeeRaw?: bigint;
199
+ /** The deployment's `position_lot_size`. Defaults to `10_000n`. */
200
+ lotSize?: bigint;
201
+ /** Margin left below spare cash, in basis points. Default 100 (1%). */
202
+ headroomBps?: bigint;
203
+ /** When the reads were taken, echoed back as `asOfMs`. */
204
+ asOfMs?: bigint;
205
+ }
206
+ /** The largest mint a market takes right now, and what binds it. A snapshot: see {@link maxMintNow}. */
207
+ interface MaxMintNow {
208
+ /**
209
+ * The cash-limited maximum: a quantity for `'exact-quantity'`, a spend for `'budget'`. `null`
210
+ * when cash doesn't bind (`p_min ≥ 1`).
211
+ */
212
+ cashLimitRaw: bigint | null;
213
+ /** `available − fee` for `'budget'`, when a balance was given. `null` otherwise. */
214
+ balanceLimitRaw: bigint | null;
215
+ /** The smaller of the two limits, or `null` when neither binds. */
216
+ maxRaw: bigint | null;
217
+ limitedBy: 'cash' | 'balance' | 'none';
218
+ asOfMs: bigint | null;
219
+ }
220
+ /**
221
+ * The largest queued mint a market's spare cash admits now ("Max right now"). Predict's admission
222
+ * refuses a mint whose cash need is above spare cash (`EInsufficientMarketCash`). For exact quantity this
223
+ * is the largest lot multiple `q` with `cashNeedExactQuantity(q) ≤ S`; for a budget it is the
224
+ * largest `b` with `cashNeedBudget(b) ≤ S`, where `S` is spare cash less the headroom.
225
+ *
226
+ * It is a snapshot: fills lower spare cash, and the keeper's rebalance after each enqueue raises
227
+ * it. Other waiting orders don't count against a mint. For exact quantity this caps only the
228
+ * cash side: size the balance side with `cost.mintCostForBudget` at `available − fee`. A budget
229
+ * mint with `p_min = 0` can't be placed at all (the cash need divides by `p_min`), so it reads 0.
230
+ */
231
+ declare function maxMintNow(inputs: MaxMintInputs): MaxMintNow;
232
+ /** `(resolve_head, next_id, last_tau_ms, last_committed_tau_ms)` from `queue::queue_heads`. */
233
+ interface QueueHeads {
234
+ resolveHead: bigint;
235
+ nextId: bigint;
236
+ lastTauMs: bigint;
237
+ lastCommittedTauMs: bigint;
238
+ }
239
+ /**
240
+ * `expiry − max(no_trade_window_ms, stall_timeout_ms + 5_000)`, saturating at 0: enqueue requires
241
+ * the order's τ below it.
242
+ */
243
+ declare function orderCutoffMs(expiryMs: bigint, policy: Pick<DelayedExecutionPolicy, 'stallTimeoutMs'>, noTradeWindowMs: bigint): bigint;
244
+ /** Inputs for {@link previewTiming}. */
245
+ interface TimingPreviewInputs {
246
+ nowMs: bigint;
247
+ policy: Pick<DelayedExecutionPolicy, 'delayMs' | 'stallTimeoutMs' | 'pythChannel'>;
248
+ heads: QueueHeads;
249
+ expiryMs: bigint;
250
+ noTradeWindowMs: bigint;
251
+ /**
252
+ * The newest order's channel, when known. A channel change pushes τ past the last τ, so one
253
+ * cohort never mixes channels. The public reads don't expose it, so it is optional.
254
+ */
255
+ lastChannel?: number;
256
+ }
257
+ /** A display preview of the τ, deadline and cutoff an order placed now would get. */
258
+ interface TimingPreview {
259
+ tauMs: bigint;
260
+ /** `min(τ + stall, expiry)`. The chain also keeps deadlines non-decreasing. */
261
+ deadlineMs: bigint;
262
+ cutoffMs: bigint;
263
+ tickMs: bigint;
264
+ /** Whether τ is before the cutoff, so enqueue would accept the timing. */
265
+ beforeCutoff: boolean;
266
+ }
267
+ /**
268
+ * Preview `order_queue::plan_timing`: τ is the policy channel's last tick at or before
269
+ * `now + delay`, never below the last τ, and pushed past the last committed τ. Display only:
270
+ * the contract uses the consensus timestamp, which can differ from the local clock.
271
+ */
272
+ declare function previewTiming(inputs: TimingPreviewInputs): TimingPreview;
273
+ /** Inputs for {@link slippageBand}. All times in ms. */
274
+ interface SlippageBandInputs {
275
+ /** The quoted probability, in (0, 1). */
276
+ probability: number;
277
+ timeToExpiryMs: number;
278
+ /** The policy's delay. */
279
+ delayMs: number;
280
+ /** The channel tick: 50 or 200. */
281
+ tickMs: number;
282
+ /** Time between the quote and the enqueue landing. Default 500. */
283
+ signingMs?: number;
284
+ /** Time between τ and the fill. Default 500. */
285
+ resolveMs?: number;
286
+ /** Standard deviations of movement to allow. Default 2. */
287
+ k?: number;
288
+ }
289
+ /**
290
+ * A heuristic band for a queued order's price limits: `Δp ≈ k · φ(Φ⁻¹(p)) · √(h / T)`, the
291
+ * probability move of a digital under Brownian motion over the horizon `h` (delay + tick +
292
+ * resolve + signing), scaled by the time `T` left. Use `maxProbability = p + Δp` on exact-quantity
293
+ * mints and `minProbability = p − Δp` on sells, and size cost caps at the shifted probability.
294
+ * A sizing aid pending product sign-off, not a contract rule.
295
+ */
296
+ declare function slippageBand(inputs: SlippageBandInputs): {
297
+ horizonMs: number;
298
+ deltaProbability: number;
299
+ maxProbability: number;
300
+ minProbability: number;
301
+ };
302
+ /** The quote a set of mint limits is sized from: the chain quote at the current price. */
303
+ interface MintLimitsInputs {
304
+ /** The quote's all-in cost after its fee subsidy, order fee excluded. */
305
+ quoteCostRaw: bigint;
306
+ /** The quote's payout quantity. */
307
+ quoteQuantityRaw: bigint;
308
+ /** The quote's entry probability, 1e9-scaled. */
309
+ entryProbabilityRaw: bigint;
310
+ /** The price move to allow per contract, 1e9-scaled: 10¢ is `100_000_000n`. */
311
+ slippageRaw: bigint;
312
+ /**
313
+ * The quote's fee subsidy (`fee_incentive_subsidy`). Defaults to `0n`. Enqueue admission checks
314
+ * the order's limits without the subsidy, and the subsidy can run out before the fill, so the
315
+ * limits add it back: they are sized from the unsubsidized cost.
316
+ */
317
+ feeIncentiveSubsidyRaw?: bigint;
318
+ /** The deployment's `position_lot_size`. Defaults to `10_000n`. */
319
+ lotSize?: bigint;
320
+ }
321
+ /** All-in price per $1 of payout, 1e9-scaled and rounded up. */
322
+ interface PricePerContract {
323
+ /** The quote's price, after its fee subsidy. */
324
+ nowRaw: bigint;
325
+ /** The worst price the limits admit: the price without the fee subsidy, plus the slippage. */
326
+ worstRaw: bigint;
327
+ }
328
+ /**
329
+ * Limits for a queued all-in budget mint (`enqueueMintCost`): the payout floor at the worst price.
330
+ * The fill buys what `budgetRaw` buys at τ and refunds the order when that is below
331
+ * `minQuantityRaw`, so the order fills while the all-in price per $1 of payout stays within
332
+ * `slippageRaw` of the quote.
333
+ */
334
+ declare function budgetMintLimits(inputs: MintLimitsInputs & {
335
+ budgetRaw: bigint;
336
+ }): {
337
+ minQuantityRaw: bigint;
338
+ pricePerContract: PricePerContract;
339
+ };
340
+ /**
341
+ * Limits for a queued exact-quantity mint (`enqueueMint`): the entry-probability cap and the
342
+ * all-in cost cap at the worst price. The cost cap never exceeds the quantity, since a contract
343
+ * never costs more than it pays.
344
+ */
345
+ declare function exactMintLimits(inputs: MintLimitsInputs): {
346
+ maxCostRaw: bigint;
347
+ maxProbabilityRaw: bigint;
348
+ pricePerContract: PricePerContract;
349
+ };
350
+ /**
351
+ * Limits for a queued early sell (`enqueueSell`): the close-probability floor and the proceeds
352
+ * floor at the worst price. `proceedsRaw` is the quote's proceeds before the order fee, as
353
+ * `minProceeds` is.
354
+ */
355
+ declare function sellLimits(inputs: {
356
+ proceedsRaw: bigint;
357
+ closeQuantityRaw: bigint;
358
+ probabilityRaw: bigint;
359
+ slippageRaw: bigint;
360
+ }): {
361
+ minProceedsRaw: bigint;
362
+ minProbabilityRaw: bigint;
363
+ };
364
+ /**
365
+ * A queue record as `queue::order` returns it: the generated `order_queue::OrderView` layout, a
366
+ * copy of the record without Predict's receipt and the escrow balance (`funds` is its value).
367
+ */
368
+ type QueuedOrder = (typeof OrderView$1)['$inferType'];
369
+ /** The position a record holds: a filled mint's, a sell's, or a partial sell's remainder. */
370
+ interface HeldPosition {
371
+ orderId: bigint;
372
+ rootId: bigint;
373
+ openedAtMs: bigint;
374
+ /**
375
+ * The position's payout quantity, decoded from `orderId` at the Move lot size: a filled
376
+ * mint's quantity, or what a partial sell left Open.
377
+ */
378
+ quantityRaw: bigint;
379
+ }
380
+ interface OrderViewBase {
381
+ status: number;
382
+ kind: number;
383
+ kindName: OrderKindName;
384
+ side: 'mint' | 'sell' | 'unknown';
385
+ }
386
+ /**
387
+ * What the app shows for one queued order. `placed` → `priced` → one of `filled` / `refunded`.
388
+ * Report `filled` only from the record or the fill event, never from a resolve simulation.
389
+ */
390
+ type OrderView = OrderViewBase & ({
391
+ state: 'placed';
392
+ tauMs: bigint;
393
+ deadlineMs: bigint; /** τ has passed and the price hasn't been committed yet. */
394
+ awaitingPrice: boolean; /** Keepers refund an unfinished order at its deadline. */
395
+ autoRefundByMs: bigint; /** Offer "Refund my order": unfinished and {@link REFUND_REQUEST_GRACE_MS} past the deadline. */
396
+ canRequestRefund: boolean;
397
+ } | {
398
+ state: 'priced';
399
+ tauMs: bigint; /** The committed update's tick: τ, or a backup tick. */
400
+ tickMs: bigint; /** The committed Pyth price, 1e9-scaled. */
401
+ priceRaw: bigint;
402
+ deadlineMs: bigint;
403
+ msToDeadline: bigint;
404
+ autoRefundByMs: bigint;
405
+ canRequestRefund: boolean;
406
+ } | {
407
+ state: 'refunding';
408
+ reason: RefundReasonInfo;
409
+ deadlineMs: bigint;
410
+ canRequestRefund: boolean;
411
+ } | {
412
+ state: 'filled';
413
+ /**
414
+ * Filled quantity (mint) or closed quantity (sell). A partial sell's remainder is
415
+ * `position.quantityRaw`.
416
+ */
417
+ quantityRaw: bigint; /** Cost paid (mint) or proceeds before the order fee (sell). */
418
+ amountRaw: bigint;
419
+ finishedAtMs: bigint; /** The Open record's position: a filled mint, or a partial sell's remainder. */
420
+ position: HeldPosition | null; /** Whether `enqueue_redeem_open` can sell this record now. */
421
+ sellable: boolean; /** See {@link ParkedFunds}. */
422
+ parkedRaw: bigint;
423
+ } | {
424
+ state: 'refunded';
425
+ reason: RefundReasonInfo;
426
+ finishedAtMs: bigint; /** A refunded sell keeps its position as an Open record, sellable again. */
427
+ positionBackAsOpenRecord: boolean;
428
+ position: HeldPosition | null;
429
+ sellable: boolean; /** See {@link ParkedFunds}. */
430
+ parkedRaw: bigint;
431
+ } | {
432
+ /** A filled mint's record whose position was later sold or settled. */state: 'closed';
433
+ quantityRaw: bigint;
434
+ amountRaw: bigint;
435
+ finishedAtMs: bigint; /** See {@link ParkedFunds}. */
436
+ parkedRaw: bigint;
437
+ } | {
438
+ state: 'unknown';
439
+ });
440
+ /**
441
+ * `parkedRaw` on a finished record: USDC the record kept because its receive address couldn't take
442
+ * it (on USDC's deny list, or USDC paused) when its change or refund was sent. It is the
443
+ * record's `funds`, which holds only parked USDC once the order finishes. Anyone can send it with
444
+ * `claim_parked` once the address is clear. `0n` when nothing is parked.
445
+ */
446
+ type ParkedFunds = bigint;
447
+ /**
448
+ * Map a queue record to its display state. `nowMs` drives the refund flags. A record is sellable
449
+ * while it is Open, holds a position, and `nowMs` is before the cutoff (`opts.cutoffMs`, or the
450
+ * record's own placement cutoff when omitted). Unknown status or kind codes map to `unknown`.
451
+ * `opts.lotSize` is the config's position lot (default 10,000, Predict's), which decodes a held
452
+ * position's quantity.
453
+ */
454
+ declare function orderView(record: QueuedOrder, nowMs: bigint, opts?: {
455
+ cutoffMs?: bigint;
456
+ lotSize?: bigint;
457
+ }): OrderView;
458
+ /** One record's state rebuilt from events, for the app's event path (indexer or own effects). */
459
+ interface OrderEventState {
460
+ marketId: string;
461
+ recordId: bigint;
462
+ /**
463
+ * `closed`: the record's position moved into a later sell's record (`enqueue_redeem_open` closes
464
+ * the source record), so this record holds nothing any more.
465
+ */
466
+ state: 'placed' | 'priced' | 'filled' | 'refunded' | 'settled' | 'closed';
467
+ kind: number | null;
468
+ tauMs: bigint | null;
469
+ deadlineMs: bigint | null;
470
+ /** Set once priced: the committed Pyth price as a float (`spot / 1e9`) and its tick. */
471
+ price: number | null;
472
+ tickMs: bigint | null;
473
+ /**
474
+ * Set on a refund. The settlement drain (`settle_step`) refunds the orders still waiting at
475
+ * expiry with reason 5 (deadline), like a keeper's deadline refund.
476
+ */
477
+ reason: RefundReasonInfo | null;
478
+ /**
479
+ * The position the record holds now, or null. A sell's record takes its source's position at
480
+ * enqueue and keeps it through a refund, a fill leaves a mint's new position or a partial
481
+ * sell's remainder, and a later sell, a full close or settlement clears it.
482
+ */
483
+ position: HeldPosition | null;
484
+ /** For a sell: the record its position came from. */
485
+ sourceRecordId: bigint | null;
486
+ /** Set when `settle_step` or `pay_open` paid the record (0 for a loser). */
487
+ payoutRaw: bigint | null;
488
+ /** True after `OpenRecordPayoutSkipped`: the record stays Open, unpaid for now. */
489
+ payoutSkipped: boolean;
490
+ /**
491
+ * USDC the record holds parked (`RecordFundsParked`, summed) until `RecordFundsClaimed`. See
492
+ * {@link ParkedFunds}.
493
+ */
494
+ parkedRaw: bigint;
495
+ }
496
+ /**
497
+ * Fold decoded queue events (in chain order) into per-record states, keyed `marketId:recordId`.
498
+ * The app shows Placed from the enqueue's own effects, Priced at the cohort commit, and switches to
499
+ * Filled or Refunded on `QueuedOrderFilled` / `QueuedOrderRefunded`. Events for records that never
500
+ * appeared enqueued still create an entry, so a partial event window works.
501
+ */
502
+ declare function reduceOrderEvents(events: readonly QueueEvent[], into?: Map<string, OrderEventState>): Map<string, OrderEventState>;
503
+ //#endregion
504
+ export { DelayedExecutionPolicy, HeldPosition, MaxMintNow, OrderKindName, OrderView, QueueHeads, QueuedOrder, RefundReasonInfo, TimingPreview, queue_d_exports, slippageBand };
505
+ //# sourceMappingURL=queue.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.mts","names":[],"sources":["../../src/predict/queue.ts"],"mappings":";;;;;;;;;;;;;;;;cAkCa,yBAAA;;;;;;;cAQA,uBAAA;;;;;;cAOA,0BAAA;;cAGA,YAAA,EAAY,QAAA;;;;;;;;;;cAaZ,YAAA,EAAY,QAAA;EAAA;;;;;;;;cAWZ,UAAA,EAAU,QAAA;EAAA;;;;;;;cASV,aAAA,EAAa,QAAA;EAAA;;;;;;;;;;;cAab,YAAA,EAAY,QAAA;EAAA;;;;cAMZ,yBAAA;;;AApDb;;cA0Da,uBAAA;AAAA,KAED,eAAA;AAAA,KAGA,aAAA;;iBAoBI,eAAA,CAAgB,I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