@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
|
@@ -0,0 +1,849 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.mjs";
|
|
3
|
+
import { U256, U64 } from "../../bcs/integers.mjs";
|
|
4
|
+
import { Table } from "./deps/sui/table.mjs";
|
|
5
|
+
import { OrderReceipt } from "./deps/deepbook_predict/expiry_market.mjs";
|
|
6
|
+
import { Balance } from "./deps/sui/balance.mjs";
|
|
7
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
8
|
+
|
|
9
|
+
//#region src/contracts/deepbook_predict_orders/order_queue.ts
|
|
10
|
+
/**************************************************************
|
|
11
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
12
|
+
**************************************************************/
|
|
13
|
+
/**
|
|
14
|
+
* One market's queue of delayed-execution orders: queued mints and early sells
|
|
15
|
+
* that fill at Pyth's signed price for their τ, or are refunded.
|
|
16
|
+
*
|
|
17
|
+
* This module owns the `OrderBook` a `MarketQueue` holds and its records
|
|
18
|
+
* (`QueuedOrder` and its parts): the status, kind, and refund-reason codes, τ and
|
|
19
|
+
* deadline planning, the stuck check, the counters and cohort spans, and the
|
|
20
|
+
* walker primitives. A record holds Predict's `OrderReceipt` for its order and
|
|
21
|
+
* that order's own escrow `Balance<USDC>` in one table row, so a refund pays
|
|
22
|
+
* exactly that record's escrow and a record that still holds a receipt cannot be
|
|
23
|
+
* deleted. Predict owns the payout-tree pins and the waiting cash need. The
|
|
24
|
+
* `queue` module owns the flow gates, every Predict call, and every queue event.
|
|
25
|
+
*/
|
|
26
|
+
var order_queue_exports = /* @__PURE__ */ __exportAll({
|
|
27
|
+
CohortSpan: () => CohortSpan,
|
|
28
|
+
CommittedPrice: () => CommittedPrice,
|
|
29
|
+
HeldPosition: () => HeldPosition,
|
|
30
|
+
OrderBook: () => OrderBook,
|
|
31
|
+
OrderEscrow: () => OrderEscrow,
|
|
32
|
+
OrderRequest: () => OrderRequest,
|
|
33
|
+
OrderResult: () => OrderResult,
|
|
34
|
+
OrderTiming: () => OrderTiming,
|
|
35
|
+
OrderView: () => OrderView,
|
|
36
|
+
QueuedOrder: () => QueuedOrder,
|
|
37
|
+
accountId: () => accountId,
|
|
38
|
+
budget: () => budget,
|
|
39
|
+
cashNeed: () => cashNeed,
|
|
40
|
+
cutoffMs: () => cutoffMs,
|
|
41
|
+
deadlineMs: () => deadlineMs,
|
|
42
|
+
earliestPriceMs: () => earliestPriceMs,
|
|
43
|
+
escrow: () => escrow,
|
|
44
|
+
finishedAtMs: () => finishedAtMs,
|
|
45
|
+
funds: () => funds,
|
|
46
|
+
generationUs: () => generationUs,
|
|
47
|
+
higherTick: () => higherTick,
|
|
48
|
+
kind: () => kind,
|
|
49
|
+
kindExactAmount: () => kindExactAmount,
|
|
50
|
+
kindExactCost: () => kindExactCost,
|
|
51
|
+
kindExactQuantity: () => kindExactQuantity,
|
|
52
|
+
kindRedeemLive: () => kindRedeemLive,
|
|
53
|
+
kindRedeemOpen: () => kindRedeemOpen,
|
|
54
|
+
lowerTick: () => lowerTick,
|
|
55
|
+
maxCost: () => maxCost,
|
|
56
|
+
maxPremium: () => maxPremium,
|
|
57
|
+
maxProbability: () => maxProbability,
|
|
58
|
+
minProbability: () => minProbability,
|
|
59
|
+
minProceeds: () => minProceeds,
|
|
60
|
+
minQuantity: () => minQuantity,
|
|
61
|
+
openedAtMs: () => openedAtMs,
|
|
62
|
+
orderFee: () => orderFee,
|
|
63
|
+
orderId: () => orderId,
|
|
64
|
+
placedAtMs: () => placedAtMs,
|
|
65
|
+
position: () => position,
|
|
66
|
+
price: () => price,
|
|
67
|
+
pythChannel: () => pythChannel,
|
|
68
|
+
quantity: () => quantity,
|
|
69
|
+
reason: () => reason,
|
|
70
|
+
reasonAdmin: () => reasonAdmin,
|
|
71
|
+
reasonAdmission: () => reasonAdmission,
|
|
72
|
+
reasonDeadline: () => reasonDeadline,
|
|
73
|
+
reasonFreeze: () => reasonFreeze,
|
|
74
|
+
reasonLimits: () => reasonLimits,
|
|
75
|
+
reasonMissingNode: () => reasonMissingNode,
|
|
76
|
+
reasonNoCash: () => reasonNoCash,
|
|
77
|
+
reasonNoPrice: () => reasonNoPrice,
|
|
78
|
+
reasonRecipientDenied: () => reasonRecipientDenied,
|
|
79
|
+
receiptStage: () => receiptStage,
|
|
80
|
+
receiveAddress: () => receiveAddress,
|
|
81
|
+
request: () => request,
|
|
82
|
+
result: () => result,
|
|
83
|
+
resultAmount: () => resultAmount,
|
|
84
|
+
resultQuantity: () => resultQuantity,
|
|
85
|
+
rootId: () => rootId,
|
|
86
|
+
spot: () => spot,
|
|
87
|
+
status: () => status,
|
|
88
|
+
statusClosed: () => statusClosed,
|
|
89
|
+
statusCommitted: () => statusCommitted,
|
|
90
|
+
statusOpen: () => statusOpen,
|
|
91
|
+
statusPending: () => statusPending,
|
|
92
|
+
statusRefundDue: () => statusRefundDue,
|
|
93
|
+
statusRefunded: () => statusRefunded,
|
|
94
|
+
subsidyBound: () => subsidyBound,
|
|
95
|
+
subsidyReserved: () => subsidyReserved,
|
|
96
|
+
tauMs: () => tauMs,
|
|
97
|
+
tickMs: () => tickMs,
|
|
98
|
+
timing: () => timing
|
|
99
|
+
});
|
|
100
|
+
const $moduleName = "@local-pkg/deepbook_predict_orders::order_queue";
|
|
101
|
+
const CohortSpan = new MoveStruct({
|
|
102
|
+
name: `${$moduleName}::CohortSpan`,
|
|
103
|
+
fields: {
|
|
104
|
+
tau_ms: U64,
|
|
105
|
+
deadline_ms: U64,
|
|
106
|
+
first_id: U64,
|
|
107
|
+
end_id: U64,
|
|
108
|
+
pyth_channel: bcs.u8(),
|
|
109
|
+
committed: bcs.bool(),
|
|
110
|
+
unfinished: U64
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
const OrderBook = new MoveStruct({
|
|
114
|
+
name: `${$moduleName}::OrderBook`,
|
|
115
|
+
fields: {
|
|
116
|
+
orders: Table,
|
|
117
|
+
next_id: U64,
|
|
118
|
+
resolve_head: U64,
|
|
119
|
+
payout_cursor: U64,
|
|
120
|
+
cohorts: bcs.vector(CohortSpan),
|
|
121
|
+
last_tau_ms: U64,
|
|
122
|
+
last_committed_tau_ms: U64,
|
|
123
|
+
last_deadline_ms: U64,
|
|
124
|
+
last_channel: bcs.u8(),
|
|
125
|
+
per_account: Table,
|
|
126
|
+
pending_mints: U64,
|
|
127
|
+
pending_sells: U64
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
const OrderRequest = new MoveStruct({
|
|
131
|
+
name: `${$moduleName}::OrderRequest`,
|
|
132
|
+
fields: {
|
|
133
|
+
lower_tick: U64,
|
|
134
|
+
higher_tick: U64,
|
|
135
|
+
quantity: U64,
|
|
136
|
+
max_premium: U64,
|
|
137
|
+
min_quantity: U64,
|
|
138
|
+
max_cost: U64,
|
|
139
|
+
max_probability: U64,
|
|
140
|
+
min_probability: U64,
|
|
141
|
+
min_proceeds: U64
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
const OrderTiming = new MoveStruct({
|
|
145
|
+
name: `${$moduleName}::OrderTiming`,
|
|
146
|
+
fields: {
|
|
147
|
+
placed_at_ms: U64,
|
|
148
|
+
earliest_price_ms: U64,
|
|
149
|
+
tau_ms: U64,
|
|
150
|
+
deadline_ms: U64,
|
|
151
|
+
cutoff_ms: U64,
|
|
152
|
+
pyth_channel: bcs.u8()
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
const OrderEscrow = new MoveStruct({
|
|
156
|
+
name: `${$moduleName}::OrderEscrow`,
|
|
157
|
+
fields: {
|
|
158
|
+
budget: U64,
|
|
159
|
+
order_fee: U64,
|
|
160
|
+
subsidy_bound: U64,
|
|
161
|
+
subsidy_reserved: U64,
|
|
162
|
+
cash_need: U64
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const HeldPosition = new MoveStruct({
|
|
166
|
+
name: `${$moduleName}::HeldPosition`,
|
|
167
|
+
fields: {
|
|
168
|
+
order_id: U256,
|
|
169
|
+
root_id: U256,
|
|
170
|
+
opened_at_ms: U64
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
const CommittedPrice = new MoveStruct({
|
|
174
|
+
name: `${$moduleName}::CommittedPrice`,
|
|
175
|
+
fields: {
|
|
176
|
+
spot: U64,
|
|
177
|
+
tick_ms: U64,
|
|
178
|
+
generation_us: U64
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
const OrderResult = new MoveStruct({
|
|
182
|
+
name: `${$moduleName}::OrderResult`,
|
|
183
|
+
fields: {
|
|
184
|
+
reason: bcs.u8(),
|
|
185
|
+
quantity: U64,
|
|
186
|
+
amount: U64,
|
|
187
|
+
finished_at_ms: U64
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
const QueuedOrder = new MoveStruct({
|
|
191
|
+
name: `${$moduleName}::QueuedOrder`,
|
|
192
|
+
fields: {
|
|
193
|
+
status: bcs.u8(),
|
|
194
|
+
kind: bcs.u8(),
|
|
195
|
+
request: OrderRequest,
|
|
196
|
+
account_id: bcs.Address,
|
|
197
|
+
receive_address: bcs.Address,
|
|
198
|
+
timing: OrderTiming,
|
|
199
|
+
escrow: OrderEscrow,
|
|
200
|
+
position: HeldPosition,
|
|
201
|
+
price: CommittedPrice,
|
|
202
|
+
result: OrderResult,
|
|
203
|
+
receipt: bcs.option(OrderReceipt),
|
|
204
|
+
funds: Balance
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
const OrderView = new MoveStruct({
|
|
208
|
+
name: `${$moduleName}::OrderView`,
|
|
209
|
+
fields: {
|
|
210
|
+
status: bcs.u8(),
|
|
211
|
+
kind: bcs.u8(),
|
|
212
|
+
request: OrderRequest,
|
|
213
|
+
account_id: bcs.Address,
|
|
214
|
+
receive_address: bcs.Address,
|
|
215
|
+
timing: OrderTiming,
|
|
216
|
+
escrow: OrderEscrow,
|
|
217
|
+
position: HeldPosition,
|
|
218
|
+
price: CommittedPrice,
|
|
219
|
+
result: OrderResult,
|
|
220
|
+
receipt_stage: bcs.u8(),
|
|
221
|
+
funds: U64
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
function statusPending(options = {}) {
|
|
225
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
226
|
+
return (tx) => tx.moveCall({
|
|
227
|
+
package: packageAddress,
|
|
228
|
+
module: "order_queue",
|
|
229
|
+
function: "status_pending"
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function statusCommitted(options = {}) {
|
|
233
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
234
|
+
return (tx) => tx.moveCall({
|
|
235
|
+
package: packageAddress,
|
|
236
|
+
module: "order_queue",
|
|
237
|
+
function: "status_committed"
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function statusOpen(options = {}) {
|
|
241
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
242
|
+
return (tx) => tx.moveCall({
|
|
243
|
+
package: packageAddress,
|
|
244
|
+
module: "order_queue",
|
|
245
|
+
function: "status_open"
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
function statusRefunded(options = {}) {
|
|
249
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
250
|
+
return (tx) => tx.moveCall({
|
|
251
|
+
package: packageAddress,
|
|
252
|
+
module: "order_queue",
|
|
253
|
+
function: "status_refunded"
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function statusClosed(options = {}) {
|
|
257
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
258
|
+
return (tx) => tx.moveCall({
|
|
259
|
+
package: packageAddress,
|
|
260
|
+
module: "order_queue",
|
|
261
|
+
function: "status_closed"
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
function statusRefundDue(options = {}) {
|
|
265
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
266
|
+
return (tx) => tx.moveCall({
|
|
267
|
+
package: packageAddress,
|
|
268
|
+
module: "order_queue",
|
|
269
|
+
function: "status_refund_due"
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function kindExactQuantity(options = {}) {
|
|
273
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
274
|
+
return (tx) => tx.moveCall({
|
|
275
|
+
package: packageAddress,
|
|
276
|
+
module: "order_queue",
|
|
277
|
+
function: "kind_exact_quantity"
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
function kindExactAmount(options = {}) {
|
|
281
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
282
|
+
return (tx) => tx.moveCall({
|
|
283
|
+
package: packageAddress,
|
|
284
|
+
module: "order_queue",
|
|
285
|
+
function: "kind_exact_amount"
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
function kindExactCost(options = {}) {
|
|
289
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
290
|
+
return (tx) => tx.moveCall({
|
|
291
|
+
package: packageAddress,
|
|
292
|
+
module: "order_queue",
|
|
293
|
+
function: "kind_exact_cost"
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
function kindRedeemLive(options = {}) {
|
|
297
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
298
|
+
return (tx) => tx.moveCall({
|
|
299
|
+
package: packageAddress,
|
|
300
|
+
module: "order_queue",
|
|
301
|
+
function: "kind_redeem_live"
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
function kindRedeemOpen(options = {}) {
|
|
305
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
306
|
+
return (tx) => tx.moveCall({
|
|
307
|
+
package: packageAddress,
|
|
308
|
+
module: "order_queue",
|
|
309
|
+
function: "kind_redeem_open"
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
function reasonLimits(options = {}) {
|
|
313
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
314
|
+
return (tx) => tx.moveCall({
|
|
315
|
+
package: packageAddress,
|
|
316
|
+
module: "order_queue",
|
|
317
|
+
function: "reason_limits"
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function reasonAdmission(options = {}) {
|
|
321
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
322
|
+
return (tx) => tx.moveCall({
|
|
323
|
+
package: packageAddress,
|
|
324
|
+
module: "order_queue",
|
|
325
|
+
function: "reason_admission"
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function reasonNoPrice(options = {}) {
|
|
329
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
330
|
+
return (tx) => tx.moveCall({
|
|
331
|
+
package: packageAddress,
|
|
332
|
+
module: "order_queue",
|
|
333
|
+
function: "reason_no_price"
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function reasonMissingNode(options = {}) {
|
|
337
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
338
|
+
return (tx) => tx.moveCall({
|
|
339
|
+
package: packageAddress,
|
|
340
|
+
module: "order_queue",
|
|
341
|
+
function: "reason_missing_node"
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
function reasonDeadline(options = {}) {
|
|
345
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
346
|
+
return (tx) => tx.moveCall({
|
|
347
|
+
package: packageAddress,
|
|
348
|
+
module: "order_queue",
|
|
349
|
+
function: "reason_deadline"
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
function reasonFreeze(options = {}) {
|
|
353
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
354
|
+
return (tx) => tx.moveCall({
|
|
355
|
+
package: packageAddress,
|
|
356
|
+
module: "order_queue",
|
|
357
|
+
function: "reason_freeze"
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
function reasonAdmin(options = {}) {
|
|
361
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
362
|
+
return (tx) => tx.moveCall({
|
|
363
|
+
package: packageAddress,
|
|
364
|
+
module: "order_queue",
|
|
365
|
+
function: "reason_admin"
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function reasonNoCash(options = {}) {
|
|
369
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
370
|
+
return (tx) => tx.moveCall({
|
|
371
|
+
package: packageAddress,
|
|
372
|
+
module: "order_queue",
|
|
373
|
+
function: "reason_no_cash"
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
function reasonRecipientDenied(options = {}) {
|
|
377
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
378
|
+
return (tx) => tx.moveCall({
|
|
379
|
+
package: packageAddress,
|
|
380
|
+
module: "order_queue",
|
|
381
|
+
function: "reason_recipient_denied"
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
function status(options) {
|
|
385
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
386
|
+
const argumentsTypes = [null];
|
|
387
|
+
const parameterNames = ["view"];
|
|
388
|
+
return (tx) => tx.moveCall({
|
|
389
|
+
package: packageAddress,
|
|
390
|
+
module: "order_queue",
|
|
391
|
+
function: "status",
|
|
392
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
function kind(options) {
|
|
396
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
397
|
+
const argumentsTypes = [null];
|
|
398
|
+
const parameterNames = ["view"];
|
|
399
|
+
return (tx) => tx.moveCall({
|
|
400
|
+
package: packageAddress,
|
|
401
|
+
module: "order_queue",
|
|
402
|
+
function: "kind",
|
|
403
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
function request(options) {
|
|
407
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
408
|
+
const argumentsTypes = [null];
|
|
409
|
+
const parameterNames = ["view"];
|
|
410
|
+
return (tx) => tx.moveCall({
|
|
411
|
+
package: packageAddress,
|
|
412
|
+
module: "order_queue",
|
|
413
|
+
function: "request",
|
|
414
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
function accountId(options) {
|
|
418
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
419
|
+
const argumentsTypes = [null];
|
|
420
|
+
const parameterNames = ["view"];
|
|
421
|
+
return (tx) => tx.moveCall({
|
|
422
|
+
package: packageAddress,
|
|
423
|
+
module: "order_queue",
|
|
424
|
+
function: "account_id",
|
|
425
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
function receiveAddress(options) {
|
|
429
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
430
|
+
const argumentsTypes = [null];
|
|
431
|
+
const parameterNames = ["view"];
|
|
432
|
+
return (tx) => tx.moveCall({
|
|
433
|
+
package: packageAddress,
|
|
434
|
+
module: "order_queue",
|
|
435
|
+
function: "receive_address",
|
|
436
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
function timing(options) {
|
|
440
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
441
|
+
const argumentsTypes = [null];
|
|
442
|
+
const parameterNames = ["view"];
|
|
443
|
+
return (tx) => tx.moveCall({
|
|
444
|
+
package: packageAddress,
|
|
445
|
+
module: "order_queue",
|
|
446
|
+
function: "timing",
|
|
447
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
function escrow(options) {
|
|
451
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
452
|
+
const argumentsTypes = [null];
|
|
453
|
+
const parameterNames = ["view"];
|
|
454
|
+
return (tx) => tx.moveCall({
|
|
455
|
+
package: packageAddress,
|
|
456
|
+
module: "order_queue",
|
|
457
|
+
function: "escrow",
|
|
458
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
function position(options) {
|
|
462
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
463
|
+
const argumentsTypes = [null];
|
|
464
|
+
const parameterNames = ["view"];
|
|
465
|
+
return (tx) => tx.moveCall({
|
|
466
|
+
package: packageAddress,
|
|
467
|
+
module: "order_queue",
|
|
468
|
+
function: "position",
|
|
469
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
function price(options) {
|
|
473
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
474
|
+
const argumentsTypes = [null];
|
|
475
|
+
const parameterNames = ["view"];
|
|
476
|
+
return (tx) => tx.moveCall({
|
|
477
|
+
package: packageAddress,
|
|
478
|
+
module: "order_queue",
|
|
479
|
+
function: "price",
|
|
480
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
function result(options) {
|
|
484
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
485
|
+
const argumentsTypes = [null];
|
|
486
|
+
const parameterNames = ["view"];
|
|
487
|
+
return (tx) => tx.moveCall({
|
|
488
|
+
package: packageAddress,
|
|
489
|
+
module: "order_queue",
|
|
490
|
+
function: "result",
|
|
491
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
function receiptStage(options) {
|
|
495
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
496
|
+
const argumentsTypes = [null];
|
|
497
|
+
const parameterNames = ["view"];
|
|
498
|
+
return (tx) => tx.moveCall({
|
|
499
|
+
package: packageAddress,
|
|
500
|
+
module: "order_queue",
|
|
501
|
+
function: "receipt_stage",
|
|
502
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
function funds(options) {
|
|
506
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
507
|
+
const argumentsTypes = [null];
|
|
508
|
+
const parameterNames = ["view"];
|
|
509
|
+
return (tx) => tx.moveCall({
|
|
510
|
+
package: packageAddress,
|
|
511
|
+
module: "order_queue",
|
|
512
|
+
function: "funds",
|
|
513
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
function lowerTick(options) {
|
|
517
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
518
|
+
const argumentsTypes = [null];
|
|
519
|
+
const parameterNames = ["request"];
|
|
520
|
+
return (tx) => tx.moveCall({
|
|
521
|
+
package: packageAddress,
|
|
522
|
+
module: "order_queue",
|
|
523
|
+
function: "lower_tick",
|
|
524
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
function higherTick(options) {
|
|
528
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
529
|
+
const argumentsTypes = [null];
|
|
530
|
+
const parameterNames = ["request"];
|
|
531
|
+
return (tx) => tx.moveCall({
|
|
532
|
+
package: packageAddress,
|
|
533
|
+
module: "order_queue",
|
|
534
|
+
function: "higher_tick",
|
|
535
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
function quantity(options) {
|
|
539
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
540
|
+
const argumentsTypes = [null];
|
|
541
|
+
const parameterNames = ["request"];
|
|
542
|
+
return (tx) => tx.moveCall({
|
|
543
|
+
package: packageAddress,
|
|
544
|
+
module: "order_queue",
|
|
545
|
+
function: "quantity",
|
|
546
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
function maxPremium(options) {
|
|
550
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
551
|
+
const argumentsTypes = [null];
|
|
552
|
+
const parameterNames = ["request"];
|
|
553
|
+
return (tx) => tx.moveCall({
|
|
554
|
+
package: packageAddress,
|
|
555
|
+
module: "order_queue",
|
|
556
|
+
function: "max_premium",
|
|
557
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
function minQuantity(options) {
|
|
561
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
562
|
+
const argumentsTypes = [null];
|
|
563
|
+
const parameterNames = ["request"];
|
|
564
|
+
return (tx) => tx.moveCall({
|
|
565
|
+
package: packageAddress,
|
|
566
|
+
module: "order_queue",
|
|
567
|
+
function: "min_quantity",
|
|
568
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
function maxCost(options) {
|
|
572
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
573
|
+
const argumentsTypes = [null];
|
|
574
|
+
const parameterNames = ["request"];
|
|
575
|
+
return (tx) => tx.moveCall({
|
|
576
|
+
package: packageAddress,
|
|
577
|
+
module: "order_queue",
|
|
578
|
+
function: "max_cost",
|
|
579
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
function maxProbability(options) {
|
|
583
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
584
|
+
const argumentsTypes = [null];
|
|
585
|
+
const parameterNames = ["request"];
|
|
586
|
+
return (tx) => tx.moveCall({
|
|
587
|
+
package: packageAddress,
|
|
588
|
+
module: "order_queue",
|
|
589
|
+
function: "max_probability",
|
|
590
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
function minProbability(options) {
|
|
594
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
595
|
+
const argumentsTypes = [null];
|
|
596
|
+
const parameterNames = ["request"];
|
|
597
|
+
return (tx) => tx.moveCall({
|
|
598
|
+
package: packageAddress,
|
|
599
|
+
module: "order_queue",
|
|
600
|
+
function: "min_probability",
|
|
601
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
function minProceeds(options) {
|
|
605
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
606
|
+
const argumentsTypes = [null];
|
|
607
|
+
const parameterNames = ["request"];
|
|
608
|
+
return (tx) => tx.moveCall({
|
|
609
|
+
package: packageAddress,
|
|
610
|
+
module: "order_queue",
|
|
611
|
+
function: "min_proceeds",
|
|
612
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
function placedAtMs(options) {
|
|
616
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
617
|
+
const argumentsTypes = [null];
|
|
618
|
+
const parameterNames = ["timing"];
|
|
619
|
+
return (tx) => tx.moveCall({
|
|
620
|
+
package: packageAddress,
|
|
621
|
+
module: "order_queue",
|
|
622
|
+
function: "placed_at_ms",
|
|
623
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
function earliestPriceMs(options) {
|
|
627
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
628
|
+
const argumentsTypes = [null];
|
|
629
|
+
const parameterNames = ["timing"];
|
|
630
|
+
return (tx) => tx.moveCall({
|
|
631
|
+
package: packageAddress,
|
|
632
|
+
module: "order_queue",
|
|
633
|
+
function: "earliest_price_ms",
|
|
634
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
function tauMs(options) {
|
|
638
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
639
|
+
const argumentsTypes = [null];
|
|
640
|
+
const parameterNames = ["timing"];
|
|
641
|
+
return (tx) => tx.moveCall({
|
|
642
|
+
package: packageAddress,
|
|
643
|
+
module: "order_queue",
|
|
644
|
+
function: "tau_ms",
|
|
645
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
function deadlineMs(options) {
|
|
649
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
650
|
+
const argumentsTypes = [null];
|
|
651
|
+
const parameterNames = ["timing"];
|
|
652
|
+
return (tx) => tx.moveCall({
|
|
653
|
+
package: packageAddress,
|
|
654
|
+
module: "order_queue",
|
|
655
|
+
function: "deadline_ms",
|
|
656
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
function cutoffMs(options) {
|
|
660
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
661
|
+
const argumentsTypes = [null];
|
|
662
|
+
const parameterNames = ["timing"];
|
|
663
|
+
return (tx) => tx.moveCall({
|
|
664
|
+
package: packageAddress,
|
|
665
|
+
module: "order_queue",
|
|
666
|
+
function: "cutoff_ms",
|
|
667
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
function pythChannel(options) {
|
|
671
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
672
|
+
const argumentsTypes = [null];
|
|
673
|
+
const parameterNames = ["timing"];
|
|
674
|
+
return (tx) => tx.moveCall({
|
|
675
|
+
package: packageAddress,
|
|
676
|
+
module: "order_queue",
|
|
677
|
+
function: "pyth_channel",
|
|
678
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
function budget(options) {
|
|
682
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
683
|
+
const argumentsTypes = [null];
|
|
684
|
+
const parameterNames = ["escrow"];
|
|
685
|
+
return (tx) => tx.moveCall({
|
|
686
|
+
package: packageAddress,
|
|
687
|
+
module: "order_queue",
|
|
688
|
+
function: "budget",
|
|
689
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
function orderFee(options) {
|
|
693
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
694
|
+
const argumentsTypes = [null];
|
|
695
|
+
const parameterNames = ["escrow"];
|
|
696
|
+
return (tx) => tx.moveCall({
|
|
697
|
+
package: packageAddress,
|
|
698
|
+
module: "order_queue",
|
|
699
|
+
function: "order_fee",
|
|
700
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
function subsidyBound(options) {
|
|
704
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
705
|
+
const argumentsTypes = [null];
|
|
706
|
+
const parameterNames = ["escrow"];
|
|
707
|
+
return (tx) => tx.moveCall({
|
|
708
|
+
package: packageAddress,
|
|
709
|
+
module: "order_queue",
|
|
710
|
+
function: "subsidy_bound",
|
|
711
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
function subsidyReserved(options) {
|
|
715
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
716
|
+
const argumentsTypes = [null];
|
|
717
|
+
const parameterNames = ["escrow"];
|
|
718
|
+
return (tx) => tx.moveCall({
|
|
719
|
+
package: packageAddress,
|
|
720
|
+
module: "order_queue",
|
|
721
|
+
function: "subsidy_reserved",
|
|
722
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
function cashNeed(options) {
|
|
726
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
727
|
+
const argumentsTypes = [null];
|
|
728
|
+
const parameterNames = ["escrow"];
|
|
729
|
+
return (tx) => tx.moveCall({
|
|
730
|
+
package: packageAddress,
|
|
731
|
+
module: "order_queue",
|
|
732
|
+
function: "cash_need",
|
|
733
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
function orderId(options) {
|
|
737
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
738
|
+
const argumentsTypes = [null];
|
|
739
|
+
const parameterNames = ["position"];
|
|
740
|
+
return (tx) => tx.moveCall({
|
|
741
|
+
package: packageAddress,
|
|
742
|
+
module: "order_queue",
|
|
743
|
+
function: "order_id",
|
|
744
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
function rootId(options) {
|
|
748
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
749
|
+
const argumentsTypes = [null];
|
|
750
|
+
const parameterNames = ["position"];
|
|
751
|
+
return (tx) => tx.moveCall({
|
|
752
|
+
package: packageAddress,
|
|
753
|
+
module: "order_queue",
|
|
754
|
+
function: "root_id",
|
|
755
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
function openedAtMs(options) {
|
|
759
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
760
|
+
const argumentsTypes = [null];
|
|
761
|
+
const parameterNames = ["position"];
|
|
762
|
+
return (tx) => tx.moveCall({
|
|
763
|
+
package: packageAddress,
|
|
764
|
+
module: "order_queue",
|
|
765
|
+
function: "opened_at_ms",
|
|
766
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
function spot(options) {
|
|
770
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
771
|
+
const argumentsTypes = [null];
|
|
772
|
+
const parameterNames = ["price"];
|
|
773
|
+
return (tx) => tx.moveCall({
|
|
774
|
+
package: packageAddress,
|
|
775
|
+
module: "order_queue",
|
|
776
|
+
function: "spot",
|
|
777
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
function tickMs(options) {
|
|
781
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
782
|
+
const argumentsTypes = [null];
|
|
783
|
+
const parameterNames = ["price"];
|
|
784
|
+
return (tx) => tx.moveCall({
|
|
785
|
+
package: packageAddress,
|
|
786
|
+
module: "order_queue",
|
|
787
|
+
function: "tick_ms",
|
|
788
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
function generationUs(options) {
|
|
792
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
793
|
+
const argumentsTypes = [null];
|
|
794
|
+
const parameterNames = ["price"];
|
|
795
|
+
return (tx) => tx.moveCall({
|
|
796
|
+
package: packageAddress,
|
|
797
|
+
module: "order_queue",
|
|
798
|
+
function: "generation_us",
|
|
799
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
function reason(options) {
|
|
803
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
804
|
+
const argumentsTypes = [null];
|
|
805
|
+
const parameterNames = ["result"];
|
|
806
|
+
return (tx) => tx.moveCall({
|
|
807
|
+
package: packageAddress,
|
|
808
|
+
module: "order_queue",
|
|
809
|
+
function: "reason",
|
|
810
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
function resultQuantity(options) {
|
|
814
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
815
|
+
const argumentsTypes = [null];
|
|
816
|
+
const parameterNames = ["result"];
|
|
817
|
+
return (tx) => tx.moveCall({
|
|
818
|
+
package: packageAddress,
|
|
819
|
+
module: "order_queue",
|
|
820
|
+
function: "result_quantity",
|
|
821
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
function resultAmount(options) {
|
|
825
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
826
|
+
const argumentsTypes = [null];
|
|
827
|
+
const parameterNames = ["result"];
|
|
828
|
+
return (tx) => tx.moveCall({
|
|
829
|
+
package: packageAddress,
|
|
830
|
+
module: "order_queue",
|
|
831
|
+
function: "result_amount",
|
|
832
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
function finishedAtMs(options) {
|
|
836
|
+
const packageAddress = options.package ?? options.config?.predictOrdersPackageId ?? "@local-pkg/deepbook_predict_orders";
|
|
837
|
+
const argumentsTypes = [null];
|
|
838
|
+
const parameterNames = ["result"];
|
|
839
|
+
return (tx) => tx.moveCall({
|
|
840
|
+
package: packageAddress,
|
|
841
|
+
module: "order_queue",
|
|
842
|
+
function: "finished_at_ms",
|
|
843
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames)
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
//#endregion
|
|
848
|
+
export { HeldPosition, OrderBook, OrderRequest, OrderTiming, OrderView, order_queue_exports };
|
|
849
|
+
//# sourceMappingURL=order_queue.mjs.map
|