@mysten/deepbook-v3 2.9.1 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +21 -0
- package/dist/account-bindings/account-registry.d.mts +109 -0
- package/dist/account-bindings/account-registry.d.mts.map +1 -0
- package/dist/account-bindings/account-registry.mjs +56 -0
- package/dist/account-bindings/account-registry.mjs.map +1 -0
- package/dist/account-bindings/account.d.mts +176 -0
- package/dist/account-bindings/account.d.mts.map +1 -0
- package/dist/account-bindings/account.mjs +94 -0
- package/dist/account-bindings/account.mjs.map +1 -0
- package/dist/account-bindings/latest.d.mts +12 -0
- package/dist/account-bindings/latest.d.mts.map +1 -0
- package/dist/account-bindings/latest.mjs +19 -0
- package/dist/account-bindings/latest.mjs.map +1 -0
- package/dist/account.d.mts +46 -3
- package/dist/account.d.mts.map +1 -1
- package/dist/account.mjs +51 -2
- package/dist/account.mjs.map +1 -1
- package/dist/client.d.mts +2 -2
- package/dist/contracts/account/account.d.mts +25 -97
- package/dist/contracts/account/account.d.mts.map +1 -1
- package/dist/contracts/account/account.mjs +43 -35
- package/dist/contracts/account/account.mjs.map +1 -1
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_events.d.mts.map +1 -1
- package/dist/contracts/account/account_registry.d.mts +7 -54
- package/dist/contracts/account/account_registry.d.mts.map +1 -1
- package/dist/contracts/account/account_registry.mjs +2 -22
- package/dist/contracts/account/account_registry.mjs.map +1 -1
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/admin.d.mts +4 -4
- package/dist/contracts/deepbook_predict/admin.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code.d.mts +60 -13
- package/dist/contracts/deepbook_predict/builder_code.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code.mjs +55 -1
- package/dist/contracts/deepbook_predict/builder_code.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +10 -10
- package/dist/contracts/deepbook_predict/config_events.d.mts +88 -84
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.mjs +8 -0
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +262 -101
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs +320 -41
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/market_manager.d.mts +27 -27
- package/dist/contracts/deepbook_predict/market_manager.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.d.mts +56 -54
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/pause_cap.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/plp.d.mts +74 -74
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/predict_account.d.mts +22 -17
- package/dist/contracts/deepbook_predict/predict_account.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs +12 -6
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.d.mts +67 -67
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +127 -83
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.mjs +59 -1
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/range_codec.d.mts +2 -2
- package/dist/contracts/deepbook_predict/range_codec.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/registry.d.mts +32 -32
- package/dist/contracts/deepbook_predict/registry.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.d.mts +131 -131
- package/dist/contracts/deepbook_predict_math/lazer_price.d.mts +13 -13
- package/dist/contracts/deepbook_predict_math/math.d.mts +14 -14
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts +30 -30
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs +6 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict_orders/desk.d.mts +28 -28
- package/dist/contracts/deepbook_predict_orders/desk.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict_orders/order_queue.d.mts +187 -187
- package/dist/contracts/deepbook_predict_orders/queue.d.mts +240 -62
- package/dist/contracts/deepbook_predict_orders/queue.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict_orders/queue.mjs +306 -41
- package/dist/contracts/deepbook_predict_orders/queue.mjs.map +1 -1
- package/dist/contracts/deepbook_predict_orders/queue_events.d.mts +140 -140
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/sessions.d.mts +271 -31
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.mjs +363 -3
- package/dist/contracts/deepbook_sessions/sessions.mjs.map +1 -1
- package/dist/deployments/mainnet.mjs.map +1 -1
- package/dist/deployments/testnet.d.mts.map +1 -1
- package/dist/deployments/testnet.mjs +7 -4
- package/dist/deployments/testnet.mjs.map +1 -1
- package/dist/predict/bindings/expiry-market.d.mts +57 -7
- package/dist/predict/bindings/expiry-market.d.mts.map +1 -1
- package/dist/predict/bindings/expiry-market.mjs +48 -2
- package/dist/predict/bindings/expiry-market.mjs.map +1 -1
- package/dist/predict/bindings/protocol-config.d.mts +5 -5
- package/dist/predict/bindings/protocol-config.d.mts.map +1 -1
- package/dist/predict/bindings/protocol-config.mjs +4 -1
- package/dist/predict/bindings/protocol-config.mjs.map +1 -1
- package/dist/predict/bindings/queue.d.mts +30 -0
- package/dist/predict/bindings/queue.d.mts.map +1 -0
- package/dist/predict/bindings/queue.mjs +59 -0
- package/dist/predict/bindings/queue.mjs.map +1 -0
- package/dist/predict/bindings/rename.mjs +5 -1
- package/dist/predict/bindings/rename.mjs.map +1 -1
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +11 -5
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/config/generated.d.mts +1 -1
- package/dist/predict/config/generated.d.mts.map +1 -1
- package/dist/predict/config/generated.mjs +1 -0
- package/dist/predict/config/generated.mjs.map +1 -1
- package/dist/predict/config/mainnet.mjs +3 -1
- package/dist/predict/config/mainnet.mjs.map +1 -1
- package/dist/predict/config/testnet.mjs +3 -1
- package/dist/predict/config/testnet.mjs.map +1 -1
- package/dist/predict/config/types.d.mts +23 -0
- package/dist/predict/config/types.d.mts.map +1 -1
- package/dist/predict/cost.d.mts +9 -1
- package/dist/predict/cost.d.mts.map +1 -1
- package/dist/predict/cost.mjs.map +1 -1
- package/dist/predict/errors.d.mts.map +1 -1
- package/dist/predict/errors.mjs +6 -2
- package/dist/predict/errors.mjs.map +1 -1
- package/dist/predict/index.d.mts +1 -1
- package/dist/predict/index.mjs +2 -2
- package/dist/predict/queue.d.mts +8 -4
- package/dist/predict/queue.d.mts.map +1 -1
- package/dist/predict/queue.mjs +8 -4
- package/dist/predict/queue.mjs.map +1 -1
- package/dist/predict/reads/balances.mjs +1 -1
- package/dist/predict/reads/pricing.d.mts +1 -0
- package/dist/predict/reads/pricing.d.mts.map +1 -1
- package/dist/predict/reads/queue.d.mts +4 -2
- package/dist/predict/reads/queue.d.mts.map +1 -1
- package/dist/predict/reads/queue.mjs +5 -4
- package/dist/predict/reads/queue.mjs.map +1 -1
- package/dist/predict/tx/authed.mjs +1 -1
- package/dist/predict/tx/common.d.mts.map +1 -1
- package/dist/predict/tx/common.mjs +3 -2
- package/dist/predict/tx/common.mjs.map +1 -1
- package/dist/predict/tx/trade.d.mts.map +1 -1
- package/dist/predict/tx/trade.mjs +3 -2
- package/dist/predict/tx/trade.mjs.map +1 -1
- package/dist/sessions.d.mts +10 -1
- package/dist/sessions.d.mts.map +1 -1
- package/dist/sessions.mjs.map +1 -1
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/balanceManager.d.mts.map +1 -1
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbook.d.mts.map +1 -1
- package/dist/transactions/deepbookAdmin.d.mts +4 -4
- package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
- package/dist/transactions/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginAdmin.d.mts.map +1 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginMaintainer.d.mts.map +1 -1
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginPool.d.mts.map +1 -1
- 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/dist/transactions/poolProxy.d.mts.map +1 -1
- package/dist/utils/constants.d.mts.map +1 -1
- package/dist/utils/constants.mjs +1 -1
- package/dist/utils/constants.mjs.map +1 -1
- package/package.json +2 -2
- package/src/account-bindings/account-registry.ts +39 -0
- package/src/account-bindings/account.ts +73 -0
- package/src/account-bindings/latest.ts +41 -0
- package/src/account.ts +89 -5
- package/src/contracts/account/account.ts +73 -4
- package/src/contracts/account/account_registry.ts +1 -1
- package/src/contracts/deepbook_predict/builder_code.ts +94 -2
- package/src/contracts/deepbook_predict/config_events.ts +7 -0
- package/src/contracts/deepbook_predict/expiry_market.ts +490 -44
- package/src/contracts/deepbook_predict/order_events.ts +6 -4
- package/src/contracts/deepbook_predict/predict_account.ts +12 -6
- package/src/contracts/deepbook_predict/protocol_config.ts +85 -0
- package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.ts +14 -0
- package/src/contracts/deepbook_predict_orders/order_flow.ts +4 -0
- package/src/contracts/deepbook_predict_orders/queue.ts +495 -9
- package/src/contracts/deepbook_sessions/sessions.ts +538 -3
- package/src/deployments/mainnet.ts +4 -4
- package/src/deployments/testnet.ts +18 -7
- package/src/deployments/types.ts +14 -0
- package/src/predict/bindings/expiry-market.ts +87 -0
- package/src/predict/bindings/queue.ts +42 -0
- package/src/predict/bindings/rename.ts +5 -1
- package/src/predict/client.ts +25 -3
- package/src/predict/config/generated.ts +3 -0
- package/src/predict/config/mainnet.ts +4 -0
- package/src/predict/config/testnet.ts +4 -0
- package/src/predict/config/types.ts +23 -0
- package/src/predict/cost.ts +9 -1
- package/src/predict/errors.ts +11 -1
- package/src/predict/index.ts +1 -1
- package/src/predict/queue.ts +8 -4
- package/src/predict/reads/queue.ts +7 -4
- package/src/predict/tx/common.ts +2 -0
- package/src/predict/tx/trade.ts +3 -1
- package/src/sessions.ts +10 -1
- package/src/utils/constants.ts +5 -1
|
@@ -55,8 +55,9 @@ export const OrderMinted = new MoveStruct({
|
|
|
55
55
|
/** Separate inventory-impact charge escrowed for live-close rebates. */
|
|
56
56
|
inventory_impact_charge: U64,
|
|
57
57
|
/**
|
|
58
|
-
* Builder credited
|
|
59
|
-
*
|
|
58
|
+
* Builder code the order named, credited with `builder_fee`; `none` when the order
|
|
59
|
+
* named none. Recorded even at a zero fee, so attribution covers apps that charge
|
|
60
|
+
* nothing.
|
|
60
61
|
*/
|
|
61
62
|
builder_code_id: bcs.option(bcs.Address),
|
|
62
63
|
/** Referrer recorded on the minting account, independent of the fee paid. */
|
|
@@ -99,8 +100,9 @@ export const LiveOrderRedeemed = new MoveStruct({
|
|
|
99
100
|
/** Separate inventory-impact rebate paid from its isolated escrow. */
|
|
100
101
|
inventory_impact_rebate: U64,
|
|
101
102
|
/**
|
|
102
|
-
* Builder credited
|
|
103
|
-
*
|
|
103
|
+
* Builder code the order named, credited with `builder_fee`; `none` when the order
|
|
104
|
+
* named none. Recorded even at a zero fee, so attribution covers apps that charge
|
|
105
|
+
* nothing.
|
|
104
106
|
*/
|
|
105
107
|
builder_code_id: bcs.option(bcs.Address),
|
|
106
108
|
onchain_timestamp_ms: U64,
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
* Predict's per-account state, stored as an app-data slot on a shared `Account`
|
|
7
7
|
* (the `account` package).
|
|
8
8
|
*
|
|
9
|
-
* This is Predict's account-local state: open positions and sticky builder
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* This is Predict's account-local state: open positions and a sticky builder code.
|
|
10
|
+
* The sticky code no longer affects fees: a trade names its builder and fee itself
|
|
11
|
+
* (`expiry_market::admit_mint_with_builder`). USDC/PLP custody lives in `Account`.
|
|
12
|
+
* The `PredictApp` witness namespaces this slot, so only Predict writes it.
|
|
12
13
|
*
|
|
13
14
|
* Position mutations are package-internal. Builder-code configuration accepts an
|
|
14
15
|
* account `Auth`; the account package decides which owner or authorized
|
|
@@ -135,8 +136,10 @@ export interface SetBuilderCodeOptions {
|
|
|
135
136
|
};
|
|
136
137
|
}
|
|
137
138
|
/**
|
|
138
|
-
* Set sticky builder
|
|
139
|
-
*
|
|
139
|
+
* Set the sticky builder code using valid account auth. Owner auth and
|
|
140
|
+
* authorized-app auth both satisfy the account borrow boundary. Kept for
|
|
141
|
+
* compatibility: it no longer affects fees, since a trade names its builder and
|
|
142
|
+
* fee itself.
|
|
140
143
|
*/
|
|
141
144
|
export function setBuilderCode(options: SetBuilderCodeOptions) {
|
|
142
145
|
const packageAddress =
|
|
@@ -164,7 +167,10 @@ export interface UnsetBuilderCodeOptions {
|
|
|
164
167
|
predictPackageId?: string;
|
|
165
168
|
};
|
|
166
169
|
}
|
|
167
|
-
/**
|
|
170
|
+
/**
|
|
171
|
+
* Clear the sticky builder code using valid owner or authorized-app auth. Kept for
|
|
172
|
+
* compatibility: the code no longer affects fees.
|
|
173
|
+
*/
|
|
168
174
|
export function unsetBuilderCode(options: UnsetBuilderCodeOptions) {
|
|
169
175
|
const packageAddress =
|
|
170
176
|
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
@@ -161,6 +161,10 @@ export const OrderFlowKey = new MoveTuple({
|
|
|
161
161
|
name: `${$moduleName}::OrderFlowKey<phantom W>`,
|
|
162
162
|
fields: [bcs.bool()],
|
|
163
163
|
});
|
|
164
|
+
export const BuilderFeeCapKey = new MoveTuple({
|
|
165
|
+
name: `${$moduleName}::BuilderFeeCapKey`,
|
|
166
|
+
fields: [bcs.bool()],
|
|
167
|
+
});
|
|
164
168
|
export interface IdArguments {
|
|
165
169
|
config?: RawTransactionArgument<string>;
|
|
166
170
|
}
|
|
@@ -366,6 +370,43 @@ export function feeIncentiveSubsidyRate(options: FeeIncentiveSubsidyRateOptions)
|
|
|
366
370
|
),
|
|
367
371
|
});
|
|
368
372
|
}
|
|
373
|
+
export interface BuilderFeeCapArguments {
|
|
374
|
+
config?: RawTransactionArgument<string>;
|
|
375
|
+
}
|
|
376
|
+
export interface BuilderFeeCapOptions {
|
|
377
|
+
package?: string;
|
|
378
|
+
arguments?: BuilderFeeCapArguments;
|
|
379
|
+
config?: {
|
|
380
|
+
protocolConfig: ConfigValue;
|
|
381
|
+
predictPackageId?: string;
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Return the builder fee cap: the most a trade's builder fee can charge per
|
|
386
|
+
* contract, in FLOAT_SCALING of a contract's $1 payout. Admission charges a
|
|
387
|
+
* trade's named fee capped at this value. `public` for SDK and devInspect reads,
|
|
388
|
+
* so an app can show the fee a trade will actually pay.
|
|
389
|
+
*/
|
|
390
|
+
export function builderFeeCap(options: BuilderFeeCapOptions) {
|
|
391
|
+
const packageAddress =
|
|
392
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
393
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
394
|
+
const parameterNames = ['config'];
|
|
395
|
+
return (tx: Transaction) =>
|
|
396
|
+
tx.moveCall({
|
|
397
|
+
package: packageAddress,
|
|
398
|
+
module: 'protocol_config',
|
|
399
|
+
function: 'builder_fee_cap',
|
|
400
|
+
arguments: normalizeMoveArguments(
|
|
401
|
+
{
|
|
402
|
+
...options.arguments,
|
|
403
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
404
|
+
},
|
|
405
|
+
argumentsTypes,
|
|
406
|
+
parameterNames,
|
|
407
|
+
),
|
|
408
|
+
});
|
|
409
|
+
}
|
|
369
410
|
export interface FeeIncentiveLiveTargetRateArguments {
|
|
370
411
|
config?: RawTransactionArgument<string>;
|
|
371
412
|
}
|
|
@@ -1704,6 +1745,50 @@ export function setFeeIncentiveSubsidyRate(options: SetFeeIncentiveSubsidyRateOp
|
|
|
1704
1745
|
),
|
|
1705
1746
|
});
|
|
1706
1747
|
}
|
|
1748
|
+
export interface SetBuilderFeeCapArguments {
|
|
1749
|
+
config?: RawTransactionArgument<string>;
|
|
1750
|
+
AdminCap: RawTransactionArgument<string>;
|
|
1751
|
+
cap: RawTransactionArgument<number | bigint>;
|
|
1752
|
+
}
|
|
1753
|
+
export interface SetBuilderFeeCapOptions {
|
|
1754
|
+
package?: string;
|
|
1755
|
+
arguments: SetBuilderFeeCapArguments;
|
|
1756
|
+
config?: {
|
|
1757
|
+
protocolConfig: ConfigValue;
|
|
1758
|
+
predictPackageId?: string;
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Set the builder fee cap: the most a trade's builder fee can charge per contract,
|
|
1763
|
+
* in FLOAT_SCALING of a contract's $1 payout, from `0` up to the whole payout. A
|
|
1764
|
+
* trade that names a higher fee pays the cap. Read when an order is admitted, so
|
|
1765
|
+
* the new cap applies to the next order on every market, and an order already
|
|
1766
|
+
* queued keeps the fee it was admitted with. `0` stops builder fees.
|
|
1767
|
+
*
|
|
1768
|
+
* Not gated on the valuation flag, matching `set_fee_incentive_subsidy_rate`:
|
|
1769
|
+
* nothing in the flush reads the cap, and a builder fee leaves with the trader's
|
|
1770
|
+
* own payment, never market cash.
|
|
1771
|
+
*/
|
|
1772
|
+
export function setBuilderFeeCap(options: SetBuilderFeeCapOptions) {
|
|
1773
|
+
const packageAddress =
|
|
1774
|
+
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
1775
|
+
const argumentsTypes = [null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1776
|
+
const parameterNames = ['config', 'AdminCap', 'cap'];
|
|
1777
|
+
return (tx: Transaction) =>
|
|
1778
|
+
tx.moveCall({
|
|
1779
|
+
package: packageAddress,
|
|
1780
|
+
module: 'protocol_config',
|
|
1781
|
+
function: 'set_builder_fee_cap',
|
|
1782
|
+
arguments: normalizeMoveArguments(
|
|
1783
|
+
{
|
|
1784
|
+
...options.arguments,
|
|
1785
|
+
config: options.arguments?.config ?? options.config?.protocolConfig,
|
|
1786
|
+
},
|
|
1787
|
+
argumentsTypes,
|
|
1788
|
+
parameterNames,
|
|
1789
|
+
),
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1707
1792
|
export interface SetFeeIncentiveLiveTargetRateArguments {
|
|
1708
1793
|
config?: RawTransactionArgument<string>;
|
|
1709
1794
|
AdminCap: RawTransactionArgument<string>;
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
* the settled payout need only the receipt. The queue itself, its escrow, its
|
|
24
24
|
* policy, and its events live in the companion.
|
|
25
25
|
*
|
|
26
|
+
* A trade that pays a builder names its code and fee per contract
|
|
27
|
+
* (`builder_code::BuilderFee`). `admit_mint_with_builder` and
|
|
28
|
+
* `admit_sell_with_builder` cap the fee at `protocol_config::builder_fee_cap` and
|
|
29
|
+
* record the code and the capped fee in the receipt, and the fill charges what the
|
|
30
|
+
* receipt records. The plain admissions name no builder and charge none.
|
|
31
|
+
*
|
|
26
32
|
* Mainnet USDC is a regulated coin: Sui aborts a transaction that sends it to an
|
|
27
33
|
* address on its deny list, or to anyone while it is globally paused. So the fill,
|
|
28
34
|
* the fee routing, and the settled payout read `sui::deny_list` first and never
|
|
@@ -61,10 +67,18 @@ export const OrderReceipt = new MoveStruct({
|
|
|
61
67
|
higher_tick: U64,
|
|
62
68
|
/** The exact mint quantity, or the sell's close quantity. */
|
|
63
69
|
quantity: U64,
|
|
70
|
+
/**
|
|
71
|
+
* A mint's premium cap. A sell never uses it, so a sell admitted with a builder
|
|
72
|
+
* keeps its capped builder fee per contract here.
|
|
73
|
+
*/
|
|
64
74
|
max_premium: U64,
|
|
65
75
|
min_quantity: U64,
|
|
66
76
|
max_probability: U64,
|
|
67
77
|
min_probability: U64,
|
|
78
|
+
/**
|
|
79
|
+
* A sell's proceeds floor. A mint never uses it, so a mint admitted with a builder
|
|
80
|
+
* keeps its capped builder fee per contract here.
|
|
81
|
+
*/
|
|
68
82
|
min_proceeds: U64,
|
|
69
83
|
/** Earliest Pyth generation time the order may price at. */
|
|
70
84
|
tau_ms: U64,
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
* goes through a package-only function here, so no caller outside this package can
|
|
12
12
|
* obtain the witness or reach Predict with it. `release` and `try_pay_settled`
|
|
13
13
|
* need no authority and are called directly.
|
|
14
|
+
*
|
|
15
|
+
* Admission takes an optional `BuilderFee` and passes it to Predict's
|
|
16
|
+
* `_with_builder` admission, which records the code and the capped fee in the
|
|
17
|
+
* receipt for the fill. An order that names none pays no builder fee.
|
|
14
18
|
*/
|
|
15
19
|
|
|
16
20
|
import { MoveTuple } from '../utils/index.js';
|