@mysten/deepbook-v3 2.1.4 → 2.4.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 +70 -0
- package/PREDICT.md +154 -48
- package/README.md +18 -13
- package/dist/account.d.mts.map +1 -1
- package/dist/account.mjs +3 -1
- package/dist/account.mjs.map +1 -1
- package/dist/client.d.mts +2 -2
- package/dist/contracts/account/account.d.mts +23 -23
- package/dist/contracts/account/account.d.mts.map +1 -1
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_registry.d.mts +19 -19
- 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/deps/sui/vec_map.mjs +37 -0
- package/dist/contracts/deepbook_predict/deps/sui/vec_map.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_cash.mjs +1 -1
- package/dist/contracts/deepbook_predict/expiry_cash.mjs.map +1 -1
- 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 +662 -7
- 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 +511 -32
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_accounting.mjs +7 -7
- package/dist/contracts/deepbook_predict/pool_accounting.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 +25 -2
- 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 +37 -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 +458 -2
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/strike_exposure.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +13 -1
- package/dist/contracts/deepbook_predict/strike_payout_tree.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 +38 -8
- 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/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/deployments/index.d.mts +3 -2
- package/dist/deployments/index.d.mts.map +1 -1
- package/dist/deployments/index.mjs +4 -1
- package/dist/deployments/index.mjs.map +1 -1
- package/dist/deployments/mainnet.d.mts +14 -0
- package/dist/deployments/mainnet.d.mts.map +1 -0
- package/dist/deployments/mainnet.mjs +73 -0
- package/dist/deployments/mainnet.mjs.map +1 -0
- package/dist/deployments/testnet.mjs +23 -23
- package/dist/deployments/testnet.mjs.map +1 -1
- package/dist/deployments/types.d.mts +1 -1
- package/dist/predict/client.d.mts +28 -6
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +7 -6
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/config/index.d.mts +2 -0
- package/dist/predict/config/index.d.mts.map +1 -1
- package/dist/predict/config/index.mjs +4 -1
- package/dist/predict/config/index.mjs.map +1 -1
- package/dist/predict/config/mainnet.d.mts +17 -0
- package/dist/predict/config/mainnet.d.mts.map +1 -0
- package/dist/predict/config/mainnet.mjs +26 -0
- package/dist/predict/config/mainnet.mjs.map +1 -0
- package/dist/predict/config/types.d.mts +6 -0
- package/dist/predict/config/types.d.mts.map +1 -1
- package/dist/predict/index.d.mts +21 -2
- package/dist/predict/index.mjs +20 -1
- package/dist/predict/pricing.d.mts +6 -6
- package/dist/predict/pricing.d.mts.map +1 -1
- package/dist/predict/pricing.mjs +6 -6
- package/dist/predict/pricing.mjs.map +1 -1
- package/dist/predict/reads/balances.mjs.map +1 -1
- package/dist/predict/reads/markets.mjs +1 -1
- package/dist/predict/reads/markets.mjs.map +1 -1
- package/dist/predict/reads/pricing.d.mts +2 -1
- package/dist/predict/reads/pricing.d.mts.map +1 -1
- package/dist/predict/reads/pricing.mjs.map +1 -1
- package/dist/sessions.d.mts.map +1 -1
- package/dist/sessions.mjs +3 -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/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/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/package.json +3 -3
- package/src/account.ts +3 -1
- package/src/contracts/deepbook_predict/builder_code.ts +3 -3
- package/src/contracts/deepbook_predict/config_events.ts +9 -2
- package/src/contracts/deepbook_predict/deps/sui/vec_map.ts +33 -0
- package/src/contracts/deepbook_predict/expiry_cash.ts +1 -1
- package/src/contracts/deepbook_predict/expiry_market.ts +70 -11
- package/src/contracts/deepbook_predict/market_lifecycle_cap.ts +3 -10
- package/src/contracts/deepbook_predict/market_manager.ts +2 -2
- package/src/contracts/deepbook_predict/order_events.ts +6 -6
- package/src/contracts/deepbook_predict/plp.ts +263 -81
- package/src/contracts/deepbook_predict/pool_accounting.ts +14 -14
- package/src/contracts/deepbook_predict/pool_valuation_cap.ts +69 -0
- package/src/contracts/deepbook_predict/predict_account.ts +1 -1
- package/src/contracts/deepbook_predict/pricing.ts +16 -4
- package/src/contracts/deepbook_predict/protocol_config.ts +202 -7
- package/src/contracts/deepbook_predict/registry.ts +91 -17
- package/src/contracts/deepbook_predict/strike_exposure.ts +1 -1
- package/src/contracts/deepbook_predict/strike_payout_tree.ts +27 -0
- package/src/contracts/deepbook_predict/vault_events.ts +45 -14
- package/src/contracts/propbook/block_scholes_store.ts +8 -42
- package/src/deployments/index.ts +13 -3
- package/src/deployments/mainnet.ts +107 -0
- package/src/deployments/testnet.ts +25 -25
- package/src/deployments/types.ts +1 -1
- package/src/predict/client.ts +48 -17
- package/src/predict/config/index.ts +7 -2
- package/src/predict/config/mainnet.ts +27 -0
- package/src/predict/config/types.ts +7 -1
- package/src/predict/index.ts +31 -2
- package/src/predict/pricing.ts +11 -9
- package/src/predict/reads/balances.ts +1 -1
- package/src/predict/reads/markets.ts +1 -1
- package/src/predict/reads/pricing.ts +2 -1
- package/src/sessions.ts +4 -1
|
@@ -34,7 +34,13 @@ export interface PredictConfig {
|
|
|
34
34
|
oracleRegistry: string;
|
|
35
35
|
accountRegistry: string;
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The deployment's settlement coin type. Always read this rather than assuming a type:
|
|
39
|
+
* the contracts renamed the collateral to `usdc::usdc::USDC`, but a deployment published
|
|
40
|
+
* before that rename still serves its original coin type, and this field is what the
|
|
41
|
+
* deployment record actually carries.
|
|
42
|
+
*/
|
|
43
|
+
quoteCoinType: string;
|
|
38
44
|
/**
|
|
39
45
|
* Coin types the deployment owns. `plp` is NOT derivable from `packages.predict`: a Move
|
|
40
46
|
* type tag keeps the ORIGINAL package id across an upgrade, while `packages.predict`
|
package/src/predict/index.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// Public API for `@mysten/deepbook-v3/predict`. The curated surface is the `PredictClient`
|
|
4
4
|
// facade plus the value types, unit conversions, tick helpers, typed errors, and typed
|
|
5
|
-
// execution-result decoders — and the few primitives below
|
|
6
|
-
//
|
|
5
|
+
// execution-result decoders — and, for composing your own PTBs, the few primitives below
|
|
6
|
+
// that compose predict accounts with FOREIGN packages plus the generated move-call bindings.
|
|
7
7
|
|
|
8
8
|
// === Facade === (register as a client extension: `client.$extend(predict({ network }))`)
|
|
9
9
|
export { POSITION_LOT_SIZE, PredictClient, predict } from './client.js';
|
|
@@ -16,6 +16,8 @@ export type {
|
|
|
16
16
|
MintAmountOptions,
|
|
17
17
|
MintOptions,
|
|
18
18
|
MintQuote,
|
|
19
|
+
PlpSupplyOptions,
|
|
20
|
+
PlpWithdrawOptions,
|
|
19
21
|
PoolSummary,
|
|
20
22
|
RedeemQuote,
|
|
21
23
|
} from './client.js';
|
|
@@ -28,12 +30,39 @@ export type {
|
|
|
28
30
|
// shared account primitive — reach for its `AccountContract` to drive it directly.
|
|
29
31
|
export { deriveAccountWrapperId, generateAuth } from './tx/common.js';
|
|
30
32
|
|
|
33
|
+
// === Move-call bindings === the generated transaction thunks for every Predict module with a
|
|
34
|
+
// callable function, for putting Predict calls into a PTB you are building — each facade `tx.*`
|
|
35
|
+
// builder returns a finished `Transaction` instead. Mirrors `/account`'s `accountMoveCalls`. Pass
|
|
36
|
+
// `config: toGeneratedConfig(cfg)` and the shared objects fill themselves in; owner-authorized
|
|
37
|
+
// calls take an `Auth` from `generateAuth(cfg)`. Each namespace also carries its module's BCS
|
|
38
|
+
// structs; the `*Events` namespaces are event layouts only.
|
|
39
|
+
export * as adminMoveCalls from '../contracts/deepbook_predict/admin.js';
|
|
40
|
+
export * as builderCodeMoveCalls from '../contracts/deepbook_predict/builder_code.js';
|
|
41
|
+
export * as expiryMarketMoveCalls from '../contracts/deepbook_predict/expiry_market.js';
|
|
42
|
+
export * as marketLifecycleCapMoveCalls from '../contracts/deepbook_predict/market_lifecycle_cap.js';
|
|
43
|
+
export * as marketManagerMoveCalls from '../contracts/deepbook_predict/market_manager.js';
|
|
44
|
+
export * as pauseCapMoveCalls from '../contracts/deepbook_predict/pause_cap.js';
|
|
45
|
+
export * as plpMoveCalls from '../contracts/deepbook_predict/plp.js';
|
|
46
|
+
export * as poolValuationCapMoveCalls from '../contracts/deepbook_predict/pool_valuation_cap.js';
|
|
47
|
+
export * as predictAccountMoveCalls from '../contracts/deepbook_predict/predict_account.js';
|
|
48
|
+
export * as pricingMoveCalls from '../contracts/deepbook_predict/pricing.js';
|
|
49
|
+
export * as protocolConfigMoveCalls from '../contracts/deepbook_predict/protocol_config.js';
|
|
50
|
+
export * as rangeCodecMoveCalls from '../contracts/deepbook_predict/range_codec.js';
|
|
51
|
+
export * as registryMoveCalls from '../contracts/deepbook_predict/registry.js';
|
|
52
|
+
export * as builderCodeEvents from '../contracts/deepbook_predict/builder_code_events.js';
|
|
53
|
+
export * as configEvents from '../contracts/deepbook_predict/config_events.js';
|
|
54
|
+
export * as orderEvents from '../contracts/deepbook_predict/order_events.js';
|
|
55
|
+
export * as vaultEvents from '../contracts/deepbook_predict/vault_events.js';
|
|
56
|
+
|
|
31
57
|
// === Config ===
|
|
32
58
|
export {
|
|
59
|
+
MAINNET_CONFIG,
|
|
33
60
|
TESTNET_CONFIG,
|
|
34
61
|
getConfig,
|
|
35
62
|
getDeployment,
|
|
36
63
|
getUnits,
|
|
64
|
+
MAINNET_DEPLOYMENT,
|
|
65
|
+
MAINNET_UNITS,
|
|
37
66
|
TESTNET_DEPLOYMENT,
|
|
38
67
|
TESTNET_UNITS,
|
|
39
68
|
} from './config/index.js';
|
package/src/predict/pricing.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
// Faithful float port of
|
|
4
|
-
//
|
|
3
|
+
// Faithful float port of `deepbook_predict::pricing::compute_nd2` as of the anchor the
|
|
4
|
+
// generated bindings are pinned to (`sui-codegen.config.ts`: the `deepbook-predict-testnet`
|
|
5
|
+
// deployment). `pricing.move` is untouched across the anchors this SDK has used, so the
|
|
6
|
+
// formula is unchanged from earlier deployments — the SVI-adjusted digital
|
|
5
7
|
// probability, WITH the skew-correction term. It operates on the pricer's
|
|
6
8
|
// ALREADY-RESOLVED forward and ALREADY-ROLLED-DOWN SVI, exactly as `load_live_pricer`
|
|
7
9
|
// returns them (decoded by `reads/pricing.ts`). So the two on-chain steps that pick the
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
// sits at its floor (float64 here is the more precise side, not the less); negligible for
|
|
17
19
|
// display. `tests/testnet/pricing.test.ts` bounds it live against the deployment.
|
|
18
20
|
//
|
|
19
|
-
// The on-chain formula (pricing.move `compute_nd2
|
|
21
|
+
// The on-chain formula (pricing/pricing.move `compute_nd2`):
|
|
20
22
|
// k = ln(strike / forward)
|
|
21
23
|
// x = k - m
|
|
22
24
|
// w = a + b·(ρ·x + √(x² + σ²)) // a, b already rolled down
|
|
@@ -146,12 +148,12 @@ export function strikeAtProbability(inputs: PricerInputs, p: number): number | n
|
|
|
146
148
|
|
|
147
149
|
/** Roll `a` and `b` down by the fraction of anchored time remaining, matching the chain's
|
|
148
150
|
* `roll_down_svi` (variance decays toward expiry). `remainingMs` = expiry − now;
|
|
149
|
-
* `anchorTteMs` = expiry − the SVI observation's **
|
|
150
|
-
* freshness gate
|
|
151
|
-
* (
|
|
152
|
-
* fraction. `read.pricer` avoids the question entirely (the chain
|
|
153
|
-
* `rho`, `m`, `sigma` are unchanged. Feed an UNrolled provider surface;
|
|
154
|
-
* expects. */
|
|
151
|
+
* `anchorTteMs` = expiry − the SVI observation's **provider `svi_timestamp`** (its per-update
|
|
152
|
+
* source timestamp) — the same clock the freshness gate accepts, and what the chain anchors on
|
|
153
|
+
* (`pricing.move`: "One clock serves every job"). Anchoring on the batch's ingestion time
|
|
154
|
+
* instead rolls by the wrong fraction. `read.pricer` avoids the question entirely (the chain
|
|
155
|
+
* has already rolled). `rho`, `m`, `sigma` are unchanged. Feed an UNrolled provider surface;
|
|
156
|
+
* the result is what {@link upProbability} expects. */
|
|
155
157
|
export function rollDown(svi: Svi, remainingMs: number, anchorTteMs: number): Svi {
|
|
156
158
|
const frac = anchorTteMs > 0 ? remainingMs / anchorTteMs : 0;
|
|
157
159
|
return { ...svi, a: svi.a * frac, b: svi.b * frac };
|
|
@@ -9,7 +9,7 @@ import { inspectReturns, type ReadClient } from './inspect.js';
|
|
|
9
9
|
import { parseU64LE } from './parse.js';
|
|
10
10
|
|
|
11
11
|
// An owner's stored account balance for `coinType` (the deployment's quote coin,
|
|
12
|
-
//
|
|
12
|
+
// USDC on testnet, unless the caller asks for another). Chains `account::load_account(wrapper)` →
|
|
13
13
|
// `account::balance<T>(account, root, clock)`; the u64 is command 1's return —
|
|
14
14
|
// see packages/account/sources/account.move:{80,86}. The clock is auto-injected by
|
|
15
15
|
// the generated `balance` wrapper; the wrapper id is derived off-chain (no read).
|
|
@@ -28,7 +28,7 @@ export async function activeMarketIds(
|
|
|
28
28
|
|
|
29
29
|
// The expiry market id for one underlying at one expiry, or null if none exists.
|
|
30
30
|
// `registry::expiry_market_id(registry, propbook_underlying_id: u32, expiry: u64):
|
|
31
|
-
// Option<ID>` — see packages/predict/sources/registry/registry.move:
|
|
31
|
+
// Option<ID>` — see packages/predict/sources/registry/registry.move:58.
|
|
32
32
|
export async function expiryMarketId(
|
|
33
33
|
client: ReadClient,
|
|
34
34
|
config: GeneratedConfig,
|
|
@@ -23,7 +23,8 @@ const i64 = (v: { magnitude: string | number | bigint; is_negative: boolean }):
|
|
|
23
23
|
/** A resolved pricer snapshot read from the chain: the decimal forward + rolled SVI the
|
|
24
24
|
* client-side math consumes, plus the oracle source timestamps behind it (ms; for
|
|
25
25
|
* staleness display — Pyth is 0 when no usable spot existed). The Block-Scholes entries are
|
|
26
|
-
*
|
|
26
|
+
* the provider's PER-UPDATE source timestamps (`value_timestamp` for spot/forward,
|
|
27
|
+
* `svi_timestamp` for SVI) — the clocks freshness and the SVI roll-down anchor on. */
|
|
27
28
|
export interface PricerSnapshot extends PricerInputs {
|
|
28
29
|
sources: {
|
|
29
30
|
pythSpotMs: number;
|
package/src/sessions.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { bcs } from '@mysten/sui/bcs';
|
|
|
4
4
|
import type { Transaction, TransactionArgument, TransactionResult } from '@mysten/sui/transactions';
|
|
5
5
|
import { deriveDynamicFieldID, deriveObjectID } from '@mysten/sui/utils';
|
|
6
6
|
|
|
7
|
+
import { MAINNET_SESSIONS } from './deployments/mainnet.js';
|
|
7
8
|
import { TESTNET_SESSIONS } from './deployments/testnet.js';
|
|
8
9
|
import type { NetworkArg } from './deployments/index.js';
|
|
9
10
|
|
|
@@ -69,9 +70,11 @@ export function getSessionsConfig(
|
|
|
69
70
|
// The frozen record itself, matching `/account` — returning a spread here would have
|
|
70
71
|
// quietly exempted this subpath from the immutability the others guarantee.
|
|
71
72
|
if (network === 'testnet') return TESTNET_SESSIONS;
|
|
73
|
+
if (network === 'mainnet') return MAINNET_SESSIONS;
|
|
72
74
|
throw new Error(
|
|
73
75
|
`@mysten/deepbook-v3/sessions: no sessions deployment recorded for network '${network}'. ` +
|
|
74
|
-
'Sessions is testnet
|
|
76
|
+
'Sessions is recorded for testnet and mainnet; for your own deployment construct a ' +
|
|
77
|
+
'`SessionsConfig` ' +
|
|
75
78
|
'and pass it to SessionsContract directly.',
|
|
76
79
|
);
|
|
77
80
|
}
|