@mysten/deepbook-v3 2.3.0 → 2.4.1
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 +29 -0
- package/PREDICT.md +149 -55
- package/README.md +18 -13
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_events.d.mts.map +1 -1
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/account.d.mts.map +1 -1
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/balances.d.mts.map +1 -1
- 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/admin.d.mts +27 -0
- package/dist/contracts/deepbook_predict/admin.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/admin.mjs +38 -0
- package/dist/contracts/deepbook_predict/admin.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code.d.mts +81 -0
- package/dist/contracts/deepbook_predict/builder_code.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code.mjs +103 -0
- package/dist/contracts/deepbook_predict/builder_code.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +25 -0
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code_events.mjs +7 -1
- package/dist/contracts/deepbook_predict/builder_code_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.d.mts +104 -0
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/config_events.mjs +155 -0
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/ewma_config.mjs +28 -0
- package/dist/contracts/deepbook_predict/ewma_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +859 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.mjs +647 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs +51 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.d.mts +159 -0
- package/dist/contracts/deepbook_predict/market_manager.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.mjs +88 -2
- package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.d.mts +101 -0
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/order_events.mjs +7 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/pause_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pause_cap.mjs +51 -0
- package/dist/contracts/deepbook_predict/pause_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/plp.d.mts +801 -0
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/plp.mjs +458 -1
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs +52 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.d.mts +90 -0
- package/dist/contracts/deepbook_predict/predict_account.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.mjs +24 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.d.mts +127 -0
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pricing.mjs +25 -1
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing_config.mjs +28 -0
- package/dist/contracts/deepbook_predict/pricing_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +665 -0
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/protocol_config.mjs +841 -0
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.d.mts +30 -0
- package/dist/contracts/deepbook_predict/range_codec.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.mjs +6 -1
- package/dist/contracts/deepbook_predict/range_codec.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/registry.d.mts +382 -0
- package/dist/contracts/deepbook_predict/registry.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/registry.mjs +456 -1
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.d.mts +199 -0
- package/dist/contracts/deepbook_predict/vault_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/vault_events.mjs +19 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.d.mts +22 -22
- package/dist/predict/client.d.mts +3 -2
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +3 -2
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/index.d.mts +18 -1
- package/dist/predict/index.mjs +18 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginRegistry.d.mts +16 -16
- package/package.json +2 -2
- package/src/predict/client.ts +3 -2
- package/src/predict/index.ts +26 -2
|
@@ -0,0 +1,841 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.mjs";
|
|
3
|
+
import { U64 } from "../../bcs/integers.mjs";
|
|
4
|
+
import { StrikeExposureConfig } from "./strike_exposure_config.mjs";
|
|
5
|
+
import { PricingConfig } from "./pricing_config.mjs";
|
|
6
|
+
import { EwmaConfig } from "./ewma_config.mjs";
|
|
7
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
8
|
+
|
|
9
|
+
//#region src/contracts/deepbook_predict/protocol_config.ts
|
|
10
|
+
/**************************************************************
|
|
11
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
12
|
+
**************************************************************/
|
|
13
|
+
/**
|
|
14
|
+
* Protocol-wide configuration and flow gates for Predict.
|
|
15
|
+
*
|
|
16
|
+
* This shared object owns the admin-tunable config structs, the trading pause
|
|
17
|
+
* gate, the protocol-wide emergency freeze, and the full-pool valuation in-flight
|
|
18
|
+
* state (flag + flush ordinal, held across the transactions a flush spans;
|
|
19
|
+
* keeper/config flows gate on it, trading flows read it only to discard stale
|
|
20
|
+
* stamps lazily). Flow modules decide which gates apply before they mutate expiry,
|
|
21
|
+
* oracle, pool, or account state.
|
|
22
|
+
*/
|
|
23
|
+
var protocol_config_exports = /* @__PURE__ */ __exportAll({
|
|
24
|
+
ProtocolConfig: () => ProtocolConfig,
|
|
25
|
+
bumpVersionWatermark: () => bumpVersionWatermark,
|
|
26
|
+
frozen: () => frozen,
|
|
27
|
+
id: () => id,
|
|
28
|
+
noTradeWindowMs: () => noTradeWindowMs,
|
|
29
|
+
referralFeeRate: () => referralFeeRate,
|
|
30
|
+
setBlockScholesPriceFreshnessMs: () => setBlockScholesPriceFreshnessMs,
|
|
31
|
+
setBlockScholesSviFreshnessMs: () => setBlockScholesSviFreshnessMs,
|
|
32
|
+
setEwmaEnabled: () => setEwmaEnabled,
|
|
33
|
+
setEwmaParams: () => setEwmaParams,
|
|
34
|
+
setFrozen: () => setFrozen,
|
|
35
|
+
setLpRequestLimitFlushAttempts: () => setLpRequestLimitFlushAttempts,
|
|
36
|
+
setMaxLpPoolValue: () => setMaxLpPoolValue,
|
|
37
|
+
setMaxValuationWindowMs: () => setMaxValuationWindowMs,
|
|
38
|
+
setNoTradeWindowMs: () => setNoTradeWindowMs,
|
|
39
|
+
setPlpSupplyFeeRate: () => setPlpSupplyFeeRate,
|
|
40
|
+
setPlpWithdrawFeeRate: () => setPlpWithdrawFeeRate,
|
|
41
|
+
setProtocolReserveProfitShare: () => setProtocolReserveProfitShare,
|
|
42
|
+
setPythSpotFreshnessMs: () => setPythSpotFreshnessMs,
|
|
43
|
+
setReferralFeeRate: () => setReferralFeeRate,
|
|
44
|
+
setTemplateBackingBufferLambda: () => setTemplateBackingBufferLambda,
|
|
45
|
+
setTemplateBaseFee: () => setTemplateBaseFee,
|
|
46
|
+
setTemplateExpiryFeeMaxMultiplier: () => setTemplateExpiryFeeMaxMultiplier,
|
|
47
|
+
setTemplateExpiryFeeWindowMs: () => setTemplateExpiryFeeWindowMs,
|
|
48
|
+
setTemplateInventoryImpactMaxRate: () => setTemplateInventoryImpactMaxRate,
|
|
49
|
+
setTemplateMaxEntryProbability: () => setTemplateMaxEntryProbability,
|
|
50
|
+
setTemplateMinEntryProbability: () => setTemplateMinEntryProbability,
|
|
51
|
+
setTemplateMinFee: () => setTemplateMinFee,
|
|
52
|
+
setTradingPaused: () => setTradingPaused,
|
|
53
|
+
setUsePythSpotForForward: () => setUsePythSpotForForward,
|
|
54
|
+
tradingPaused: () => tradingPaused,
|
|
55
|
+
valuationInProgress: () => valuationInProgress
|
|
56
|
+
});
|
|
57
|
+
const $moduleName = "@local-pkg/deepbook_predict::protocol_config";
|
|
58
|
+
const ProtocolConfig = new MoveStruct({
|
|
59
|
+
name: `${$moduleName}::ProtocolConfig`,
|
|
60
|
+
fields: {
|
|
61
|
+
id: bcs.Address,
|
|
62
|
+
pricing_config: PricingConfig,
|
|
63
|
+
protocol_reserve_profit_share: U64,
|
|
64
|
+
referral_fee_rate: U64,
|
|
65
|
+
plp_supply_fee_rate: U64,
|
|
66
|
+
plp_withdraw_fee_rate: U64,
|
|
67
|
+
lp_request_limit_flush_attempts: U64,
|
|
68
|
+
max_lp_pool_value: U64,
|
|
69
|
+
max_valuation_window_ms: U64,
|
|
70
|
+
no_trade_window_ms: U64,
|
|
71
|
+
strike_exposure_template_config: StrikeExposureConfig,
|
|
72
|
+
ewma_config: EwmaConfig,
|
|
73
|
+
version_watermark: U64,
|
|
74
|
+
trading_paused: bcs.bool(),
|
|
75
|
+
frozen: bcs.bool(),
|
|
76
|
+
valuation_in_progress: bcs.bool(),
|
|
77
|
+
snapshot_in_progress: bcs.bool(),
|
|
78
|
+
flush_seq: U64
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* Return the protocol config object ID for external discovery and PTB
|
|
83
|
+
* construction.
|
|
84
|
+
*/
|
|
85
|
+
function id(options) {
|
|
86
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
87
|
+
const argumentsTypes = [null];
|
|
88
|
+
const parameterNames = ["config"];
|
|
89
|
+
return (tx) => tx.moveCall({
|
|
90
|
+
package: packageAddress,
|
|
91
|
+
module: "protocol_config",
|
|
92
|
+
function: "id",
|
|
93
|
+
arguments: normalizeMoveArguments({
|
|
94
|
+
...options.arguments,
|
|
95
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
96
|
+
}, argumentsTypes, parameterNames)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/** Return the global trading-pause state for SDK and devInspect reads. */
|
|
100
|
+
function tradingPaused(options) {
|
|
101
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
102
|
+
const argumentsTypes = [null];
|
|
103
|
+
const parameterNames = ["config"];
|
|
104
|
+
return (tx) => tx.moveCall({
|
|
105
|
+
package: packageAddress,
|
|
106
|
+
module: "protocol_config",
|
|
107
|
+
function: "trading_paused",
|
|
108
|
+
arguments: normalizeMoveArguments({
|
|
109
|
+
...options.arguments,
|
|
110
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
111
|
+
}, argumentsTypes, parameterNames)
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/** Return the global protocol-freeze state for SDK and devInspect reads. */
|
|
115
|
+
function frozen(options) {
|
|
116
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
117
|
+
const argumentsTypes = [null];
|
|
118
|
+
const parameterNames = ["config"];
|
|
119
|
+
return (tx) => tx.moveCall({
|
|
120
|
+
package: packageAddress,
|
|
121
|
+
module: "protocol_config",
|
|
122
|
+
function: "frozen",
|
|
123
|
+
arguments: normalizeMoveArguments({
|
|
124
|
+
...options.arguments,
|
|
125
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
126
|
+
}, argumentsTypes, parameterNames)
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Return whether a full-pool valuation is in flight, for SDK and devInspect reads.
|
|
131
|
+
* The flush spans transactions, so "in flight" is an observable state: a keeper
|
|
132
|
+
* reads it to notice a flush it must finish or discard, and an integrator reads it
|
|
133
|
+
* to explain a gated keeper/config transaction. Trading is not gated on it.
|
|
134
|
+
*/
|
|
135
|
+
function valuationInProgress(options) {
|
|
136
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
137
|
+
const argumentsTypes = [null];
|
|
138
|
+
const parameterNames = ["config"];
|
|
139
|
+
return (tx) => tx.moveCall({
|
|
140
|
+
package: packageAddress,
|
|
141
|
+
module: "protocol_config",
|
|
142
|
+
function: "valuation_in_progress",
|
|
143
|
+
arguments: normalizeMoveArguments({
|
|
144
|
+
...options.arguments,
|
|
145
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
146
|
+
}, argumentsTypes, parameterNames)
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/** Return the live referral fee rate for SDK and devInspect reads. */
|
|
150
|
+
function referralFeeRate(options) {
|
|
151
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
152
|
+
const argumentsTypes = [null];
|
|
153
|
+
const parameterNames = ["config"];
|
|
154
|
+
return (tx) => tx.moveCall({
|
|
155
|
+
package: packageAddress,
|
|
156
|
+
module: "protocol_config",
|
|
157
|
+
function: "referral_fee_rate",
|
|
158
|
+
arguments: normalizeMoveArguments({
|
|
159
|
+
...options.arguments,
|
|
160
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
161
|
+
}, argumentsTypes, parameterNames)
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Window before expiry in which live quotes, mints, and live redeems abort.
|
|
166
|
+
* `public` for SDK and devInspect reads: a client that cannot see this value can
|
|
167
|
+
* only learn the window closed by decoding `ETradeWindowClosed` from a failed
|
|
168
|
+
* quote.
|
|
169
|
+
*/
|
|
170
|
+
function noTradeWindowMs(options) {
|
|
171
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
172
|
+
const argumentsTypes = [null];
|
|
173
|
+
const parameterNames = ["config"];
|
|
174
|
+
return (tx) => tx.moveCall({
|
|
175
|
+
package: packageAddress,
|
|
176
|
+
module: "protocol_config",
|
|
177
|
+
function: "no_trade_window_ms",
|
|
178
|
+
arguments: normalizeMoveArguments({
|
|
179
|
+
...options.arguments,
|
|
180
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
181
|
+
}, argumentsTypes, parameterNames)
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/** Set the base fee multiplier snapshotted by newly created expiry markets. */
|
|
185
|
+
function setTemplateBaseFee(options) {
|
|
186
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
187
|
+
const argumentsTypes = [
|
|
188
|
+
null,
|
|
189
|
+
null,
|
|
190
|
+
"u64",
|
|
191
|
+
"0x2::clock::Clock"
|
|
192
|
+
];
|
|
193
|
+
const parameterNames = [
|
|
194
|
+
"config",
|
|
195
|
+
"AdminCap",
|
|
196
|
+
"fee"
|
|
197
|
+
];
|
|
198
|
+
return (tx) => tx.moveCall({
|
|
199
|
+
package: packageAddress,
|
|
200
|
+
module: "protocol_config",
|
|
201
|
+
function: "set_template_base_fee",
|
|
202
|
+
arguments: normalizeMoveArguments({
|
|
203
|
+
...options.arguments,
|
|
204
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
205
|
+
}, argumentsTypes, parameterNames)
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/** Set the minimum fee floor snapshotted by newly created expiry markets. */
|
|
209
|
+
function setTemplateMinFee(options) {
|
|
210
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
211
|
+
const argumentsTypes = [
|
|
212
|
+
null,
|
|
213
|
+
null,
|
|
214
|
+
"u64",
|
|
215
|
+
"0x2::clock::Clock"
|
|
216
|
+
];
|
|
217
|
+
const parameterNames = [
|
|
218
|
+
"config",
|
|
219
|
+
"AdminCap",
|
|
220
|
+
"fee"
|
|
221
|
+
];
|
|
222
|
+
return (tx) => tx.moveCall({
|
|
223
|
+
package: packageAddress,
|
|
224
|
+
module: "protocol_config",
|
|
225
|
+
function: "set_template_min_fee",
|
|
226
|
+
arguments: normalizeMoveArguments({
|
|
227
|
+
...options.arguments,
|
|
228
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
229
|
+
}, argumentsTypes, parameterNames)
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/** Set the expiry-fee ramp window snapshotted by newly created expiry markets. */
|
|
233
|
+
function setTemplateExpiryFeeWindowMs(options) {
|
|
234
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
235
|
+
const argumentsTypes = [
|
|
236
|
+
null,
|
|
237
|
+
null,
|
|
238
|
+
"u64",
|
|
239
|
+
"0x2::clock::Clock"
|
|
240
|
+
];
|
|
241
|
+
const parameterNames = [
|
|
242
|
+
"config",
|
|
243
|
+
"AdminCap",
|
|
244
|
+
"value"
|
|
245
|
+
];
|
|
246
|
+
return (tx) => tx.moveCall({
|
|
247
|
+
package: packageAddress,
|
|
248
|
+
module: "protocol_config",
|
|
249
|
+
function: "set_template_expiry_fee_window_ms",
|
|
250
|
+
arguments: normalizeMoveArguments({
|
|
251
|
+
...options.arguments,
|
|
252
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
253
|
+
}, argumentsTypes, parameterNames)
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
/** Set the expiry-fee max multiplier snapshotted by newly created expiry markets. */
|
|
257
|
+
function setTemplateExpiryFeeMaxMultiplier(options) {
|
|
258
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
259
|
+
const argumentsTypes = [
|
|
260
|
+
null,
|
|
261
|
+
null,
|
|
262
|
+
"u64",
|
|
263
|
+
"0x2::clock::Clock"
|
|
264
|
+
];
|
|
265
|
+
const parameterNames = [
|
|
266
|
+
"config",
|
|
267
|
+
"AdminCap",
|
|
268
|
+
"value"
|
|
269
|
+
];
|
|
270
|
+
return (tx) => tx.moveCall({
|
|
271
|
+
package: packageAddress,
|
|
272
|
+
module: "protocol_config",
|
|
273
|
+
function: "set_template_expiry_fee_max_multiplier",
|
|
274
|
+
arguments: normalizeMoveArguments({
|
|
275
|
+
...options.arguments,
|
|
276
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
277
|
+
}, argumentsTypes, parameterNames)
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
/** Set the backing-buffer lambda snapshotted by newly created expiry markets. */
|
|
281
|
+
function setTemplateBackingBufferLambda(options) {
|
|
282
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
283
|
+
const argumentsTypes = [
|
|
284
|
+
null,
|
|
285
|
+
null,
|
|
286
|
+
"u64",
|
|
287
|
+
"0x2::clock::Clock"
|
|
288
|
+
];
|
|
289
|
+
const parameterNames = [
|
|
290
|
+
"config",
|
|
291
|
+
"AdminCap",
|
|
292
|
+
"value"
|
|
293
|
+
];
|
|
294
|
+
return (tx) => tx.moveCall({
|
|
295
|
+
package: packageAddress,
|
|
296
|
+
module: "protocol_config",
|
|
297
|
+
function: "set_template_backing_buffer_lambda",
|
|
298
|
+
arguments: normalizeMoveArguments({
|
|
299
|
+
...options.arguments,
|
|
300
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
301
|
+
}, argumentsTypes, parameterNames)
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Set the maximum marginal inventory-impact rate snapshotted by newly created
|
|
306
|
+
* expiry markets. `0` (the default) disables both charges and rebates.
|
|
307
|
+
*/
|
|
308
|
+
function setTemplateInventoryImpactMaxRate(options) {
|
|
309
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
310
|
+
const argumentsTypes = [
|
|
311
|
+
null,
|
|
312
|
+
null,
|
|
313
|
+
"u64",
|
|
314
|
+
"0x2::clock::Clock"
|
|
315
|
+
];
|
|
316
|
+
const parameterNames = [
|
|
317
|
+
"config",
|
|
318
|
+
"AdminCap",
|
|
319
|
+
"value"
|
|
320
|
+
];
|
|
321
|
+
return (tx) => tx.moveCall({
|
|
322
|
+
package: packageAddress,
|
|
323
|
+
module: "protocol_config",
|
|
324
|
+
function: "set_template_inventory_impact_max_rate",
|
|
325
|
+
arguments: normalizeMoveArguments({
|
|
326
|
+
...options.arguments,
|
|
327
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
328
|
+
}, argumentsTypes, parameterNames)
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Set the minimum raw entry probability snapshotted by newly created expiry
|
|
333
|
+
* markets.
|
|
334
|
+
*/
|
|
335
|
+
function setTemplateMinEntryProbability(options) {
|
|
336
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
337
|
+
const argumentsTypes = [
|
|
338
|
+
null,
|
|
339
|
+
null,
|
|
340
|
+
"u64",
|
|
341
|
+
"0x2::clock::Clock"
|
|
342
|
+
];
|
|
343
|
+
const parameterNames = [
|
|
344
|
+
"config",
|
|
345
|
+
"AdminCap",
|
|
346
|
+
"value"
|
|
347
|
+
];
|
|
348
|
+
return (tx) => tx.moveCall({
|
|
349
|
+
package: packageAddress,
|
|
350
|
+
module: "protocol_config",
|
|
351
|
+
function: "set_template_min_entry_probability",
|
|
352
|
+
arguments: normalizeMoveArguments({
|
|
353
|
+
...options.arguments,
|
|
354
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
355
|
+
}, argumentsTypes, parameterNames)
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Set the maximum raw entry probability snapshotted by newly created expiry
|
|
360
|
+
* markets.
|
|
361
|
+
*/
|
|
362
|
+
function setTemplateMaxEntryProbability(options) {
|
|
363
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
364
|
+
const argumentsTypes = [
|
|
365
|
+
null,
|
|
366
|
+
null,
|
|
367
|
+
"u64",
|
|
368
|
+
"0x2::clock::Clock"
|
|
369
|
+
];
|
|
370
|
+
const parameterNames = [
|
|
371
|
+
"config",
|
|
372
|
+
"AdminCap",
|
|
373
|
+
"value"
|
|
374
|
+
];
|
|
375
|
+
return (tx) => tx.moveCall({
|
|
376
|
+
package: packageAddress,
|
|
377
|
+
module: "protocol_config",
|
|
378
|
+
function: "set_template_max_entry_probability",
|
|
379
|
+
arguments: normalizeMoveArguments({
|
|
380
|
+
...options.arguments,
|
|
381
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
382
|
+
}, argumentsTypes, parameterNames)
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Select which source the live forward is built from: `true` carries the Block
|
|
387
|
+
* Scholes basis on a fresh Pyth spot, `false` uses the Block Scholes forward
|
|
388
|
+
* directly. Locked during valuation so one flush marks every market on one
|
|
389
|
+
* formula.
|
|
390
|
+
*/
|
|
391
|
+
function setUsePythSpotForForward(options) {
|
|
392
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
393
|
+
const argumentsTypes = [
|
|
394
|
+
null,
|
|
395
|
+
null,
|
|
396
|
+
"bool",
|
|
397
|
+
"0x2::clock::Clock"
|
|
398
|
+
];
|
|
399
|
+
const parameterNames = [
|
|
400
|
+
"config",
|
|
401
|
+
"AdminCap",
|
|
402
|
+
"enabled"
|
|
403
|
+
];
|
|
404
|
+
return (tx) => tx.moveCall({
|
|
405
|
+
package: packageAddress,
|
|
406
|
+
module: "protocol_config",
|
|
407
|
+
function: "set_use_pyth_spot_for_forward",
|
|
408
|
+
arguments: normalizeMoveArguments({
|
|
409
|
+
...options.arguments,
|
|
410
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
411
|
+
}, argumentsTypes, parameterNames)
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
/** Set the live Pyth spot freshness threshold. */
|
|
415
|
+
function setPythSpotFreshnessMs(options) {
|
|
416
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
417
|
+
const argumentsTypes = [
|
|
418
|
+
null,
|
|
419
|
+
null,
|
|
420
|
+
"u64",
|
|
421
|
+
"0x2::clock::Clock"
|
|
422
|
+
];
|
|
423
|
+
const parameterNames = [
|
|
424
|
+
"config",
|
|
425
|
+
"AdminCap",
|
|
426
|
+
"value"
|
|
427
|
+
];
|
|
428
|
+
return (tx) => tx.moveCall({
|
|
429
|
+
package: packageAddress,
|
|
430
|
+
module: "protocol_config",
|
|
431
|
+
function: "set_pyth_spot_freshness_ms",
|
|
432
|
+
arguments: normalizeMoveArguments({
|
|
433
|
+
...options.arguments,
|
|
434
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
435
|
+
}, argumentsTypes, parameterNames)
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
/** Set the live Block Scholes spot/forward freshness threshold. */
|
|
439
|
+
function setBlockScholesPriceFreshnessMs(options) {
|
|
440
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
441
|
+
const argumentsTypes = [
|
|
442
|
+
null,
|
|
443
|
+
null,
|
|
444
|
+
"u64",
|
|
445
|
+
"0x2::clock::Clock"
|
|
446
|
+
];
|
|
447
|
+
const parameterNames = [
|
|
448
|
+
"config",
|
|
449
|
+
"AdminCap",
|
|
450
|
+
"value"
|
|
451
|
+
];
|
|
452
|
+
return (tx) => tx.moveCall({
|
|
453
|
+
package: packageAddress,
|
|
454
|
+
module: "protocol_config",
|
|
455
|
+
function: "set_block_scholes_price_freshness_ms",
|
|
456
|
+
arguments: normalizeMoveArguments({
|
|
457
|
+
...options.arguments,
|
|
458
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
459
|
+
}, argumentsTypes, parameterNames)
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
/** Set the live Block Scholes SVI freshness threshold. */
|
|
463
|
+
function setBlockScholesSviFreshnessMs(options) {
|
|
464
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
465
|
+
const argumentsTypes = [
|
|
466
|
+
null,
|
|
467
|
+
null,
|
|
468
|
+
"u64",
|
|
469
|
+
"0x2::clock::Clock"
|
|
470
|
+
];
|
|
471
|
+
const parameterNames = [
|
|
472
|
+
"config",
|
|
473
|
+
"AdminCap",
|
|
474
|
+
"value"
|
|
475
|
+
];
|
|
476
|
+
return (tx) => tx.moveCall({
|
|
477
|
+
package: packageAddress,
|
|
478
|
+
module: "protocol_config",
|
|
479
|
+
function: "set_block_scholes_svi_freshness_ms",
|
|
480
|
+
arguments: normalizeMoveArguments({
|
|
481
|
+
...options.arguments,
|
|
482
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
483
|
+
}, argumentsTypes, parameterNames)
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Set how many frozen-mark attempts a queued LP request gets before it is
|
|
488
|
+
* cancelled and refunded. `1` is fill-or-kill. Raising it lets a request rest at
|
|
489
|
+
* the head across flushes, which stops that queue each time it misses — see RP-12
|
|
490
|
+
* for the liveness cost that buys.
|
|
491
|
+
*/
|
|
492
|
+
function setLpRequestLimitFlushAttempts(options) {
|
|
493
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
494
|
+
const argumentsTypes = [
|
|
495
|
+
null,
|
|
496
|
+
null,
|
|
497
|
+
"u64"
|
|
498
|
+
];
|
|
499
|
+
const parameterNames = [
|
|
500
|
+
"config",
|
|
501
|
+
"AdminCap",
|
|
502
|
+
"attempts"
|
|
503
|
+
];
|
|
504
|
+
return (tx) => tx.moveCall({
|
|
505
|
+
package: packageAddress,
|
|
506
|
+
module: "protocol_config",
|
|
507
|
+
function: "set_lp_request_limit_flush_attempts",
|
|
508
|
+
arguments: normalizeMoveArguments({
|
|
509
|
+
...options.arguments,
|
|
510
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
511
|
+
}, argumentsTypes, parameterNames)
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Set how long a started full-pool valuation may stay in flight before anyone may
|
|
516
|
+
* discard it. A stalled flush costs LP-fill latency (and settlement latency for
|
|
517
|
+
* its own market set), not a trading pause, so this is an operator liveness knob:
|
|
518
|
+
* too short and a legitimate long flush can be discarded from under the keeper,
|
|
519
|
+
* too long and an abandoned one delays queued LP fills for that duration. See
|
|
520
|
+
* RP-29.
|
|
521
|
+
*/
|
|
522
|
+
function setMaxValuationWindowMs(options) {
|
|
523
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
524
|
+
const argumentsTypes = [
|
|
525
|
+
null,
|
|
526
|
+
null,
|
|
527
|
+
"u64"
|
|
528
|
+
];
|
|
529
|
+
const parameterNames = [
|
|
530
|
+
"config",
|
|
531
|
+
"AdminCap",
|
|
532
|
+
"windowMs"
|
|
533
|
+
];
|
|
534
|
+
return (tx) => tx.moveCall({
|
|
535
|
+
package: packageAddress,
|
|
536
|
+
module: "protocol_config",
|
|
537
|
+
function: "set_max_valuation_window_ms",
|
|
538
|
+
arguments: normalizeMoveArguments({
|
|
539
|
+
...options.arguments,
|
|
540
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
541
|
+
}, argumentsTypes, parameterNames)
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Set the ceiling on LP-attributable pool value that queued supplies may raise the
|
|
546
|
+
* pool to. A supply that would carry the pool past it is filled up to the cap at
|
|
547
|
+
* the flush and its remainder stays queued; withdrawals and already-issued PLP are
|
|
548
|
+
* unaffected, so lowering this below current pool value closes the pool to new
|
|
549
|
+
* capital rather than forcing anyone out.
|
|
550
|
+
*/
|
|
551
|
+
function setMaxLpPoolValue(options) {
|
|
552
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
553
|
+
const argumentsTypes = [
|
|
554
|
+
null,
|
|
555
|
+
null,
|
|
556
|
+
"u64"
|
|
557
|
+
];
|
|
558
|
+
const parameterNames = [
|
|
559
|
+
"config",
|
|
560
|
+
"AdminCap",
|
|
561
|
+
"maxPoolValue"
|
|
562
|
+
];
|
|
563
|
+
return (tx) => tx.moveCall({
|
|
564
|
+
package: packageAddress,
|
|
565
|
+
module: "protocol_config",
|
|
566
|
+
function: "set_max_lp_pool_value",
|
|
567
|
+
arguments: normalizeMoveArguments({
|
|
568
|
+
...options.arguments,
|
|
569
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
570
|
+
}, argumentsTypes, parameterNames)
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
/** Set the EWMA gas-price penalty parameters. */
|
|
574
|
+
function setEwmaParams(options) {
|
|
575
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
576
|
+
const argumentsTypes = [
|
|
577
|
+
null,
|
|
578
|
+
null,
|
|
579
|
+
"u64",
|
|
580
|
+
"u64",
|
|
581
|
+
"u64",
|
|
582
|
+
"0x2::clock::Clock"
|
|
583
|
+
];
|
|
584
|
+
const parameterNames = [
|
|
585
|
+
"config",
|
|
586
|
+
"AdminCap",
|
|
587
|
+
"alpha",
|
|
588
|
+
"zScoreThreshold",
|
|
589
|
+
"penaltyRate"
|
|
590
|
+
];
|
|
591
|
+
return (tx) => tx.moveCall({
|
|
592
|
+
package: packageAddress,
|
|
593
|
+
module: "protocol_config",
|
|
594
|
+
function: "set_ewma_params",
|
|
595
|
+
arguments: normalizeMoveArguments({
|
|
596
|
+
...options.arguments,
|
|
597
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
598
|
+
}, argumentsTypes, parameterNames)
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
/** Enable or disable the EWMA gas-price penalty. */
|
|
602
|
+
function setEwmaEnabled(options) {
|
|
603
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
604
|
+
const argumentsTypes = [
|
|
605
|
+
null,
|
|
606
|
+
null,
|
|
607
|
+
"bool",
|
|
608
|
+
"0x2::clock::Clock"
|
|
609
|
+
];
|
|
610
|
+
const parameterNames = [
|
|
611
|
+
"config",
|
|
612
|
+
"AdminCap",
|
|
613
|
+
"enabled"
|
|
614
|
+
];
|
|
615
|
+
return (tx) => tx.moveCall({
|
|
616
|
+
package: packageAddress,
|
|
617
|
+
module: "protocol_config",
|
|
618
|
+
function: "set_ewma_enabled",
|
|
619
|
+
arguments: normalizeMoveArguments({
|
|
620
|
+
...options.arguments,
|
|
621
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
622
|
+
}, argumentsTypes, parameterNames)
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Set the window before expiry in which live quotes, mints, and live redeems
|
|
627
|
+
* abort. `0` disables the block. Read live at trade time, so a change applies to
|
|
628
|
+
* markets already trading and stays available as an incident control.
|
|
629
|
+
*
|
|
630
|
+
* Deliberately not gated on `assert_not_valuation_in_progress`, matching
|
|
631
|
+
* `set_trading_paused`: a stalled flush must not be able to trap a safety control.
|
|
632
|
+
* Nothing in the flush reads this value, so a mid-valuation change cannot skew a
|
|
633
|
+
* frozen mark.
|
|
634
|
+
*/
|
|
635
|
+
function setNoTradeWindowMs(options) {
|
|
636
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
637
|
+
const argumentsTypes = [
|
|
638
|
+
null,
|
|
639
|
+
null,
|
|
640
|
+
"u64",
|
|
641
|
+
"0x2::clock::Clock"
|
|
642
|
+
];
|
|
643
|
+
const parameterNames = [
|
|
644
|
+
"config",
|
|
645
|
+
"AdminCap",
|
|
646
|
+
"value"
|
|
647
|
+
];
|
|
648
|
+
return (tx) => tx.moveCall({
|
|
649
|
+
package: packageAddress,
|
|
650
|
+
module: "protocol_config",
|
|
651
|
+
function: "set_no_trade_window_ms",
|
|
652
|
+
arguments: normalizeMoveArguments({
|
|
653
|
+
...options.arguments,
|
|
654
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
655
|
+
}, argumentsTypes, parameterNames)
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
/** Set whether trading is paused. */
|
|
659
|
+
function setTradingPaused(options) {
|
|
660
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
661
|
+
const argumentsTypes = [
|
|
662
|
+
null,
|
|
663
|
+
null,
|
|
664
|
+
"bool"
|
|
665
|
+
];
|
|
666
|
+
const parameterNames = [
|
|
667
|
+
"config",
|
|
668
|
+
"AdminCap",
|
|
669
|
+
"paused"
|
|
670
|
+
];
|
|
671
|
+
return (tx) => tx.moveCall({
|
|
672
|
+
package: packageAddress,
|
|
673
|
+
module: "protocol_config",
|
|
674
|
+
function: "set_trading_paused",
|
|
675
|
+
arguments: normalizeMoveArguments({
|
|
676
|
+
...options.arguments,
|
|
677
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
678
|
+
}, argumentsTypes, parameterNames)
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Set the protocol-wide emergency freeze.
|
|
683
|
+
*
|
|
684
|
+
* Intentionally NOT version-gated, unlike every other admin setter: the freeze
|
|
685
|
+
* gate lives inside `assert_version`, so routing this through it would make an
|
|
686
|
+
* engaged freeze unclearable without a package upgrade — defeating the point.
|
|
687
|
+
*/
|
|
688
|
+
function setFrozen(options) {
|
|
689
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
690
|
+
const argumentsTypes = [
|
|
691
|
+
null,
|
|
692
|
+
null,
|
|
693
|
+
"bool"
|
|
694
|
+
];
|
|
695
|
+
const parameterNames = [
|
|
696
|
+
"config",
|
|
697
|
+
"AdminCap",
|
|
698
|
+
"frozen"
|
|
699
|
+
];
|
|
700
|
+
return (tx) => tx.moveCall({
|
|
701
|
+
package: packageAddress,
|
|
702
|
+
module: "protocol_config",
|
|
703
|
+
function: "set_frozen",
|
|
704
|
+
arguments: normalizeMoveArguments({
|
|
705
|
+
...options.arguments,
|
|
706
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
707
|
+
}, argumentsTypes, parameterNames)
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Advance the version floor to this package's compiled-in `current_version!()`.
|
|
712
|
+
*
|
|
713
|
+
* The floor cannot be set above the executing package's version. This function is
|
|
714
|
+
* ungated so an upgraded package can retire older versions; it aborts unless the
|
|
715
|
+
* executing version is strictly greater than the existing floor.
|
|
716
|
+
*/
|
|
717
|
+
function bumpVersionWatermark(options) {
|
|
718
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
719
|
+
const argumentsTypes = [null, null];
|
|
720
|
+
const parameterNames = ["config", "AdminCap"];
|
|
721
|
+
return (tx) => tx.moveCall({
|
|
722
|
+
package: packageAddress,
|
|
723
|
+
module: "protocol_config",
|
|
724
|
+
function: "bump_version_watermark",
|
|
725
|
+
arguments: normalizeMoveArguments({
|
|
726
|
+
...options.arguments,
|
|
727
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
728
|
+
}, argumentsTypes, parameterNames)
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Set the protocol reserve profit share used when materializing aggregate expiry
|
|
733
|
+
* profit. Admin-gated; validated against its config-constants envelope.
|
|
734
|
+
*/
|
|
735
|
+
function setProtocolReserveProfitShare(options) {
|
|
736
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
737
|
+
const argumentsTypes = [
|
|
738
|
+
null,
|
|
739
|
+
null,
|
|
740
|
+
"u64"
|
|
741
|
+
];
|
|
742
|
+
const parameterNames = [
|
|
743
|
+
"config",
|
|
744
|
+
"AdminCap",
|
|
745
|
+
"protocolReserveProfitShare"
|
|
746
|
+
];
|
|
747
|
+
return (tx) => tx.moveCall({
|
|
748
|
+
package: packageAddress,
|
|
749
|
+
module: "protocol_config",
|
|
750
|
+
function: "set_protocol_reserve_profit_share",
|
|
751
|
+
arguments: normalizeMoveArguments({
|
|
752
|
+
...options.arguments,
|
|
753
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
754
|
+
}, argumentsTypes, parameterNames)
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Set the portion of referred mint fees routed to the referrer. The new rate
|
|
759
|
+
* applies to subsequent mints without changing their all-in account withdrawal.
|
|
760
|
+
*/
|
|
761
|
+
function setReferralFeeRate(options) {
|
|
762
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
763
|
+
const argumentsTypes = [
|
|
764
|
+
null,
|
|
765
|
+
null,
|
|
766
|
+
"u64"
|
|
767
|
+
];
|
|
768
|
+
const parameterNames = [
|
|
769
|
+
"config",
|
|
770
|
+
"AdminCap",
|
|
771
|
+
"rate"
|
|
772
|
+
];
|
|
773
|
+
return (tx) => tx.moveCall({
|
|
774
|
+
package: packageAddress,
|
|
775
|
+
module: "protocol_config",
|
|
776
|
+
function: "set_referral_fee_rate",
|
|
777
|
+
arguments: normalizeMoveArguments({
|
|
778
|
+
...options.arguments,
|
|
779
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
780
|
+
}, argumentsTypes, parameterNames)
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Set the fee charged on executed PLP supply fills. Admin-gated and validated
|
|
785
|
+
* against its config-constants envelope. Locked during valuation so the rate a
|
|
786
|
+
* flush froze into its mark cannot change midway through that flush.
|
|
787
|
+
*/
|
|
788
|
+
function setPlpSupplyFeeRate(options) {
|
|
789
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
790
|
+
const argumentsTypes = [
|
|
791
|
+
null,
|
|
792
|
+
null,
|
|
793
|
+
"u64",
|
|
794
|
+
"0x2::clock::Clock"
|
|
795
|
+
];
|
|
796
|
+
const parameterNames = [
|
|
797
|
+
"config",
|
|
798
|
+
"AdminCap",
|
|
799
|
+
"rate"
|
|
800
|
+
];
|
|
801
|
+
return (tx) => tx.moveCall({
|
|
802
|
+
package: packageAddress,
|
|
803
|
+
module: "protocol_config",
|
|
804
|
+
function: "set_plp_supply_fee_rate",
|
|
805
|
+
arguments: normalizeMoveArguments({
|
|
806
|
+
...options.arguments,
|
|
807
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
808
|
+
}, argumentsTypes, parameterNames)
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Set the fee charged on executed PLP withdraw fills. Same gating as the supply
|
|
813
|
+
* leg; the two are independent so the exit charge can move without taxing entry.
|
|
814
|
+
*/
|
|
815
|
+
function setPlpWithdrawFeeRate(options) {
|
|
816
|
+
const packageAddress = options.package ?? options.config?.predictPackageId ?? "@local-pkg/deepbook_predict";
|
|
817
|
+
const argumentsTypes = [
|
|
818
|
+
null,
|
|
819
|
+
null,
|
|
820
|
+
"u64",
|
|
821
|
+
"0x2::clock::Clock"
|
|
822
|
+
];
|
|
823
|
+
const parameterNames = [
|
|
824
|
+
"config",
|
|
825
|
+
"AdminCap",
|
|
826
|
+
"rate"
|
|
827
|
+
];
|
|
828
|
+
return (tx) => tx.moveCall({
|
|
829
|
+
package: packageAddress,
|
|
830
|
+
module: "protocol_config",
|
|
831
|
+
function: "set_plp_withdraw_fee_rate",
|
|
832
|
+
arguments: normalizeMoveArguments({
|
|
833
|
+
...options.arguments,
|
|
834
|
+
config: options.arguments?.config ?? options.config?.protocolConfig
|
|
835
|
+
}, argumentsTypes, parameterNames)
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
//#endregion
|
|
840
|
+
export { protocol_config_exports };
|
|
841
|
+
//# sourceMappingURL=protocol_config.mjs.map
|