@mysten/deepbook-v3 1.6.7 → 2.0.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 +69 -0
- package/dist/_virtual/rolldown_runtime.mjs +18 -0
- package/dist/client.d.mts +9 -6
- package/dist/client.d.mts.map +1 -1
- package/dist/client.mjs +3 -2
- package/dist/client.mjs.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/balance_manager.mjs.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/pool.mjs.map +1 -1
- package/dist/contracts/deepbook/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/margin_manager.mjs +1 -319
- package/dist/contracts/deepbook_margin/margin_manager.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/margin_manager_upgraded.mjs +386 -0
- package/dist/contracts/deepbook_margin/margin_manager_upgraded.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/margin_pool.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/margin_registry.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/oracle.mjs +9 -0
- package/dist/contracts/deepbook_margin/oracle.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/pool_proxy.mjs +1 -383
- package/dist/contracts/deepbook_margin/pool_proxy.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/pool_proxy_upgraded.mjs +340 -0
- package/dist/contracts/deepbook_margin/pool_proxy_upgraded.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/protocol_config.mjs.map +1 -1
- package/dist/contracts/deepbook_margin/tpsl.mjs.map +1 -1
- package/dist/contracts/margin_liquidation/liquidation_vault.mjs +33 -17
- package/dist/contracts/margin_liquidation/liquidation_vault.mjs.map +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +2 -2
- package/dist/pyth/PriceServiceConnection.d.mts +18 -3
- package/dist/pyth/PriceServiceConnection.d.mts.map +1 -1
- package/dist/pyth/PriceServiceConnection.mjs +35 -4
- package/dist/pyth/PriceServiceConnection.mjs.map +1 -1
- package/dist/queries/priceFeedQueries.mjs +50 -18
- package/dist/queries/priceFeedQueries.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/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginAdmin.d.mts.map +1 -1
- package/dist/transactions/marginAdmin.mjs +2 -2
- package/dist/transactions/marginAdmin.mjs.map +1 -1
- package/dist/transactions/marginLiquidations.d.mts.map +1 -1
- package/dist/transactions/marginLiquidations.mjs +19 -7
- package/dist/transactions/marginLiquidations.mjs.map +1 -1
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginManager.d.mts.map +1 -1
- package/dist/transactions/marginManager.mjs +43 -34
- package/dist/transactions/marginManager.mjs.map +1 -1
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginTPSL.d.mts +10 -10
- package/dist/transactions/marginTPSL.d.mts.map +1 -1
- package/dist/transactions/marginTPSL.mjs +19 -10
- package/dist/transactions/marginTPSL.mjs.map +1 -1
- package/dist/transactions/poolProxy.d.mts +8 -8
- package/dist/transactions/poolProxy.d.mts.map +1 -1
- package/dist/transactions/poolProxy.mjs +34 -27
- package/dist/transactions/poolProxy.mjs.map +1 -1
- package/dist/types/index.d.mts +16 -1
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/config.d.mts +30 -10
- package/dist/utils/config.d.mts.map +1 -1
- package/dist/utils/config.mjs +33 -4
- package/dist/utils/config.mjs.map +1 -1
- package/dist/utils/constants.d.mts +32 -1
- package/dist/utils/constants.d.mts.map +1 -1
- package/dist/utils/constants.mjs +55 -24
- package/dist/utils/constants.mjs.map +1 -1
- package/package.json +10 -10
- package/src/client.ts +9 -1
- package/src/contracts/deepbook/balance_manager.ts +1 -2
- package/src/contracts/deepbook/pool.ts +12 -24
- package/src/contracts/deepbook/registry.ts +1 -2
- package/src/contracts/deepbook_margin/margin_manager.ts +149 -28
- package/src/contracts/deepbook_margin/margin_manager_upgraded.ts +646 -0
- package/src/contracts/deepbook_margin/margin_pool.ts +2 -4
- package/src/contracts/deepbook_margin/margin_registry.ts +3 -6
- package/src/contracts/deepbook_margin/oracle.ts +59 -0
- package/src/contracts/deepbook_margin/pool_proxy.ts +597 -584
- package/src/contracts/deepbook_margin/pool_proxy_upgraded.ts +614 -0
- package/src/contracts/deepbook_margin/protocol_config.ts +1 -2
- package/src/contracts/deepbook_margin/tpsl.ts +1 -2
- package/src/contracts/margin_liquidation/liquidation_vault.ts +144 -4
- package/src/contracts/pyth/pyth.ts +2 -4
- package/src/index.ts +4 -0
- package/src/pyth/PriceServiceConnection.ts +69 -8
- package/src/queries/priceFeedQueries.ts +74 -24
- package/src/transactions/marginAdmin.ts +2 -4
- package/src/transactions/marginLiquidations.ts +20 -6
- package/src/transactions/marginManager.ts +43 -33
- package/src/transactions/marginTPSL.ts +19 -9
- package/src/transactions/poolProxy.ts +34 -30
- package/src/types/index.ts +17 -2
- package/src/utils/config.ts +69 -9
- package/src/utils/constants.ts +83 -26
package/src/utils/constants.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import type { Coin, Pool, MarginPool } from '../types/index.js';
|
|
4
|
+
import type { Coin, Pool, MarginPool, PythConfig } from '../types/index.js';
|
|
5
5
|
|
|
6
6
|
export type CoinMap = Record<string, Coin>;
|
|
7
7
|
export type PoolMap = Record<string, Pool>;
|
|
@@ -20,54 +20,77 @@ export const testnetPackageIds = {
|
|
|
20
20
|
DEEPBOOK_PACKAGE_ID: '0xd874d2417a55bfa6479bffa06ad950fea144ef93a94cc6c49f32b03e386bbb24',
|
|
21
21
|
REGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',
|
|
22
22
|
DEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',
|
|
23
|
-
|
|
23
|
+
// deepbook_margin v16 — the first testnet package carrying the upgraded-Pyth modules.
|
|
24
|
+
MARGIN_PACKAGE_ID: '0xce6ab6290458f597fc078793335f4b1d98479f29ebc02198ae960e9401d0c72f',
|
|
24
25
|
MARGIN_V1: '0xb8620c24c9ea1a4a41e79613d2b3d1d93648d1bb6f6b789a7c8f261c94110e4b',
|
|
25
26
|
MARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',
|
|
26
|
-
|
|
27
|
+
// margin_liquidation v4 — carries liquidate_base_upgraded / liquidate_quote_upgraded.
|
|
28
|
+
LIQUIDATION_PACKAGE_ID: '0x29bccec5261b7d040555a13e98bbc6bef7bad007d62759aac8b71c19916f6476',
|
|
27
29
|
} satisfies DeepbookPackageIds;
|
|
28
30
|
|
|
29
31
|
export const mainnetPackageIds = {
|
|
30
32
|
DEEPBOOK_PACKAGE_ID: '0x0e735f8c93a95722efd73521aca7a7652c0bb71ed1daf41b26dfd7d1ff71f748',
|
|
31
33
|
REGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',
|
|
32
34
|
DEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',
|
|
33
|
-
|
|
35
|
+
// deepbook_margin v7 — the first mainnet package carrying the upgraded-Pyth modules.
|
|
36
|
+
// Its gate constant is `MARGIN_VERSION = 7`, and every entrypoint asserts the registry
|
|
37
|
+
// allows that version, so this id only works once `enable_version(7)` has run on the
|
|
38
|
+
// mainnet MarginRegistry. Until then v7 flows abort `EPackageVersionDisabled`.
|
|
39
|
+
MARGIN_PACKAGE_ID: '0x55ee8099674e46266df2bf0ffed9569e1511aa269f2a9b8c63a2c72f16404e72',
|
|
34
40
|
MARGIN_V1: '0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b',
|
|
35
41
|
MARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',
|
|
36
|
-
LIQUIDATION_PACKAGE_ID: '
|
|
42
|
+
LIQUIDATION_PACKAGE_ID: '0xba2b39c026650fef52038c93c526fc5314a4286318a0d2a7054b65815178fb74',
|
|
37
43
|
} satisfies DeepbookPackageIds;
|
|
38
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Feed ids and price objects on Pyth's upgraded Core, the only deployment this SDK targets.
|
|
47
|
+
*
|
|
48
|
+
* The testnet `MarginRegistry` was migrated (2026-08-11) off Pyth's beta feed ids and onto
|
|
49
|
+
* the ids upgraded testnet Core carries, which are the mainnet-style ids — the beta ids
|
|
50
|
+
* have no upgraded price objects and the upgraded Hermes does not serve them.
|
|
51
|
+
*
|
|
52
|
+
* DBTC is testnet's wrapped BTC and takes Crypto.XBTC/USD — the same feed mainnet XBTC
|
|
53
|
+
* uses. The upgraded deployment carries no distinct DBTC feed. Plain Crypto.BTC/USD is
|
|
54
|
+
* NOT an accepted substitute for either: XBTC is a distinct asset with its own peg and
|
|
55
|
+
* redemption risk, so pricing it off BTC would misstate collateral in exactly the stress
|
|
56
|
+
* where the two diverge.
|
|
57
|
+
*/
|
|
39
58
|
export const testnetCoins: CoinMap = {
|
|
40
59
|
DEEP: {
|
|
41
60
|
address: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,
|
|
42
61
|
type: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,
|
|
43
62
|
scalar: 1000000,
|
|
44
|
-
feed: '
|
|
63
|
+
feed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',
|
|
45
64
|
currencyId: '0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613',
|
|
46
|
-
priceInfoObjectId: '
|
|
65
|
+
priceInfoObjectId: '0x27882b43c2cc62bbd8fb5f4ebc20be004b14454b2c98755033f5446d35474339',
|
|
47
66
|
},
|
|
48
67
|
SUI: {
|
|
49
68
|
address: `0x0000000000000000000000000000000000000000000000000000000000000002`,
|
|
50
69
|
type: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,
|
|
51
70
|
scalar: 1000000000,
|
|
52
|
-
feed: '
|
|
71
|
+
feed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
|
|
53
72
|
currencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',
|
|
54
|
-
priceInfoObjectId: '
|
|
73
|
+
priceInfoObjectId: '0x867877562b5d8ac262d93b02062e04b428a2f9bfbb2f05b8af52e04cd98bd241',
|
|
55
74
|
},
|
|
56
75
|
DBUSDC: {
|
|
57
76
|
address: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,
|
|
58
77
|
type: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,
|
|
59
78
|
scalar: 1000000,
|
|
60
|
-
feed: '
|
|
79
|
+
feed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
|
|
61
80
|
currencyId: '0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784',
|
|
62
|
-
priceInfoObjectId: '
|
|
81
|
+
priceInfoObjectId: '0x17de8d80e8efedfd1053c46fb921e51824479ed32c6aded5f7279995bb84db05',
|
|
63
82
|
},
|
|
64
83
|
DBTC: {
|
|
65
84
|
address: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,
|
|
66
85
|
type: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,
|
|
67
86
|
scalar: 100000000,
|
|
68
|
-
|
|
87
|
+
// Crypto.XBTC/USD — DBTC is testnet's wrapped BTC, so it takes the same feed mainnet
|
|
88
|
+
// XBTC does. Never plain BTC/USD: that is a different asset, and standing it in
|
|
89
|
+
// would misprice DBTC collateral whenever XBTC's peg moves. Object created on
|
|
90
|
+
// upgraded testnet Core 2026-08-11.
|
|
91
|
+
feed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',
|
|
69
92
|
currencyId: '0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f',
|
|
70
|
-
priceInfoObjectId: '
|
|
93
|
+
priceInfoObjectId: '0x88387b85b9a53c4365219aee4d77e62213877f110eb859d8e03812a5bea0d1f7',
|
|
71
94
|
},
|
|
72
95
|
DBUSDT: {
|
|
73
96
|
address: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,
|
|
@@ -88,7 +111,7 @@ export const mainnetCoins: CoinMap = {
|
|
|
88
111
|
scalar: 1000000,
|
|
89
112
|
feed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',
|
|
90
113
|
currencyId: '0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9',
|
|
91
|
-
priceInfoObjectId: '
|
|
114
|
+
priceInfoObjectId: '0x562957f70afaf8a0870e2959abc3e3f327a8159f803d8c56cff27ac2df260477',
|
|
92
115
|
},
|
|
93
116
|
SUI: {
|
|
94
117
|
address: `0x0000000000000000000000000000000000000000000000000000000000000002`,
|
|
@@ -96,7 +119,7 @@ export const mainnetCoins: CoinMap = {
|
|
|
96
119
|
scalar: 1000000000,
|
|
97
120
|
feed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
|
|
98
121
|
currencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',
|
|
99
|
-
priceInfoObjectId: '
|
|
122
|
+
priceInfoObjectId: '0x89b2add829cb6fcd017153fff428bc9faec4d06d643ecfc435af5b55a9e987f0',
|
|
100
123
|
},
|
|
101
124
|
USDC: {
|
|
102
125
|
address: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,
|
|
@@ -104,7 +127,7 @@ export const mainnetCoins: CoinMap = {
|
|
|
104
127
|
scalar: 1000000,
|
|
105
128
|
feed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
|
|
106
129
|
currencyId: '0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a',
|
|
107
|
-
priceInfoObjectId: '
|
|
130
|
+
priceInfoObjectId: '0x6ddfc6f9921e55998cbc2e68f78eba897981d79ac17f66c5277bc38954a2a3f8',
|
|
108
131
|
},
|
|
109
132
|
WAL: {
|
|
110
133
|
address: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,
|
|
@@ -112,7 +135,7 @@ export const mainnetCoins: CoinMap = {
|
|
|
112
135
|
scalar: 1000000000,
|
|
113
136
|
feed: '0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341',
|
|
114
137
|
currencyId: '0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa',
|
|
115
|
-
priceInfoObjectId: '
|
|
138
|
+
priceInfoObjectId: '0xdbea8600eeeb0399df58c28e73b8201ae880a954813131d33bfa6902ccdadd24',
|
|
116
139
|
},
|
|
117
140
|
SUIUSDE: {
|
|
118
141
|
address: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,
|
|
@@ -120,23 +143,37 @@ export const mainnetCoins: CoinMap = {
|
|
|
120
143
|
scalar: 1000000,
|
|
121
144
|
feed: '0x8cead549d0e770dea8fdf5e018a85d59585265cf8bff16ba83962fc7996dbb7f',
|
|
122
145
|
currencyId: '0x44f0959110bd9e5e91af0483364c42075ac19f173b28f708989f419ef3560576',
|
|
123
|
-
priceInfoObjectId: '
|
|
146
|
+
priceInfoObjectId: '0xa8023b552578bd5036be60d3132306882469d1871cb4bec3099c47dece08c4cd',
|
|
124
147
|
},
|
|
125
148
|
XBTC: {
|
|
126
149
|
address: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,
|
|
127
150
|
type: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,
|
|
128
151
|
scalar: 100000000,
|
|
152
|
+
// Crypto.XBTC/USD, always. XBTC must never be priced off Crypto.BTC/USD
|
|
153
|
+
// (`0xe62df6c8…`): it is a distinct asset carrying its own peg and redemption risk,
|
|
154
|
+
// so a BTC substitute misstates collateral precisely when the two diverge. This
|
|
155
|
+
// holds regardless of XBTC's wider confidence band — that is a bound to set on the
|
|
156
|
+
// registry's `max_conf_bps`, not a reason to price a different asset.
|
|
129
157
|
feed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',
|
|
130
158
|
currencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',
|
|
131
|
-
|
|
159
|
+
// Created 2026-08-17 (tx `3SbNisBM…ePnSx`) — XBTC is absent from Pyth's Sui push-feed
|
|
160
|
+
// list, so they never maintained an object for it here; ours is kept fresh by our own
|
|
161
|
+
// price pusher, as on legacy Core. Creation is permissionless, so no admin action was
|
|
162
|
+
// involved. Verified: registered in the upgraded price table and updatable.
|
|
163
|
+
priceInfoObjectId: '0x4f7ff4518b4cf33b162d76e70632d8f0a6e04441a058a138959d7a2384cffe60',
|
|
132
164
|
},
|
|
133
165
|
USDSUI: {
|
|
134
166
|
address: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,
|
|
135
167
|
type: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,
|
|
136
168
|
scalar: 1000000,
|
|
169
|
+
// Valid Pyth data, but margin cannot price USDSUI: the mainnet MarginRegistry's
|
|
170
|
+
// PythConfig configures six currencies and USDSUI is not among them (read on chain
|
|
171
|
+
// 2026-08-11), so an oracle-taking call aborts in the registry's currency lookup
|
|
172
|
+
// before the feed id is ever compared. Lending is unaffected — margin_pool supply
|
|
173
|
+
// and withdraw take no oracle — and no USDSUI DeepBook pool is margin-registered.
|
|
137
174
|
feed: '0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a',
|
|
138
175
|
currencyId: '0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731',
|
|
139
|
-
priceInfoObjectId: '
|
|
176
|
+
priceInfoObjectId: '0x6896ccc8c08a84e47f0ab8affbd3fce2623a72c76f9092e59f8f6ece450119cd',
|
|
140
177
|
},
|
|
141
178
|
WUSDC: {
|
|
142
179
|
address: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,
|
|
@@ -422,11 +459,31 @@ export const mainnetMarginPools = {
|
|
|
422
459
|
};
|
|
423
460
|
|
|
424
461
|
export const testnetPythConfigs = {
|
|
425
|
-
pythStateId: '
|
|
426
|
-
wormholeStateId: '
|
|
427
|
-
};
|
|
462
|
+
pythStateId: '0x3c48fe392912de6c18087a2b3f5fdbfbfdb4598e180947feff1f12f8e9ea073e',
|
|
463
|
+
wormholeStateId: '0x750da8e6d16b6a363a39fe2eaa8295ac224a1e6fce4e47b58845e2e8746164f0',
|
|
464
|
+
} satisfies PythConfig;
|
|
428
465
|
|
|
429
466
|
export const mainnetPythConfigs = {
|
|
430
|
-
pythStateId: '
|
|
431
|
-
wormholeStateId: '
|
|
432
|
-
};
|
|
467
|
+
pythStateId: '0x03719fae774ddab3cfcaa53bbc046f0cbe21410019b6280811bf3f9f4b05839d',
|
|
468
|
+
wormholeStateId: '0xdbca52b9fb4f712e25f61f974586d93ac541bcf8389564f0323bb07215168b5c',
|
|
469
|
+
} satisfies PythConfig;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Hermes serving Pyth's upgraded Core. Requires an `Authorization: Bearer <token>` header
|
|
473
|
+
* and answers 401 without one. Note that from the Core cutover this also becomes true of
|
|
474
|
+
* legacy Hermes, so an unauthenticated price push has no long-term path.
|
|
475
|
+
*/
|
|
476
|
+
export const PYTH_UPGRADED_HERMES = 'https://pyth.dourolabs.app/hermes';
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* DeepBook-operated Hermes proxy: forwards to {@link PYTH_UPGRADED_HERMES} supplying
|
|
480
|
+
* credentials server-side, so consumers without their own Pyth plan can still push price
|
|
481
|
+
* updates. Used only when no `accessToken` is configured — bring your own token and the
|
|
482
|
+
* SDK talks to Pyth directly, with no DeepBook infrastructure in the path.
|
|
483
|
+
*
|
|
484
|
+
* `undefined` until the proxy is deployed. It must stay `undefined` rather than a
|
|
485
|
+
* placeholder URL: it is the default endpoint whenever a consumer supplies no credentials,
|
|
486
|
+
* so a non-resolving value here surfaces as an opaque `Invalid URL`/DNS error from inside
|
|
487
|
+
* axios instead of a configuration error naming the field to set.
|
|
488
|
+
*/
|
|
489
|
+
export const DEEPBOOK_HERMES_PROXY: string | undefined = undefined;
|