@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.
- package/CHANGELOG.md +153 -0
- package/PREDICT.md +389 -61
- package/dist/contracts/account/account.d.mts +23 -23
- package/dist/contracts/account/account.d.mts.map +1 -1
- package/dist/contracts/account/account_registry.d.mts +13 -13
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/admin.d.mts +4 -4
- package/dist/contracts/deepbook_predict/builder_code.d.mts +11 -11
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +10 -10
- package/dist/contracts/deepbook_predict/config_events.d.mts +93 -68
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.mjs +45 -1
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/deps/std/type_name.mjs +17 -0
- package/dist/contracts/deepbook_predict/deps/std/type_name.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +652 -235
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs +652 -186
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/lp_book.mjs +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/market_manager.d.mts +27 -27
- package/dist/contracts/deepbook_predict/order_events.d.mts +50 -50
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.mjs +3 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/plp.d.mts +184 -82
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/plp.mjs +126 -7
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_accounting.mjs +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/predict_account.d.mts +14 -14
- package/dist/contracts/deepbook_predict/pricing.d.mts +91 -58
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.mjs +30 -3
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing_config.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +400 -92
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.mjs +451 -61
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/range_codec.d.mts +2 -2
- package/dist/contracts/deepbook_predict/registry.d.mts +28 -28
- package/dist/contracts/deepbook_predict/strike_exposure.mjs +1 -1
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +17 -12
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.d.mts +154 -106
- package/dist/contracts/deepbook_predict/vault_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs +57 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict_math/config-arguments.d.mts +10 -0
- package/dist/contracts/deepbook_predict_math/config-arguments.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_math/lazer_price.d.mts +106 -0
- package/dist/contracts/deepbook_predict_math/lazer_price.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_math/lazer_price.mjs +125 -0
- package/dist/contracts/deepbook_predict_math/lazer_price.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_math/math.d.mts +284 -0
- package/dist/contracts/deepbook_predict_math/math.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_math/math.mjs +364 -0
- package/dist/contracts/deepbook_predict_math/math.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/config-arguments.d.mts +13 -0
- package/dist/contracts/deepbook_predict_orders/config-arguments.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts +215 -0
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.mjs +215 -0
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs +87 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.mjs +52 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/fixed_math/i64.mjs +25 -0
- package/dist/contracts/deepbook_predict_orders/deps/fixed_math/i64.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/sui/balance.mjs +21 -0
- package/dist/contracts/deepbook_predict_orders/deps/sui/balance.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/deps/sui/table.mjs +39 -0
- package/dist/contracts/deepbook_predict_orders/deps/sui/table.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/desk.d.mts +187 -0
- package/dist/contracts/deepbook_predict_orders/desk.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/desk.mjs +261 -0
- package/dist/contracts/deepbook_predict_orders/desk.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/order_queue.d.mts +1042 -0
- package/dist/contracts/deepbook_predict_orders/order_queue.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/order_queue.mjs +849 -0
- package/dist/contracts/deepbook_predict_orders/order_queue.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/queue.d.mts +683 -0
- package/dist/contracts/deepbook_predict_orders/queue.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/queue.mjs +912 -0
- package/dist/contracts/deepbook_predict_orders/queue.mjs.map +1 -0
- package/dist/contracts/deepbook_predict_orders/queue_events.d.mts +195 -0
- package/dist/contracts/deepbook_predict_orders/queue_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict_orders/queue_events.mjs +187 -0
- package/dist/contracts/deepbook_predict_orders/queue_events.mjs.map +1 -0
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/sessions.d.mts +163 -28
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.mjs +234 -5
- package/dist/contracts/deepbook_sessions/sessions.mjs.map +1 -1
- package/dist/deployments/mainnet.mjs +7 -4
- package/dist/deployments/mainnet.mjs.map +1 -1
- package/dist/deployments/testnet.mjs +7 -4
- package/dist/deployments/testnet.mjs.map +1 -1
- package/dist/predict/bindings/expiry-market.d.mts +77 -0
- package/dist/predict/bindings/expiry-market.d.mts.map +1 -0
- package/dist/predict/bindings/expiry-market.mjs +139 -0
- package/dist/predict/bindings/expiry-market.mjs.map +1 -0
- package/dist/predict/bindings/protocol-config.d.mts +39 -0
- package/dist/predict/bindings/protocol-config.d.mts.map +1 -0
- package/dist/predict/bindings/protocol-config.mjs +90 -0
- package/dist/predict/bindings/protocol-config.mjs.map +1 -0
- package/dist/predict/bindings/rename.mjs +9 -0
- package/dist/predict/bindings/rename.mjs.map +1 -0
- package/dist/predict/client.d.mts +595 -16
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +986 -10
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/config/generated.d.mts +22 -1
- package/dist/predict/config/generated.d.mts.map +1 -1
- package/dist/predict/config/generated.mjs +30 -1
- package/dist/predict/config/generated.mjs.map +1 -1
- package/dist/predict/config/mainnet.mjs +11 -3
- package/dist/predict/config/mainnet.mjs.map +1 -1
- package/dist/predict/config/testnet.mjs +11 -3
- package/dist/predict/config/testnet.mjs.map +1 -1
- package/dist/predict/config/types.d.mts +50 -1
- package/dist/predict/config/types.d.mts.map +1 -1
- package/dist/predict/cost.d.mts +38 -11
- package/dist/predict/cost.d.mts.map +1 -1
- package/dist/predict/cost.mjs +37 -11
- package/dist/predict/cost.mjs.map +1 -1
- package/dist/predict/decode.d.mts +251 -1
- package/dist/predict/decode.d.mts.map +1 -1
- package/dist/predict/decode.mjs +342 -4
- package/dist/predict/decode.mjs.map +1 -1
- package/dist/predict/errors.d.mts +69 -6
- package/dist/predict/errors.d.mts.map +1 -1
- package/dist/predict/errors.mjs +277 -4
- package/dist/predict/errors.mjs.map +1 -1
- package/dist/predict/index.d.mts +21 -10
- package/dist/predict/index.mjs +24 -12
- package/dist/predict/queue-id.d.mts +13 -0
- package/dist/predict/queue-id.d.mts.map +1 -0
- package/dist/predict/queue-id.mjs +19 -0
- package/dist/predict/queue-id.mjs.map +1 -0
- package/dist/predict/queue.d.mts +505 -0
- package/dist/predict/queue.d.mts.map +1 -0
- package/dist/predict/queue.mjs +774 -0
- package/dist/predict/queue.mjs.map +1 -0
- package/dist/predict/reads/balances.mjs +1 -1
- package/dist/predict/reads/markets.mjs +46 -5
- package/dist/predict/reads/markets.mjs.map +1 -1
- package/dist/predict/reads/pool.mjs +1 -1
- package/dist/predict/reads/pricing.d.mts +1 -1
- package/dist/predict/reads/queue.d.mts +105 -0
- package/dist/predict/reads/queue.d.mts.map +1 -0
- package/dist/predict/reads/queue.mjs +445 -0
- package/dist/predict/reads/queue.mjs.map +1 -0
- package/dist/predict/ticks.d.mts +9 -1
- package/dist/predict/ticks.d.mts.map +1 -1
- package/dist/predict/ticks.mjs +18 -1
- package/dist/predict/ticks.mjs.map +1 -1
- package/dist/predict/tx/authed.mjs +1 -1
- package/dist/predict/tx/common.d.mts.map +1 -1
- package/dist/predict/tx/common.mjs +12 -1
- package/dist/predict/tx/common.mjs.map +1 -1
- package/dist/predict/tx/queue.d.mts +220 -0
- package/dist/predict/tx/queue.d.mts.map +1 -0
- package/dist/predict/tx/queue.mjs +399 -0
- package/dist/predict/tx/queue.mjs.map +1 -0
- package/dist/predict/tx/trade.d.mts.map +1 -1
- package/dist/predict/tx/trade.mjs +61 -43
- package/dist/predict/tx/trade.mjs.map +1 -1
- package/dist/sessions.d.mts +90 -2
- package/dist/sessions.d.mts.map +1 -1
- package/dist/sessions.mjs +107 -2
- package/dist/sessions.mjs.map +1 -1
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/balanceManager.d.mts.map +1 -1
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbook.d.mts.map +1 -1
- package/dist/transactions/deepbookAdmin.d.mts +4 -4
- package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
- package/dist/transactions/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginAdmin.d.mts.map +1 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginMaintainer.d.mts.map +1 -1
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginManager.d.mts.map +1 -1
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginRegistry.d.mts +16 -16
- package/dist/transactions/marginTPSL.d.mts +10 -10
- package/dist/transactions/marginTPSL.d.mts.map +1 -1
- package/dist/transactions/poolProxy.d.mts +8 -8
- package/dist/transactions/poolProxy.d.mts.map +1 -1
- package/package.json +4 -4
- package/src/contracts/deepbook_predict/config_events.ts +39 -0
- package/src/contracts/deepbook_predict/deps/std/type_name.ts +24 -0
- package/src/contracts/deepbook_predict/expiry_market.ts +960 -169
- package/src/contracts/deepbook_predict/order_events.ts +3 -1
- package/src/contracts/deepbook_predict/plp.ts +150 -9
- package/src/contracts/deepbook_predict/pricing.ts +46 -7
- package/src/contracts/deepbook_predict/pricing_config.ts +3 -1
- package/src/contracts/deepbook_predict/protocol_config.ts +648 -33
- package/src/contracts/deepbook_predict/strike_payout_tree.ts +25 -21
- package/src/contracts/deepbook_predict/vault_events.ts +65 -0
- package/src/contracts/deepbook_predict_math/config-arguments.ts +6 -0
- package/src/contracts/deepbook_predict_math/lazer_price.ts +196 -0
- package/src/contracts/deepbook_predict_math/math.ts +553 -0
- package/src/contracts/deepbook_predict_orders/config-arguments.ts +11 -0
- package/src/contracts/deepbook_predict_orders/delayed_execution_config.ts +430 -0
- package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.ts +108 -0
- package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.ts +58 -0
- package/src/contracts/deepbook_predict_orders/deps/fixed_math/i64.ts +21 -0
- package/src/contracts/deepbook_predict_orders/deps/sui/balance.ts +19 -0
- package/src/contracts/deepbook_predict_orders/deps/sui/table.ts +37 -0
- package/src/contracts/deepbook_predict_orders/desk.ts +419 -0
- package/src/contracts/deepbook_predict_orders/order_flow.ts +19 -0
- package/src/contracts/deepbook_predict_orders/order_queue.ts +1670 -0
- package/src/contracts/deepbook_predict_orders/queue.ts +1394 -0
- package/src/contracts/deepbook_predict_orders/queue_events.ts +189 -0
- package/src/contracts/deepbook_sessions/sessions.ts +355 -4
- package/src/deployments/mainnet.ts +7 -2
- package/src/deployments/testnet.ts +7 -2
- package/src/deployments/types.ts +14 -1
- package/src/predict/bindings/expiry-market.ts +127 -0
- package/src/predict/bindings/protocol-config.ts +59 -0
- package/src/predict/bindings/rename.ts +14 -0
- package/src/predict/client.ts +2076 -13
- package/src/predict/config/generated.ts +50 -0
- package/src/predict/config/mainnet.ts +16 -2
- package/src/predict/config/testnet.ts +16 -2
- package/src/predict/config/types.ts +51 -1
- package/src/predict/cost.ts +62 -14
- package/src/predict/decode.ts +691 -2
- package/src/predict/errors.ts +391 -14
- package/src/predict/index.ts +87 -6
- package/src/predict/queue-id.ts +22 -0
- package/src/predict/queue.ts +1231 -0
- package/src/predict/reads/markets.ts +30 -0
- package/src/predict/reads/queue.ts +606 -0
- package/src/predict/ticks.ts +35 -0
- package/src/predict/tx/common.ts +25 -1
- package/src/predict/tx/queue.ts +525 -0
- package/src/predict/tx/trade.ts +80 -49
- 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
|