@mysten/deepbook-v3 2.0.1 → 2.1.3
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 +83 -0
- package/PREDICT.md +256 -0
- package/README.md +116 -0
- package/dist/account.d.mts +139 -0
- package/dist/account.d.mts.map +1 -0
- package/dist/account.mjs +181 -0
- package/dist/account.mjs.map +1 -0
- package/dist/bcs/integers.mjs +23 -0
- package/dist/bcs/integers.mjs.map +1 -0
- package/dist/contracts/account/account.d.mts +382 -0
- package/dist/contracts/account/account.d.mts.map +1 -0
- package/dist/contracts/account/account.mjs +443 -0
- package/dist/contracts/account/account.mjs.map +1 -0
- package/dist/contracts/account/account_events.d.mts +41 -0
- package/dist/contracts/account/account_events.d.mts.map +1 -0
- package/dist/contracts/account/account_events.mjs +72 -0
- package/dist/contracts/account/account_events.mjs.map +1 -0
- package/dist/contracts/account/account_registry.d.mts +210 -0
- package/dist/contracts/account/account_registry.d.mts.map +1 -0
- package/dist/contracts/account/account_registry.mjs +263 -0
- package/dist/contracts/account/account_registry.mjs.map +1 -0
- package/dist/contracts/account/config-arguments.d.mts +10 -0
- package/dist/contracts/account/config-arguments.d.mts.map +1 -0
- package/dist/contracts/account/deps/sui/bag.mjs +44 -0
- package/dist/contracts/account/deps/sui/bag.mjs.map +1 -0
- 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/deep_price.d.mts.map +1 -1
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/builder_code_events.mjs +38 -0
- package/dist/contracts/deepbook_predict/builder_code_events.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/config-arguments.d.mts +13 -0
- package/dist/contracts/deepbook_predict/config-arguments.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/deps/fixed_math/i64.mjs +25 -0
- package/dist/contracts/deepbook_predict/deps/fixed_math/i64.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/deps/sui/balance.mjs +25 -0
- package/dist/contracts/deepbook_predict/deps/sui/balance.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/deps/sui/coin.mjs +24 -0
- package/dist/contracts/deepbook_predict/deps/sui/coin.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/deps/sui/table.mjs +39 -0
- package/dist/contracts/deepbook_predict/deps/sui/table.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/deps/sui/vec_set.mjs +26 -0
- package/dist/contracts/deepbook_predict/deps/sui/vec_set.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/ewma.mjs +29 -0
- package/dist/contracts/deepbook_predict/ewma.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_cash.mjs +27 -0
- package/dist/contracts/deepbook_predict/expiry_cash.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.mjs +367 -0
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/lp_book.mjs +92 -0
- package/dist/contracts/deepbook_predict/lp_book.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.mjs +59 -0
- package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/order.mjs +26 -0
- package/dist/contracts/deepbook_predict/order.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/order_events.mjs +84 -0
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/plp.mjs +284 -0
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/pool_accounting.mjs +58 -0
- package/dist/contracts/deepbook_predict/pool_accounting.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.mjs +106 -0
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/pricing.mjs +80 -0
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.mjs +41 -0
- package/dist/contracts/deepbook_predict/range_codec.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/registry.mjs +55 -0
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/strike_exposure.mjs +65 -0
- package/dist/contracts/deepbook_predict/strike_exposure.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/strike_exposure_config.mjs +33 -0
- package/dist/contracts/deepbook_predict/strike_exposure_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +72 -0
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/vault_events.mjs +184 -0
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -0
- package/dist/contracts/deepbook_sessions/config-arguments.d.mts +10 -0
- package/dist/contracts/deepbook_sessions/config-arguments.d.mts.map +1 -0
- package/dist/contracts/deepbook_sessions/deps/sui/vec_map.mjs +37 -0
- package/dist/contracts/deepbook_sessions/deps/sui/vec_map.mjs.map +1 -0
- package/dist/contracts/deepbook_sessions/session_config.d.mts +63 -0
- package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -0
- package/dist/contracts/deepbook_sessions/session_config.mjs +82 -0
- package/dist/contracts/deepbook_sessions/session_config.mjs.map +1 -0
- package/dist/contracts/deepbook_sessions/sessions.d.mts +275 -0
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -0
- package/dist/contracts/deepbook_sessions/sessions.mjs +443 -0
- package/dist/contracts/deepbook_sessions/sessions.mjs.map +1 -0
- package/dist/contracts/utils/index.d.mts +18 -1
- package/dist/contracts/utils/index.d.mts.map +1 -1
- package/dist/deployments/index.d.mts +31 -0
- package/dist/deployments/index.d.mts.map +1 -0
- package/dist/deployments/index.mjs +30 -0
- package/dist/deployments/index.mjs.map +1 -0
- package/dist/deployments/testnet.d.mts +14 -0
- package/dist/deployments/testnet.d.mts.map +1 -0
- package/dist/deployments/testnet.mjs +73 -0
- package/dist/deployments/testnet.mjs.map +1 -0
- package/dist/deployments/types.d.mts +36 -0
- package/dist/deployments/types.d.mts.map +1 -0
- package/dist/index.mjs +0 -1
- package/dist/predict/client.d.mts +255 -0
- package/dist/predict/client.d.mts.map +1 -0
- package/dist/predict/client.mjs +436 -0
- package/dist/predict/client.mjs.map +1 -0
- package/dist/predict/config/generated.d.mts +29 -0
- package/dist/predict/config/generated.d.mts.map +1 -0
- package/dist/predict/config/generated.mjs +16 -0
- package/dist/predict/config/generated.mjs.map +1 -0
- package/dist/predict/config/index.d.mts +10 -0
- package/dist/predict/config/index.d.mts.map +1 -0
- package/dist/predict/config/index.mjs +13 -0
- package/dist/predict/config/index.mjs.map +1 -0
- package/dist/predict/config/testnet.d.mts +17 -0
- package/dist/predict/config/testnet.d.mts.map +1 -0
- package/dist/predict/config/testnet.mjs +26 -0
- package/dist/predict/config/testnet.mjs.map +1 -0
- package/dist/predict/config/types.d.mts +55 -0
- package/dist/predict/config/types.d.mts.map +1 -0
- package/dist/predict/decode.d.mts +162 -0
- package/dist/predict/decode.d.mts.map +1 -0
- package/dist/predict/decode.mjs +175 -0
- package/dist/predict/decode.mjs.map +1 -0
- package/dist/predict/errors.d.mts +42 -0
- package/dist/predict/errors.d.mts.map +1 -0
- package/dist/predict/errors.mjs +37 -0
- package/dist/predict/errors.mjs.map +1 -0
- package/dist/predict/index.d.mts +18 -0
- package/dist/predict/index.mjs +14 -0
- package/dist/predict/pricing.d.mts +73 -0
- package/dist/predict/pricing.d.mts.map +1 -0
- package/dist/predict/pricing.mjs +129 -0
- package/dist/predict/pricing.mjs.map +1 -0
- package/dist/predict/reads/balances.mjs +41 -0
- package/dist/predict/reads/balances.mjs.map +1 -0
- package/dist/predict/reads/inspect.d.mts +8 -0
- package/dist/predict/reads/inspect.d.mts.map +1 -0
- package/dist/predict/reads/inspect.mjs +37 -0
- package/dist/predict/reads/inspect.mjs.map +1 -0
- package/dist/predict/reads/markets.mjs +130 -0
- package/dist/predict/reads/markets.mjs.map +1 -0
- package/dist/predict/reads/parse.mjs +20 -0
- package/dist/predict/reads/parse.mjs.map +1 -0
- package/dist/predict/reads/pool.mjs +26 -0
- package/dist/predict/reads/pool.mjs.map +1 -0
- package/dist/predict/reads/positions.d.mts +12 -0
- package/dist/predict/reads/positions.d.mts.map +1 -0
- package/dist/predict/reads/positions.mjs +77 -0
- package/dist/predict/reads/positions.mjs.map +1 -0
- package/dist/predict/reads/pricing.d.mts +20 -0
- package/dist/predict/reads/pricing.d.mts.map +1 -0
- package/dist/predict/reads/pricing.mjs +43 -0
- package/dist/predict/reads/pricing.mjs.map +1 -0
- package/dist/predict/ticks.d.mts +11 -0
- package/dist/predict/ticks.d.mts.map +1 -0
- package/dist/predict/ticks.mjs +21 -0
- package/dist/predict/ticks.mjs.map +1 -0
- package/dist/predict/tx/authed.mjs +18 -0
- package/dist/predict/tx/authed.mjs.map +1 -0
- package/dist/predict/tx/common.d.mts +18 -0
- package/dist/predict/tx/common.d.mts.map +1 -0
- package/dist/predict/tx/common.mjs +52 -0
- package/dist/predict/tx/common.mjs.map +1 -0
- package/dist/predict/tx/trade.d.mts +15 -0
- package/dist/predict/tx/trade.d.mts.map +1 -0
- package/dist/predict/tx/trade.mjs +86 -0
- package/dist/predict/tx/trade.mjs.map +1 -0
- package/dist/predict/units.d.mts +11 -0
- package/dist/predict/units.d.mts.map +1 -0
- package/dist/predict/units.mjs +44 -0
- package/dist/predict/units.mjs.map +1 -0
- package/dist/queries/accountQueries.mjs +0 -1
- package/dist/queries/accountQueries.mjs.map +1 -1
- package/dist/queries/orderQueries.mjs +0 -1
- package/dist/queries/orderQueries.mjs.map +1 -1
- package/dist/queries/registryQueries.mjs +0 -1
- package/dist/queries/registryQueries.mjs.map +1 -1
- package/dist/sessions.d.mts +244 -0
- package/dist/sessions.d.mts.map +1 -0
- package/dist/sessions.mjs +291 -0
- package/dist/sessions.mjs.map +1 -0
- 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/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginManager.d.mts +32 -32
- 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/poolProxy.d.mts +8 -8
- package/package.json +25 -4
- package/src/account.ts +239 -0
- package/src/bcs/integers.ts +35 -0
- package/src/contracts/account/account.ts +706 -0
- package/src/contracts/account/account_events.ts +64 -0
- package/src/contracts/account/account_registry.ts +468 -0
- package/src/contracts/account/config-arguments.ts +8 -0
- package/src/contracts/account/deps/sui/bag.ts +42 -0
- package/src/contracts/deepbook_predict/admin.ts +44 -0
- package/src/contracts/deepbook_predict/builder_code.ts +155 -0
- package/src/contracts/deepbook_predict/builder_code_events.ts +34 -0
- package/src/contracts/deepbook_predict/config-arguments.ts +11 -0
- package/src/contracts/deepbook_predict/config_events.ts +140 -0
- package/src/contracts/deepbook_predict/deps/fixed_math/i64.ts +21 -0
- package/src/contracts/deepbook_predict/deps/sui/balance.ts +25 -0
- package/src/contracts/deepbook_predict/deps/sui/coin.ts +20 -0
- package/src/contracts/deepbook_predict/deps/sui/table.ts +37 -0
- package/src/contracts/deepbook_predict/deps/sui/vec_set.ts +22 -0
- package/src/contracts/deepbook_predict/ewma.ts +26 -0
- package/src/contracts/deepbook_predict/ewma_config.ts +28 -0
- package/src/contracts/deepbook_predict/expiry_cash.ts +24 -0
- package/src/contracts/deepbook_predict/expiry_market.ts +1549 -0
- package/src/contracts/deepbook_predict/lp_book.ts +105 -0
- package/src/contracts/deepbook_predict/market_lifecycle_cap.ts +75 -0
- package/src/contracts/deepbook_predict/market_manager.ts +218 -0
- package/src/contracts/deepbook_predict/order.ts +24 -0
- package/src/contracts/deepbook_predict/order_events.ts +129 -0
- package/src/contracts/deepbook_predict/pause_cap.ts +68 -0
- package/src/contracts/deepbook_predict/plp.ts +987 -0
- package/src/contracts/deepbook_predict/pool_accounting.ts +79 -0
- package/src/contracts/deepbook_predict/predict_account.ts +180 -0
- package/src/contracts/deepbook_predict/pricing.ts +124 -0
- package/src/contracts/deepbook_predict/pricing_config.ts +41 -0
- package/src/contracts/deepbook_predict/protocol_config.ts +1066 -0
- package/src/contracts/deepbook_predict/range_codec.ts +53 -0
- package/src/contracts/deepbook_predict/registry.ts +694 -0
- package/src/contracts/deepbook_predict/strike_exposure.ts +77 -0
- package/src/contracts/deepbook_predict/strike_exposure_config.ts +46 -0
- package/src/contracts/deepbook_predict/strike_payout_tree.ts +89 -0
- package/src/contracts/deepbook_predict/vault_events.ts +222 -0
- package/src/contracts/deepbook_sessions/config-arguments.ts +8 -0
- package/src/contracts/deepbook_sessions/deps/sui/vec_map.ts +33 -0
- package/src/contracts/deepbook_sessions/session_config.ts +130 -0
- package/src/contracts/deepbook_sessions/sessions.ts +663 -0
- package/src/contracts/propbook/block_scholes_store.ts +842 -0
- package/src/contracts/propbook/deps/sui/table.ts +37 -0
- package/src/contracts/propbook/oracle_lane.ts +170 -0
- package/src/contracts/propbook/pyth_feed.ts +414 -0
- package/src/contracts/propbook/registry.ts +596 -0
- package/src/deployments/index.ts +73 -0
- package/src/deployments/testnet.ts +107 -0
- package/src/deployments/types.ts +81 -0
- package/src/index.ts +5 -0
- package/src/predict/client.ts +941 -0
- package/src/predict/config/generated.ts +39 -0
- package/src/predict/config/index.ts +25 -0
- package/src/predict/config/testnet.ts +27 -0
- package/src/predict/config/types.ts +52 -0
- package/src/predict/decode.ts +476 -0
- package/src/predict/errors.ts +83 -0
- package/src/predict/index.ts +94 -0
- package/src/predict/pricing.ts +199 -0
- package/src/predict/reads/balances.ts +55 -0
- package/src/predict/reads/inspect.ts +78 -0
- package/src/predict/reads/markets.ts +222 -0
- package/src/predict/reads/parse.ts +30 -0
- package/src/predict/reads/pool.ts +37 -0
- package/src/predict/reads/positions.ts +144 -0
- package/src/predict/reads/pricing.ts +79 -0
- package/src/predict/ticks.ts +42 -0
- package/src/predict/tx/authed.ts +20 -0
- package/src/predict/tx/common.ts +92 -0
- package/src/predict/tx/trade.ts +183 -0
- package/src/predict/units.ts +49 -0
- package/src/sessions.ts +471 -0
- package/dist/types/bcs.mjs +0 -7
|
@@ -0,0 +1,1066 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Protocol-wide configuration and flow gates for Predict.
|
|
7
|
+
*
|
|
8
|
+
* This shared object owns the admin-tunable config structs, the trading pause
|
|
9
|
+
* gate, the protocol-wide emergency freeze, and the transaction-local full-pool
|
|
10
|
+
* valuation lock. Flow modules decide which gates apply before they mutate expiry,
|
|
11
|
+
* oracle, pool, or account state.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
MoveStruct,
|
|
16
|
+
normalizeMoveArguments,
|
|
17
|
+
type RawTransactionArgument,
|
|
18
|
+
type ConfigValue,
|
|
19
|
+
} from '../utils/index.js';
|
|
20
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
21
|
+
import { U64 } from '../../bcs/integers.js';
|
|
22
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
23
|
+
import * as pricing_config from './pricing_config.js';
|
|
24
|
+
import * as strike_exposure_config from './strike_exposure_config.js';
|
|
25
|
+
import * as ewma_config from './ewma_config.js';
|
|
26
|
+
const $moduleName = '@local-pkg/deepbook_predict::protocol_config';
|
|
27
|
+
export const ProtocolConfig = new MoveStruct({
|
|
28
|
+
name: `${$moduleName}::ProtocolConfig`,
|
|
29
|
+
fields: {
|
|
30
|
+
id: bcs.Address,
|
|
31
|
+
pricing_config: pricing_config.PricingConfig,
|
|
32
|
+
/**
|
|
33
|
+
* Merged protocol + insurance reserve share of materialized terminal profit, in
|
|
34
|
+
* FLOAT_SCALING. The complement accrues to LPs.
|
|
35
|
+
*/
|
|
36
|
+
protocol_reserve_profit_share: U64,
|
|
37
|
+
/**
|
|
38
|
+
* Portion of a referred mint's trader-paid trading fee and congestion surcharge
|
|
39
|
+
* routed to the referrer, in FLOAT_SCALING.
|
|
40
|
+
*/
|
|
41
|
+
referral_fee_rate: U64,
|
|
42
|
+
/**
|
|
43
|
+
* Fee charged on an executed PLP supply fill, in FLOAT_SCALING, deducted from the
|
|
44
|
+
* DUSDC taken in before shares are priced. Ships at zero — a deposit dilutes the
|
|
45
|
+
* pool's risk per dollar rather than concentrating it, so it is not taxed; the
|
|
46
|
+
* knob exists to keep that reversible.
|
|
47
|
+
*/
|
|
48
|
+
plp_supply_fee_rate: U64,
|
|
49
|
+
/**
|
|
50
|
+
* Fee charged on an executed PLP withdraw fill, in FLOAT_SCALING, withheld from
|
|
51
|
+
* the marked payout. Retained by the pool, so it accrues to the holders who stay.
|
|
52
|
+
* Both rates are read once per flush into the frozen mark, so every fill in one
|
|
53
|
+
* flush is charged the same pair.
|
|
54
|
+
*/
|
|
55
|
+
plp_withdraw_fee_rate: U64,
|
|
56
|
+
/**
|
|
57
|
+
* Frozen-mark attempts a queued LP supply/withdraw request gets before the
|
|
58
|
+
* protocol cancels and refunds it. `1` (the default) is fill-or-kill; above that a
|
|
59
|
+
* missing request rests at the queue head and stops that queue for the flush, so
|
|
60
|
+
* this is an LP-queue liveness knob (RP-12).
|
|
61
|
+
*/
|
|
62
|
+
lp_request_limit_flush_attempts: U64,
|
|
63
|
+
/**
|
|
64
|
+
* Ceiling on LP-attributable pool value that queued supplies may raise the pool
|
|
65
|
+
* to, enforced at the flush against the frozen mark. Defaults to `u64::MAX`, so
|
|
66
|
+
* the pool is uncapped until an operator sets a figure (RP-23).
|
|
67
|
+
*/
|
|
68
|
+
max_lp_pool_value: U64,
|
|
69
|
+
strike_exposure_template_config: strike_exposure_config.StrikeExposureConfig,
|
|
70
|
+
ewma_config: ewma_config.EwmaConfig,
|
|
71
|
+
/**
|
|
72
|
+
* Minimum package version permitted to run version-gated flows. Monotonic;
|
|
73
|
+
* `bump_version_watermark` advances it to the running `current_version!()`,
|
|
74
|
+
* retiring older versions. A running version below this floor is dead
|
|
75
|
+
* (`assert_version`). `current_version!()` stays the upgrade-required code
|
|
76
|
+
* constant; this is the runtime floor.
|
|
77
|
+
*/
|
|
78
|
+
version_watermark: U64,
|
|
79
|
+
/** Blocks new risk creation while true. */
|
|
80
|
+
trading_paused: bcs.bool(),
|
|
81
|
+
/**
|
|
82
|
+
* Emergency hard stop. While true, `assert_version` aborts, halting every
|
|
83
|
+
* version-gated flow (mint, redeem, settlement, valuation, LP supply/withdraw,
|
|
84
|
+
* admin config) — the same blast radius as a version-disable, but reversible
|
|
85
|
+
* without a package upgrade. Force-on via `PauseCap`; cleared by `AdminCap`.
|
|
86
|
+
* Account-package custody withdrawals and builder-fee claims are ungated and stay
|
|
87
|
+
* available (already-earned funds).
|
|
88
|
+
*/
|
|
89
|
+
frozen: bcs.bool(),
|
|
90
|
+
/**
|
|
91
|
+
* Transaction-local lock held while a full-pool valuation is assembled, so no
|
|
92
|
+
* NAV-changing op can interleave between per-market value steps in the PTB.
|
|
93
|
+
*/
|
|
94
|
+
valuation_in_progress: bcs.bool(),
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
export interface IdArguments {
|
|
98
|
+
config?: RawTransactionArgument<string>;
|
|
99
|
+
}
|
|
100
|
+
export interface IdOptions {
|
|
101
|
+
package?: string;
|
|
102
|
+
arguments?: IdArguments;
|
|
103
|
+
config?: {
|
|
104
|
+
protocolConfig: ConfigValue;
|
|
105
|
+
predictPackageId?: string;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Return the protocol config object ID for external discovery and PTB
|
|
110
|
+
* construction.
|
|
111
|
+
*/
|
|
112
|
+
export function id(options: IdOptions) {
|
|
113
|
+
const packageAddress =
|
|
114
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
115
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
116
|
+
const parameterNames = ['config'];
|
|
117
|
+
return (tx: Transaction) =>
|
|
118
|
+
tx.moveCall({
|
|
119
|
+
package: packageAddress,
|
|
120
|
+
module: 'protocol_config',
|
|
121
|
+
function: 'id',
|
|
122
|
+
arguments: normalizeMoveArguments(
|
|
123
|
+
{
|
|
124
|
+
...options.arguments,
|
|
125
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
126
|
+
},
|
|
127
|
+
argumentsTypes,
|
|
128
|
+
parameterNames,
|
|
129
|
+
),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export interface TradingPausedArguments {
|
|
133
|
+
config?: RawTransactionArgument<string>;
|
|
134
|
+
}
|
|
135
|
+
export interface TradingPausedOptions {
|
|
136
|
+
package?: string;
|
|
137
|
+
arguments?: TradingPausedArguments;
|
|
138
|
+
config?: {
|
|
139
|
+
protocolConfig: ConfigValue;
|
|
140
|
+
predictPackageId?: string;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** Return the global trading-pause state for SDK and devInspect reads. */
|
|
144
|
+
export function tradingPaused(options: TradingPausedOptions) {
|
|
145
|
+
const packageAddress =
|
|
146
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
147
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
148
|
+
const parameterNames = ['config'];
|
|
149
|
+
return (tx: Transaction) =>
|
|
150
|
+
tx.moveCall({
|
|
151
|
+
package: packageAddress,
|
|
152
|
+
module: 'protocol_config',
|
|
153
|
+
function: 'trading_paused',
|
|
154
|
+
arguments: normalizeMoveArguments(
|
|
155
|
+
{
|
|
156
|
+
...options.arguments,
|
|
157
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
158
|
+
},
|
|
159
|
+
argumentsTypes,
|
|
160
|
+
parameterNames,
|
|
161
|
+
),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export interface FrozenArguments {
|
|
165
|
+
config?: RawTransactionArgument<string>;
|
|
166
|
+
}
|
|
167
|
+
export interface FrozenOptions {
|
|
168
|
+
package?: string;
|
|
169
|
+
arguments?: FrozenArguments;
|
|
170
|
+
config?: {
|
|
171
|
+
protocolConfig: ConfigValue;
|
|
172
|
+
predictPackageId?: string;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/** Return the global protocol-freeze state for SDK and devInspect reads. */
|
|
176
|
+
export function frozen(options: FrozenOptions) {
|
|
177
|
+
const packageAddress =
|
|
178
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
179
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
180
|
+
const parameterNames = ['config'];
|
|
181
|
+
return (tx: Transaction) =>
|
|
182
|
+
tx.moveCall({
|
|
183
|
+
package: packageAddress,
|
|
184
|
+
module: 'protocol_config',
|
|
185
|
+
function: 'frozen',
|
|
186
|
+
arguments: normalizeMoveArguments(
|
|
187
|
+
{
|
|
188
|
+
...options.arguments,
|
|
189
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
190
|
+
},
|
|
191
|
+
argumentsTypes,
|
|
192
|
+
parameterNames,
|
|
193
|
+
),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
export interface ReferralFeeRateArguments {
|
|
197
|
+
config?: RawTransactionArgument<string>;
|
|
198
|
+
}
|
|
199
|
+
export interface ReferralFeeRateOptions {
|
|
200
|
+
package?: string;
|
|
201
|
+
arguments?: ReferralFeeRateArguments;
|
|
202
|
+
config?: {
|
|
203
|
+
protocolConfig: ConfigValue;
|
|
204
|
+
predictPackageId?: string;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/** Return the live referral fee rate for SDK and devInspect reads. */
|
|
208
|
+
export function referralFeeRate(options: ReferralFeeRateOptions) {
|
|
209
|
+
const packageAddress =
|
|
210
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
211
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
212
|
+
const parameterNames = ['config'];
|
|
213
|
+
return (tx: Transaction) =>
|
|
214
|
+
tx.moveCall({
|
|
215
|
+
package: packageAddress,
|
|
216
|
+
module: 'protocol_config',
|
|
217
|
+
function: 'referral_fee_rate',
|
|
218
|
+
arguments: normalizeMoveArguments(
|
|
219
|
+
{
|
|
220
|
+
...options.arguments,
|
|
221
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
222
|
+
},
|
|
223
|
+
argumentsTypes,
|
|
224
|
+
parameterNames,
|
|
225
|
+
),
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
export interface SetTemplateBaseFeeArguments {
|
|
229
|
+
config?: RawTransactionArgument<string>;
|
|
230
|
+
AdminCap: RawTransactionArgument<string>;
|
|
231
|
+
fee: RawTransactionArgument<number | bigint>;
|
|
232
|
+
}
|
|
233
|
+
export interface SetTemplateBaseFeeOptions {
|
|
234
|
+
package?: string;
|
|
235
|
+
arguments: SetTemplateBaseFeeArguments;
|
|
236
|
+
config?: {
|
|
237
|
+
protocolConfig: ConfigValue;
|
|
238
|
+
predictPackageId?: string;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** Set the base fee multiplier snapshotted by newly created expiry markets. */
|
|
242
|
+
export function setTemplateBaseFee(options: SetTemplateBaseFeeOptions) {
|
|
243
|
+
const packageAddress =
|
|
244
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
245
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
246
|
+
const parameterNames = ['config', 'AdminCap', 'fee'];
|
|
247
|
+
return (tx: Transaction) =>
|
|
248
|
+
tx.moveCall({
|
|
249
|
+
package: packageAddress,
|
|
250
|
+
module: 'protocol_config',
|
|
251
|
+
function: 'set_template_base_fee',
|
|
252
|
+
arguments: normalizeMoveArguments(
|
|
253
|
+
{
|
|
254
|
+
...options.arguments,
|
|
255
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
256
|
+
},
|
|
257
|
+
argumentsTypes,
|
|
258
|
+
parameterNames,
|
|
259
|
+
),
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
export interface SetTemplateMinFeeArguments {
|
|
263
|
+
config?: RawTransactionArgument<string>;
|
|
264
|
+
AdminCap: RawTransactionArgument<string>;
|
|
265
|
+
fee: RawTransactionArgument<number | bigint>;
|
|
266
|
+
}
|
|
267
|
+
export interface SetTemplateMinFeeOptions {
|
|
268
|
+
package?: string;
|
|
269
|
+
arguments: SetTemplateMinFeeArguments;
|
|
270
|
+
config?: {
|
|
271
|
+
protocolConfig: ConfigValue;
|
|
272
|
+
predictPackageId?: string;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/** Set the minimum fee floor snapshotted by newly created expiry markets. */
|
|
276
|
+
export function setTemplateMinFee(options: SetTemplateMinFeeOptions) {
|
|
277
|
+
const packageAddress =
|
|
278
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
279
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
280
|
+
const parameterNames = ['config', 'AdminCap', 'fee'];
|
|
281
|
+
return (tx: Transaction) =>
|
|
282
|
+
tx.moveCall({
|
|
283
|
+
package: packageAddress,
|
|
284
|
+
module: 'protocol_config',
|
|
285
|
+
function: 'set_template_min_fee',
|
|
286
|
+
arguments: normalizeMoveArguments(
|
|
287
|
+
{
|
|
288
|
+
...options.arguments,
|
|
289
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
290
|
+
},
|
|
291
|
+
argumentsTypes,
|
|
292
|
+
parameterNames,
|
|
293
|
+
),
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
export interface SetTemplateExpiryFeeWindowMsArguments {
|
|
297
|
+
config?: RawTransactionArgument<string>;
|
|
298
|
+
AdminCap: RawTransactionArgument<string>;
|
|
299
|
+
value: RawTransactionArgument<number | bigint>;
|
|
300
|
+
}
|
|
301
|
+
export interface SetTemplateExpiryFeeWindowMsOptions {
|
|
302
|
+
package?: string;
|
|
303
|
+
arguments: SetTemplateExpiryFeeWindowMsArguments;
|
|
304
|
+
config?: {
|
|
305
|
+
protocolConfig: ConfigValue;
|
|
306
|
+
predictPackageId?: string;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/** Set the expiry-fee ramp window snapshotted by newly created expiry markets. */
|
|
310
|
+
export function setTemplateExpiryFeeWindowMs(options: SetTemplateExpiryFeeWindowMsOptions) {
|
|
311
|
+
const packageAddress =
|
|
312
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
313
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
314
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
315
|
+
return (tx: Transaction) =>
|
|
316
|
+
tx.moveCall({
|
|
317
|
+
package: packageAddress,
|
|
318
|
+
module: 'protocol_config',
|
|
319
|
+
function: 'set_template_expiry_fee_window_ms',
|
|
320
|
+
arguments: normalizeMoveArguments(
|
|
321
|
+
{
|
|
322
|
+
...options.arguments,
|
|
323
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
324
|
+
},
|
|
325
|
+
argumentsTypes,
|
|
326
|
+
parameterNames,
|
|
327
|
+
),
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
export interface SetTemplateExpiryFeeMaxMultiplierArguments {
|
|
331
|
+
config?: RawTransactionArgument<string>;
|
|
332
|
+
AdminCap: RawTransactionArgument<string>;
|
|
333
|
+
value: RawTransactionArgument<number | bigint>;
|
|
334
|
+
}
|
|
335
|
+
export interface SetTemplateExpiryFeeMaxMultiplierOptions {
|
|
336
|
+
package?: string;
|
|
337
|
+
arguments: SetTemplateExpiryFeeMaxMultiplierArguments;
|
|
338
|
+
config?: {
|
|
339
|
+
protocolConfig: ConfigValue;
|
|
340
|
+
predictPackageId?: string;
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
/** Set the expiry-fee max multiplier snapshotted by newly created expiry markets. */
|
|
344
|
+
export function setTemplateExpiryFeeMaxMultiplier(
|
|
345
|
+
options: SetTemplateExpiryFeeMaxMultiplierOptions,
|
|
346
|
+
) {
|
|
347
|
+
const packageAddress =
|
|
348
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
349
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
350
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
351
|
+
return (tx: Transaction) =>
|
|
352
|
+
tx.moveCall({
|
|
353
|
+
package: packageAddress,
|
|
354
|
+
module: 'protocol_config',
|
|
355
|
+
function: 'set_template_expiry_fee_max_multiplier',
|
|
356
|
+
arguments: normalizeMoveArguments(
|
|
357
|
+
{
|
|
358
|
+
...options.arguments,
|
|
359
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
360
|
+
},
|
|
361
|
+
argumentsTypes,
|
|
362
|
+
parameterNames,
|
|
363
|
+
),
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
export interface SetTemplateBackingBufferLambdaArguments {
|
|
367
|
+
config?: RawTransactionArgument<string>;
|
|
368
|
+
AdminCap: RawTransactionArgument<string>;
|
|
369
|
+
value: RawTransactionArgument<number | bigint>;
|
|
370
|
+
}
|
|
371
|
+
export interface SetTemplateBackingBufferLambdaOptions {
|
|
372
|
+
package?: string;
|
|
373
|
+
arguments: SetTemplateBackingBufferLambdaArguments;
|
|
374
|
+
config?: {
|
|
375
|
+
protocolConfig: ConfigValue;
|
|
376
|
+
predictPackageId?: string;
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
/** Set the backing-buffer lambda snapshotted by newly created expiry markets. */
|
|
380
|
+
export function setTemplateBackingBufferLambda(options: SetTemplateBackingBufferLambdaOptions) {
|
|
381
|
+
const packageAddress =
|
|
382
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
383
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
384
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
385
|
+
return (tx: Transaction) =>
|
|
386
|
+
tx.moveCall({
|
|
387
|
+
package: packageAddress,
|
|
388
|
+
module: 'protocol_config',
|
|
389
|
+
function: 'set_template_backing_buffer_lambda',
|
|
390
|
+
arguments: normalizeMoveArguments(
|
|
391
|
+
{
|
|
392
|
+
...options.arguments,
|
|
393
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
394
|
+
},
|
|
395
|
+
argumentsTypes,
|
|
396
|
+
parameterNames,
|
|
397
|
+
),
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
export interface SetTemplateInventoryImpactMaxRateArguments {
|
|
401
|
+
config?: RawTransactionArgument<string>;
|
|
402
|
+
AdminCap: RawTransactionArgument<string>;
|
|
403
|
+
value: RawTransactionArgument<number | bigint>;
|
|
404
|
+
}
|
|
405
|
+
export interface SetTemplateInventoryImpactMaxRateOptions {
|
|
406
|
+
package?: string;
|
|
407
|
+
arguments: SetTemplateInventoryImpactMaxRateArguments;
|
|
408
|
+
config?: {
|
|
409
|
+
protocolConfig: ConfigValue;
|
|
410
|
+
predictPackageId?: string;
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Set the maximum marginal inventory-impact rate snapshotted by newly created
|
|
415
|
+
* expiry markets. `0` (the default) disables both charges and rebates.
|
|
416
|
+
*/
|
|
417
|
+
export function setTemplateInventoryImpactMaxRate(
|
|
418
|
+
options: SetTemplateInventoryImpactMaxRateOptions,
|
|
419
|
+
) {
|
|
420
|
+
const packageAddress =
|
|
421
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
422
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
423
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
424
|
+
return (tx: Transaction) =>
|
|
425
|
+
tx.moveCall({
|
|
426
|
+
package: packageAddress,
|
|
427
|
+
module: 'protocol_config',
|
|
428
|
+
function: 'set_template_inventory_impact_max_rate',
|
|
429
|
+
arguments: normalizeMoveArguments(
|
|
430
|
+
{
|
|
431
|
+
...options.arguments,
|
|
432
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
433
|
+
},
|
|
434
|
+
argumentsTypes,
|
|
435
|
+
parameterNames,
|
|
436
|
+
),
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
export interface SetTemplateMinEntryProbabilityArguments {
|
|
440
|
+
config?: RawTransactionArgument<string>;
|
|
441
|
+
AdminCap: RawTransactionArgument<string>;
|
|
442
|
+
value: RawTransactionArgument<number | bigint>;
|
|
443
|
+
}
|
|
444
|
+
export interface SetTemplateMinEntryProbabilityOptions {
|
|
445
|
+
package?: string;
|
|
446
|
+
arguments: SetTemplateMinEntryProbabilityArguments;
|
|
447
|
+
config?: {
|
|
448
|
+
protocolConfig: ConfigValue;
|
|
449
|
+
predictPackageId?: string;
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Set the minimum raw entry probability snapshotted by newly created expiry
|
|
454
|
+
* markets.
|
|
455
|
+
*/
|
|
456
|
+
export function setTemplateMinEntryProbability(options: SetTemplateMinEntryProbabilityOptions) {
|
|
457
|
+
const packageAddress =
|
|
458
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
459
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
460
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
461
|
+
return (tx: Transaction) =>
|
|
462
|
+
tx.moveCall({
|
|
463
|
+
package: packageAddress,
|
|
464
|
+
module: 'protocol_config',
|
|
465
|
+
function: 'set_template_min_entry_probability',
|
|
466
|
+
arguments: normalizeMoveArguments(
|
|
467
|
+
{
|
|
468
|
+
...options.arguments,
|
|
469
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
470
|
+
},
|
|
471
|
+
argumentsTypes,
|
|
472
|
+
parameterNames,
|
|
473
|
+
),
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
export interface SetTemplateMaxEntryProbabilityArguments {
|
|
477
|
+
config?: RawTransactionArgument<string>;
|
|
478
|
+
AdminCap: RawTransactionArgument<string>;
|
|
479
|
+
value: RawTransactionArgument<number | bigint>;
|
|
480
|
+
}
|
|
481
|
+
export interface SetTemplateMaxEntryProbabilityOptions {
|
|
482
|
+
package?: string;
|
|
483
|
+
arguments: SetTemplateMaxEntryProbabilityArguments;
|
|
484
|
+
config?: {
|
|
485
|
+
protocolConfig: ConfigValue;
|
|
486
|
+
predictPackageId?: string;
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Set the maximum raw entry probability snapshotted by newly created expiry
|
|
491
|
+
* markets.
|
|
492
|
+
*/
|
|
493
|
+
export function setTemplateMaxEntryProbability(options: SetTemplateMaxEntryProbabilityOptions) {
|
|
494
|
+
const packageAddress =
|
|
495
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
496
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
497
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
498
|
+
return (tx: Transaction) =>
|
|
499
|
+
tx.moveCall({
|
|
500
|
+
package: packageAddress,
|
|
501
|
+
module: 'protocol_config',
|
|
502
|
+
function: 'set_template_max_entry_probability',
|
|
503
|
+
arguments: normalizeMoveArguments(
|
|
504
|
+
{
|
|
505
|
+
...options.arguments,
|
|
506
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
507
|
+
},
|
|
508
|
+
argumentsTypes,
|
|
509
|
+
parameterNames,
|
|
510
|
+
),
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
export interface SetUsePythSpotForForwardArguments {
|
|
514
|
+
config?: RawTransactionArgument<string>;
|
|
515
|
+
AdminCap: RawTransactionArgument<string>;
|
|
516
|
+
enabled: RawTransactionArgument<boolean>;
|
|
517
|
+
}
|
|
518
|
+
export interface SetUsePythSpotForForwardOptions {
|
|
519
|
+
package?: string;
|
|
520
|
+
arguments: SetUsePythSpotForForwardArguments;
|
|
521
|
+
config?: {
|
|
522
|
+
protocolConfig: ConfigValue;
|
|
523
|
+
predictPackageId?: string;
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Select which source the live forward is built from: `true` carries the Block
|
|
528
|
+
* Scholes basis on a fresh Pyth spot, `false` uses the Block Scholes forward
|
|
529
|
+
* directly. Locked during valuation so one flush marks every market on one
|
|
530
|
+
* formula.
|
|
531
|
+
*/
|
|
532
|
+
export function setUsePythSpotForForward(options: SetUsePythSpotForForwardOptions) {
|
|
533
|
+
const packageAddress =
|
|
534
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
535
|
+
const argumentsTypes = [null, null, 'bool', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
536
|
+
const parameterNames = ['config', 'AdminCap', 'enabled'];
|
|
537
|
+
return (tx: Transaction) =>
|
|
538
|
+
tx.moveCall({
|
|
539
|
+
package: packageAddress,
|
|
540
|
+
module: 'protocol_config',
|
|
541
|
+
function: 'set_use_pyth_spot_for_forward',
|
|
542
|
+
arguments: normalizeMoveArguments(
|
|
543
|
+
{
|
|
544
|
+
...options.arguments,
|
|
545
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
546
|
+
},
|
|
547
|
+
argumentsTypes,
|
|
548
|
+
parameterNames,
|
|
549
|
+
),
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
export interface SetPythSpotFreshnessMsArguments {
|
|
553
|
+
config?: RawTransactionArgument<string>;
|
|
554
|
+
AdminCap: RawTransactionArgument<string>;
|
|
555
|
+
value: RawTransactionArgument<number | bigint>;
|
|
556
|
+
}
|
|
557
|
+
export interface SetPythSpotFreshnessMsOptions {
|
|
558
|
+
package?: string;
|
|
559
|
+
arguments: SetPythSpotFreshnessMsArguments;
|
|
560
|
+
config?: {
|
|
561
|
+
protocolConfig: ConfigValue;
|
|
562
|
+
predictPackageId?: string;
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
/** Set the live Pyth spot freshness threshold. */
|
|
566
|
+
export function setPythSpotFreshnessMs(options: SetPythSpotFreshnessMsOptions) {
|
|
567
|
+
const packageAddress =
|
|
568
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
569
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
570
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
571
|
+
return (tx: Transaction) =>
|
|
572
|
+
tx.moveCall({
|
|
573
|
+
package: packageAddress,
|
|
574
|
+
module: 'protocol_config',
|
|
575
|
+
function: 'set_pyth_spot_freshness_ms',
|
|
576
|
+
arguments: normalizeMoveArguments(
|
|
577
|
+
{
|
|
578
|
+
...options.arguments,
|
|
579
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
580
|
+
},
|
|
581
|
+
argumentsTypes,
|
|
582
|
+
parameterNames,
|
|
583
|
+
),
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
export interface SetBlockScholesPriceFreshnessMsArguments {
|
|
587
|
+
config?: RawTransactionArgument<string>;
|
|
588
|
+
AdminCap: RawTransactionArgument<string>;
|
|
589
|
+
value: RawTransactionArgument<number | bigint>;
|
|
590
|
+
}
|
|
591
|
+
export interface SetBlockScholesPriceFreshnessMsOptions {
|
|
592
|
+
package?: string;
|
|
593
|
+
arguments: SetBlockScholesPriceFreshnessMsArguments;
|
|
594
|
+
config?: {
|
|
595
|
+
protocolConfig: ConfigValue;
|
|
596
|
+
predictPackageId?: string;
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
/** Set the live Block Scholes spot/forward freshness threshold. */
|
|
600
|
+
export function setBlockScholesPriceFreshnessMs(options: SetBlockScholesPriceFreshnessMsOptions) {
|
|
601
|
+
const packageAddress =
|
|
602
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
603
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
604
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
605
|
+
return (tx: Transaction) =>
|
|
606
|
+
tx.moveCall({
|
|
607
|
+
package: packageAddress,
|
|
608
|
+
module: 'protocol_config',
|
|
609
|
+
function: 'set_block_scholes_price_freshness_ms',
|
|
610
|
+
arguments: normalizeMoveArguments(
|
|
611
|
+
{
|
|
612
|
+
...options.arguments,
|
|
613
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
614
|
+
},
|
|
615
|
+
argumentsTypes,
|
|
616
|
+
parameterNames,
|
|
617
|
+
),
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
export interface SetBlockScholesSviFreshnessMsArguments {
|
|
621
|
+
config?: RawTransactionArgument<string>;
|
|
622
|
+
AdminCap: RawTransactionArgument<string>;
|
|
623
|
+
value: RawTransactionArgument<number | bigint>;
|
|
624
|
+
}
|
|
625
|
+
export interface SetBlockScholesSviFreshnessMsOptions {
|
|
626
|
+
package?: string;
|
|
627
|
+
arguments: SetBlockScholesSviFreshnessMsArguments;
|
|
628
|
+
config?: {
|
|
629
|
+
protocolConfig: ConfigValue;
|
|
630
|
+
predictPackageId?: string;
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
/** Set the live Block Scholes SVI freshness threshold. */
|
|
634
|
+
export function setBlockScholesSviFreshnessMs(options: SetBlockScholesSviFreshnessMsOptions) {
|
|
635
|
+
const packageAddress =
|
|
636
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
637
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
638
|
+
const parameterNames = ['config', 'AdminCap', 'value'];
|
|
639
|
+
return (tx: Transaction) =>
|
|
640
|
+
tx.moveCall({
|
|
641
|
+
package: packageAddress,
|
|
642
|
+
module: 'protocol_config',
|
|
643
|
+
function: 'set_block_scholes_svi_freshness_ms',
|
|
644
|
+
arguments: normalizeMoveArguments(
|
|
645
|
+
{
|
|
646
|
+
...options.arguments,
|
|
647
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
648
|
+
},
|
|
649
|
+
argumentsTypes,
|
|
650
|
+
parameterNames,
|
|
651
|
+
),
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
export interface SetLpRequestLimitFlushAttemptsArguments {
|
|
655
|
+
config?: RawTransactionArgument<string>;
|
|
656
|
+
AdminCap: RawTransactionArgument<string>;
|
|
657
|
+
attempts: RawTransactionArgument<number | bigint>;
|
|
658
|
+
}
|
|
659
|
+
export interface SetLpRequestLimitFlushAttemptsOptions {
|
|
660
|
+
package?: string;
|
|
661
|
+
arguments: SetLpRequestLimitFlushAttemptsArguments;
|
|
662
|
+
config?: {
|
|
663
|
+
protocolConfig: ConfigValue;
|
|
664
|
+
predictPackageId?: string;
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Set how many frozen-mark attempts a queued LP request gets before it is
|
|
669
|
+
* cancelled and refunded. `1` is fill-or-kill. Raising it lets a request rest at
|
|
670
|
+
* the head across flushes, which stops that queue each time it misses — see RP-12
|
|
671
|
+
* for the liveness cost that buys.
|
|
672
|
+
*/
|
|
673
|
+
export function setLpRequestLimitFlushAttempts(options: SetLpRequestLimitFlushAttemptsOptions) {
|
|
674
|
+
const packageAddress =
|
|
675
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
676
|
+
const argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];
|
|
677
|
+
const parameterNames = ['config', 'AdminCap', 'attempts'];
|
|
678
|
+
return (tx: Transaction) =>
|
|
679
|
+
tx.moveCall({
|
|
680
|
+
package: packageAddress,
|
|
681
|
+
module: 'protocol_config',
|
|
682
|
+
function: 'set_lp_request_limit_flush_attempts',
|
|
683
|
+
arguments: normalizeMoveArguments(
|
|
684
|
+
{
|
|
685
|
+
...options.arguments,
|
|
686
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
687
|
+
},
|
|
688
|
+
argumentsTypes,
|
|
689
|
+
parameterNames,
|
|
690
|
+
),
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
export interface SetMaxLpPoolValueArguments {
|
|
694
|
+
config?: RawTransactionArgument<string>;
|
|
695
|
+
AdminCap: RawTransactionArgument<string>;
|
|
696
|
+
maxPoolValue: RawTransactionArgument<number | bigint>;
|
|
697
|
+
}
|
|
698
|
+
export interface SetMaxLpPoolValueOptions {
|
|
699
|
+
package?: string;
|
|
700
|
+
arguments: SetMaxLpPoolValueArguments;
|
|
701
|
+
config?: {
|
|
702
|
+
protocolConfig: ConfigValue;
|
|
703
|
+
predictPackageId?: string;
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Set the ceiling on LP-attributable pool value that queued supplies may raise the
|
|
708
|
+
* pool to. A supply that would carry the pool past it is filled up to the cap at
|
|
709
|
+
* the flush and its remainder stays queued; withdrawals and already-issued PLP are
|
|
710
|
+
* unaffected, so lowering this below current pool value closes the pool to new
|
|
711
|
+
* capital rather than forcing anyone out.
|
|
712
|
+
*/
|
|
713
|
+
export function setMaxLpPoolValue(options: SetMaxLpPoolValueOptions) {
|
|
714
|
+
const packageAddress =
|
|
715
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
716
|
+
const argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];
|
|
717
|
+
const parameterNames = ['config', 'AdminCap', 'maxPoolValue'];
|
|
718
|
+
return (tx: Transaction) =>
|
|
719
|
+
tx.moveCall({
|
|
720
|
+
package: packageAddress,
|
|
721
|
+
module: 'protocol_config',
|
|
722
|
+
function: 'set_max_lp_pool_value',
|
|
723
|
+
arguments: normalizeMoveArguments(
|
|
724
|
+
{
|
|
725
|
+
...options.arguments,
|
|
726
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
727
|
+
},
|
|
728
|
+
argumentsTypes,
|
|
729
|
+
parameterNames,
|
|
730
|
+
),
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
export interface SetEwmaParamsArguments {
|
|
734
|
+
config?: RawTransactionArgument<string>;
|
|
735
|
+
AdminCap: RawTransactionArgument<string>;
|
|
736
|
+
alpha: RawTransactionArgument<number | bigint>;
|
|
737
|
+
zScoreThreshold: RawTransactionArgument<number | bigint>;
|
|
738
|
+
penaltyRate: RawTransactionArgument<number | bigint>;
|
|
739
|
+
}
|
|
740
|
+
export interface SetEwmaParamsOptions {
|
|
741
|
+
package?: string;
|
|
742
|
+
arguments: SetEwmaParamsArguments;
|
|
743
|
+
config?: {
|
|
744
|
+
protocolConfig: ConfigValue;
|
|
745
|
+
predictPackageId?: string;
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
/** Set the EWMA gas-price penalty parameters. */
|
|
749
|
+
export function setEwmaParams(options: SetEwmaParamsOptions) {
|
|
750
|
+
const packageAddress =
|
|
751
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
752
|
+
const argumentsTypes = [null, null, 'u64', 'u64', 'u64', '0x2::clock::Clock'] satisfies (
|
|
753
|
+
string | null
|
|
754
|
+
)[];
|
|
755
|
+
const parameterNames = ['config', 'AdminCap', 'alpha', 'zScoreThreshold', 'penaltyRate'];
|
|
756
|
+
return (tx: Transaction) =>
|
|
757
|
+
tx.moveCall({
|
|
758
|
+
package: packageAddress,
|
|
759
|
+
module: 'protocol_config',
|
|
760
|
+
function: 'set_ewma_params',
|
|
761
|
+
arguments: normalizeMoveArguments(
|
|
762
|
+
{
|
|
763
|
+
...options.arguments,
|
|
764
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
765
|
+
},
|
|
766
|
+
argumentsTypes,
|
|
767
|
+
parameterNames,
|
|
768
|
+
),
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
export interface SetEwmaEnabledArguments {
|
|
772
|
+
config?: RawTransactionArgument<string>;
|
|
773
|
+
AdminCap: RawTransactionArgument<string>;
|
|
774
|
+
enabled: RawTransactionArgument<boolean>;
|
|
775
|
+
}
|
|
776
|
+
export interface SetEwmaEnabledOptions {
|
|
777
|
+
package?: string;
|
|
778
|
+
arguments: SetEwmaEnabledArguments;
|
|
779
|
+
config?: {
|
|
780
|
+
protocolConfig: ConfigValue;
|
|
781
|
+
predictPackageId?: string;
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
/** Enable or disable the EWMA gas-price penalty. */
|
|
785
|
+
export function setEwmaEnabled(options: SetEwmaEnabledOptions) {
|
|
786
|
+
const packageAddress =
|
|
787
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
788
|
+
const argumentsTypes = [null, null, 'bool', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
789
|
+
const parameterNames = ['config', 'AdminCap', 'enabled'];
|
|
790
|
+
return (tx: Transaction) =>
|
|
791
|
+
tx.moveCall({
|
|
792
|
+
package: packageAddress,
|
|
793
|
+
module: 'protocol_config',
|
|
794
|
+
function: 'set_ewma_enabled',
|
|
795
|
+
arguments: normalizeMoveArguments(
|
|
796
|
+
{
|
|
797
|
+
...options.arguments,
|
|
798
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
799
|
+
},
|
|
800
|
+
argumentsTypes,
|
|
801
|
+
parameterNames,
|
|
802
|
+
),
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
export interface SetTradingPausedArguments {
|
|
806
|
+
config?: RawTransactionArgument<string>;
|
|
807
|
+
AdminCap: RawTransactionArgument<string>;
|
|
808
|
+
paused: RawTransactionArgument<boolean>;
|
|
809
|
+
}
|
|
810
|
+
export interface SetTradingPausedOptions {
|
|
811
|
+
package?: string;
|
|
812
|
+
arguments: SetTradingPausedArguments;
|
|
813
|
+
config?: {
|
|
814
|
+
protocolConfig: ConfigValue;
|
|
815
|
+
predictPackageId?: string;
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
/** Set whether trading is paused. */
|
|
819
|
+
export function setTradingPaused(options: SetTradingPausedOptions) {
|
|
820
|
+
const packageAddress =
|
|
821
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
822
|
+
const argumentsTypes = [null, null, 'bool'] satisfies (string | null)[];
|
|
823
|
+
const parameterNames = ['config', 'AdminCap', 'paused'];
|
|
824
|
+
return (tx: Transaction) =>
|
|
825
|
+
tx.moveCall({
|
|
826
|
+
package: packageAddress,
|
|
827
|
+
module: 'protocol_config',
|
|
828
|
+
function: 'set_trading_paused',
|
|
829
|
+
arguments: normalizeMoveArguments(
|
|
830
|
+
{
|
|
831
|
+
...options.arguments,
|
|
832
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
833
|
+
},
|
|
834
|
+
argumentsTypes,
|
|
835
|
+
parameterNames,
|
|
836
|
+
),
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
export interface SetFrozenArguments {
|
|
840
|
+
config?: RawTransactionArgument<string>;
|
|
841
|
+
AdminCap: RawTransactionArgument<string>;
|
|
842
|
+
frozen: RawTransactionArgument<boolean>;
|
|
843
|
+
}
|
|
844
|
+
export interface SetFrozenOptions {
|
|
845
|
+
package?: string;
|
|
846
|
+
arguments: SetFrozenArguments;
|
|
847
|
+
config?: {
|
|
848
|
+
protocolConfig: ConfigValue;
|
|
849
|
+
predictPackageId?: string;
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Set the protocol-wide emergency freeze.
|
|
854
|
+
*
|
|
855
|
+
* Intentionally NOT version-gated, unlike every other admin setter: the freeze
|
|
856
|
+
* gate lives inside `assert_version`, so routing this through it would make an
|
|
857
|
+
* engaged freeze unclearable without a package upgrade — defeating the point.
|
|
858
|
+
*/
|
|
859
|
+
export function setFrozen(options: SetFrozenOptions) {
|
|
860
|
+
const packageAddress =
|
|
861
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
862
|
+
const argumentsTypes = [null, null, 'bool'] satisfies (string | null)[];
|
|
863
|
+
const parameterNames = ['config', 'AdminCap', 'frozen'];
|
|
864
|
+
return (tx: Transaction) =>
|
|
865
|
+
tx.moveCall({
|
|
866
|
+
package: packageAddress,
|
|
867
|
+
module: 'protocol_config',
|
|
868
|
+
function: 'set_frozen',
|
|
869
|
+
arguments: normalizeMoveArguments(
|
|
870
|
+
{
|
|
871
|
+
...options.arguments,
|
|
872
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
873
|
+
},
|
|
874
|
+
argumentsTypes,
|
|
875
|
+
parameterNames,
|
|
876
|
+
),
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
export interface BumpVersionWatermarkArguments {
|
|
880
|
+
config?: RawTransactionArgument<string>;
|
|
881
|
+
AdminCap: RawTransactionArgument<string>;
|
|
882
|
+
}
|
|
883
|
+
export interface BumpVersionWatermarkOptions {
|
|
884
|
+
package?: string;
|
|
885
|
+
arguments: BumpVersionWatermarkArguments;
|
|
886
|
+
config?: {
|
|
887
|
+
protocolConfig: ConfigValue;
|
|
888
|
+
predictPackageId?: string;
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Advance the version floor to this package's compiled-in `current_version!()`.
|
|
893
|
+
*
|
|
894
|
+
* The floor cannot be set above the executing package's version. This function is
|
|
895
|
+
* ungated so an upgraded package can retire older versions; it aborts unless the
|
|
896
|
+
* executing version is strictly greater than the existing floor.
|
|
897
|
+
*/
|
|
898
|
+
export function bumpVersionWatermark(options: BumpVersionWatermarkOptions) {
|
|
899
|
+
const packageAddress =
|
|
900
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
901
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
902
|
+
const parameterNames = ['config', 'AdminCap'];
|
|
903
|
+
return (tx: Transaction) =>
|
|
904
|
+
tx.moveCall({
|
|
905
|
+
package: packageAddress,
|
|
906
|
+
module: 'protocol_config',
|
|
907
|
+
function: 'bump_version_watermark',
|
|
908
|
+
arguments: normalizeMoveArguments(
|
|
909
|
+
{
|
|
910
|
+
...options.arguments,
|
|
911
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
912
|
+
},
|
|
913
|
+
argumentsTypes,
|
|
914
|
+
parameterNames,
|
|
915
|
+
),
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
export interface SetProtocolReserveProfitShareArguments {
|
|
919
|
+
config?: RawTransactionArgument<string>;
|
|
920
|
+
AdminCap: RawTransactionArgument<string>;
|
|
921
|
+
protocolReserveProfitShare: RawTransactionArgument<number | bigint>;
|
|
922
|
+
}
|
|
923
|
+
export interface SetProtocolReserveProfitShareOptions {
|
|
924
|
+
package?: string;
|
|
925
|
+
arguments: SetProtocolReserveProfitShareArguments;
|
|
926
|
+
config?: {
|
|
927
|
+
protocolConfig: ConfigValue;
|
|
928
|
+
predictPackageId?: string;
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Set the protocol reserve profit share used when materializing aggregate expiry
|
|
933
|
+
* profit. Admin-gated; validated against its config-constants envelope.
|
|
934
|
+
*/
|
|
935
|
+
export function setProtocolReserveProfitShare(options: SetProtocolReserveProfitShareOptions) {
|
|
936
|
+
const packageAddress =
|
|
937
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
938
|
+
const argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];
|
|
939
|
+
const parameterNames = ['config', 'AdminCap', 'protocolReserveProfitShare'];
|
|
940
|
+
return (tx: Transaction) =>
|
|
941
|
+
tx.moveCall({
|
|
942
|
+
package: packageAddress,
|
|
943
|
+
module: 'protocol_config',
|
|
944
|
+
function: 'set_protocol_reserve_profit_share',
|
|
945
|
+
arguments: normalizeMoveArguments(
|
|
946
|
+
{
|
|
947
|
+
...options.arguments,
|
|
948
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
949
|
+
},
|
|
950
|
+
argumentsTypes,
|
|
951
|
+
parameterNames,
|
|
952
|
+
),
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
export interface SetReferralFeeRateArguments {
|
|
956
|
+
config?: RawTransactionArgument<string>;
|
|
957
|
+
AdminCap: RawTransactionArgument<string>;
|
|
958
|
+
rate: RawTransactionArgument<number | bigint>;
|
|
959
|
+
}
|
|
960
|
+
export interface SetReferralFeeRateOptions {
|
|
961
|
+
package?: string;
|
|
962
|
+
arguments: SetReferralFeeRateArguments;
|
|
963
|
+
config?: {
|
|
964
|
+
protocolConfig: ConfigValue;
|
|
965
|
+
predictPackageId?: string;
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* Set the portion of referred mint fees routed to the referrer. The new rate
|
|
970
|
+
* applies to subsequent mints without changing their all-in account withdrawal.
|
|
971
|
+
*/
|
|
972
|
+
export function setReferralFeeRate(options: SetReferralFeeRateOptions) {
|
|
973
|
+
const packageAddress =
|
|
974
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
975
|
+
const argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];
|
|
976
|
+
const parameterNames = ['config', 'AdminCap', 'rate'];
|
|
977
|
+
return (tx: Transaction) =>
|
|
978
|
+
tx.moveCall({
|
|
979
|
+
package: packageAddress,
|
|
980
|
+
module: 'protocol_config',
|
|
981
|
+
function: 'set_referral_fee_rate',
|
|
982
|
+
arguments: normalizeMoveArguments(
|
|
983
|
+
{
|
|
984
|
+
...options.arguments,
|
|
985
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
986
|
+
},
|
|
987
|
+
argumentsTypes,
|
|
988
|
+
parameterNames,
|
|
989
|
+
),
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
export interface SetPlpSupplyFeeRateArguments {
|
|
993
|
+
config?: RawTransactionArgument<string>;
|
|
994
|
+
AdminCap: RawTransactionArgument<string>;
|
|
995
|
+
rate: RawTransactionArgument<number | bigint>;
|
|
996
|
+
}
|
|
997
|
+
export interface SetPlpSupplyFeeRateOptions {
|
|
998
|
+
package?: string;
|
|
999
|
+
arguments: SetPlpSupplyFeeRateArguments;
|
|
1000
|
+
config?: {
|
|
1001
|
+
protocolConfig: ConfigValue;
|
|
1002
|
+
predictPackageId?: string;
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Set the fee charged on executed PLP supply fills. Admin-gated and validated
|
|
1007
|
+
* against its config-constants envelope. Locked during valuation so the rate a
|
|
1008
|
+
* flush froze into its mark cannot change midway through that flush.
|
|
1009
|
+
*/
|
|
1010
|
+
export function setPlpSupplyFeeRate(options: SetPlpSupplyFeeRateOptions) {
|
|
1011
|
+
const packageAddress =
|
|
1012
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
1013
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1014
|
+
const parameterNames = ['config', 'AdminCap', 'rate'];
|
|
1015
|
+
return (tx: Transaction) =>
|
|
1016
|
+
tx.moveCall({
|
|
1017
|
+
package: packageAddress,
|
|
1018
|
+
module: 'protocol_config',
|
|
1019
|
+
function: 'set_plp_supply_fee_rate',
|
|
1020
|
+
arguments: normalizeMoveArguments(
|
|
1021
|
+
{
|
|
1022
|
+
...options.arguments,
|
|
1023
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
1024
|
+
},
|
|
1025
|
+
argumentsTypes,
|
|
1026
|
+
parameterNames,
|
|
1027
|
+
),
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
export interface SetPlpWithdrawFeeRateArguments {
|
|
1031
|
+
config?: RawTransactionArgument<string>;
|
|
1032
|
+
AdminCap: RawTransactionArgument<string>;
|
|
1033
|
+
rate: RawTransactionArgument<number | bigint>;
|
|
1034
|
+
}
|
|
1035
|
+
export interface SetPlpWithdrawFeeRateOptions {
|
|
1036
|
+
package?: string;
|
|
1037
|
+
arguments: SetPlpWithdrawFeeRateArguments;
|
|
1038
|
+
config?: {
|
|
1039
|
+
protocolConfig: ConfigValue;
|
|
1040
|
+
predictPackageId?: string;
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Set the fee charged on executed PLP withdraw fills. Same gating as the supply
|
|
1045
|
+
* leg; the two are independent so the exit charge can move without taxing entry.
|
|
1046
|
+
*/
|
|
1047
|
+
export function setPlpWithdrawFeeRate(options: SetPlpWithdrawFeeRateOptions) {
|
|
1048
|
+
const packageAddress =
|
|
1049
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
1050
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1051
|
+
const parameterNames = ['config', 'AdminCap', 'rate'];
|
|
1052
|
+
return (tx: Transaction) =>
|
|
1053
|
+
tx.moveCall({
|
|
1054
|
+
package: packageAddress,
|
|
1055
|
+
module: 'protocol_config',
|
|
1056
|
+
function: 'set_plp_withdraw_fee_rate',
|
|
1057
|
+
arguments: normalizeMoveArguments(
|
|
1058
|
+
{
|
|
1059
|
+
...options.arguments,
|
|
1060
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
1061
|
+
},
|
|
1062
|
+
argumentsTypes,
|
|
1063
|
+
parameterNames,
|
|
1064
|
+
),
|
|
1065
|
+
});
|
|
1066
|
+
}
|