@scallop-io/sui-scallop-sdk 1.4.24-alpha.1 → 1.5.0-alpha.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/dist/constants/common.d.ts +4 -4
- package/dist/constants/enum.d.ts +2 -2
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/xoracle.d.ts +2 -0
- package/dist/index.js +580 -685
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +590 -696
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopIndexer.d.ts +1 -0
- package/dist/models/scallopPrice.d.ts +0 -0
- package/dist/models/scallopQuery.d.ts +30 -13
- package/dist/models/scallopUtils.d.ts +2 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +0 -2
- package/dist/queries/coreQuery.d.ts +1 -1
- package/dist/queries/index.d.ts +1 -0
- package/dist/queries/poolAddressesQuery.d.ts +1 -1
- package/dist/queries/portfolioQuery.d.ts +3 -4
- package/dist/queries/priceQuery.d.ts +1 -3
- package/dist/queries/sCoinQuery.d.ts +1 -1
- package/dist/queries/xOracleQuery.d.ts +13 -0
- package/dist/types/address.d.ts +1 -0
- package/dist/types/constant/index.d.ts +1 -0
- package/dist/types/constant/xOracle.d.ts +9 -0
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +11 -25
- package/src/builders/coreBuilder.ts +15 -72
- package/src/builders/oracle.ts +73 -46
- package/src/builders/referralBuilder.ts +9 -20
- package/src/builders/spoolBuilder.ts +10 -38
- package/src/builders/vescaBuilder.ts +11 -26
- package/src/constants/coinGecko.ts +4 -12
- package/src/constants/common.ts +0 -2
- package/src/constants/enum.ts +10 -13
- package/src/constants/index.ts +1 -0
- package/src/constants/poolAddress.ts +343 -218
- package/src/constants/pyth.ts +0 -1
- package/src/constants/testAddress.ts +35 -254
- package/src/constants/xoracle.ts +25 -0
- package/src/models/scallopIndexer.ts +11 -0
- package/src/models/scallopPrice.ts +0 -0
- package/src/models/scallopQuery.ts +58 -13
- package/src/models/scallopUtils.ts +1 -1
- package/src/queries/coreQuery.ts +16 -6
- package/src/queries/index.ts +1 -0
- package/src/queries/poolAddressesQuery.ts +2 -2
- package/src/queries/priceQuery.ts +10 -3
- package/src/queries/vescaQuery.ts +8 -17
- package/src/queries/xOracleQuery.ts +124 -0
- package/src/types/address.ts +1 -0
- package/src/types/constant/index.ts +1 -0
- package/src/types/constant/xOracle.ts +11 -0
- package/src/utils/util.ts +4 -9
package/dist/index.mjs
CHANGED
|
@@ -10,35 +10,26 @@ var DEFAULT_CACHE_OPTIONS = {
|
|
|
10
10
|
|
|
11
11
|
// src/constants/coinGecko.ts
|
|
12
12
|
var COIN_GECKGO_IDS = {
|
|
13
|
-
|
|
13
|
+
usdc: "usdc",
|
|
14
14
|
sbeth: "ethereum",
|
|
15
15
|
sbusdt: "tether",
|
|
16
16
|
sbwbtc: "bitcoin",
|
|
17
|
-
// Wormhole
|
|
18
17
|
weth: "ethereum",
|
|
19
18
|
wbtc: "bitcoin",
|
|
20
19
|
wusdc: "usdc",
|
|
21
20
|
wusdt: "tether",
|
|
21
|
+
sui: "sui",
|
|
22
22
|
wapt: "aptos",
|
|
23
23
|
wsol: "solana",
|
|
24
|
-
|
|
25
|
-
usdc: "usdc",
|
|
26
|
-
// Sui LST
|
|
27
|
-
sui: "sui",
|
|
24
|
+
cetus: "cetus-protocol",
|
|
28
25
|
afsui: "sui",
|
|
29
26
|
hasui: "sui",
|
|
30
27
|
vsui: "sui",
|
|
31
|
-
// Stable
|
|
32
|
-
fdusd: "first-digital-usd",
|
|
33
|
-
// DeFi
|
|
34
|
-
cetus: "cetus-protocol",
|
|
35
28
|
sca: "scallop-2",
|
|
29
|
+
fdusd: "first-digital-usd",
|
|
36
30
|
deep: "deepbook",
|
|
37
|
-
// Isolated Asset
|
|
38
31
|
fud: "fud-the-pug",
|
|
39
|
-
blub: "blub"
|
|
40
|
-
musd: ""
|
|
41
|
-
// @TODO: add coinGecko id
|
|
32
|
+
blub: "blub"
|
|
42
33
|
};
|
|
43
34
|
|
|
44
35
|
// src/constants/common.ts
|
|
@@ -75,8 +66,7 @@ var SUPPORT_POOLS = [
|
|
|
75
66
|
"fud",
|
|
76
67
|
"deep",
|
|
77
68
|
"fdusd",
|
|
78
|
-
"blub"
|
|
79
|
-
"musd"
|
|
69
|
+
"blub"
|
|
80
70
|
];
|
|
81
71
|
var SUPPORT_COLLATERALS = [
|
|
82
72
|
"usdc",
|
|
@@ -131,8 +121,7 @@ var SUPPORT_SCOIN = [
|
|
|
131
121
|
"sdeep",
|
|
132
122
|
"sfud",
|
|
133
123
|
"sfdusd",
|
|
134
|
-
"sblub"
|
|
135
|
-
"smusd"
|
|
124
|
+
"sblub"
|
|
136
125
|
];
|
|
137
126
|
var SUPPORT_SUI_BRIDGE = ["sbeth", "sbusdt", "sbwbtc"];
|
|
138
127
|
var SUPPORT_WORMHOLE = [
|
|
@@ -187,7 +176,6 @@ var coinDecimals = {
|
|
|
187
176
|
deep: 6,
|
|
188
177
|
fud: 5,
|
|
189
178
|
blub: 2,
|
|
190
|
-
musd: 9,
|
|
191
179
|
susdc: 6,
|
|
192
180
|
sweth: 8,
|
|
193
181
|
ssbeth: 8,
|
|
@@ -207,8 +195,7 @@ var coinDecimals = {
|
|
|
207
195
|
sfdusd: 6,
|
|
208
196
|
sdeep: 6,
|
|
209
197
|
sfud: 5,
|
|
210
|
-
sblub: 2
|
|
211
|
-
smusd: 9
|
|
198
|
+
sblub: 2
|
|
212
199
|
};
|
|
213
200
|
var assetCoins = {
|
|
214
201
|
usdc: "usdc",
|
|
@@ -230,8 +217,7 @@ var assetCoins = {
|
|
|
230
217
|
fdusd: "fdusd",
|
|
231
218
|
deep: "deep",
|
|
232
219
|
fud: "fud",
|
|
233
|
-
blub: "blub"
|
|
234
|
-
musd: "musd"
|
|
220
|
+
blub: "blub"
|
|
235
221
|
};
|
|
236
222
|
var marketCoins = {
|
|
237
223
|
susdc: "susdc",
|
|
@@ -253,8 +239,7 @@ var marketCoins = {
|
|
|
253
239
|
sfdusd: "sfdusd",
|
|
254
240
|
sdeep: "sdeep",
|
|
255
241
|
sfud: "sfud",
|
|
256
|
-
sblub: "sblub"
|
|
257
|
-
smusd: "smusd"
|
|
242
|
+
sblub: "sblub"
|
|
258
243
|
};
|
|
259
244
|
var sCoins = {
|
|
260
245
|
susdc: "susdc",
|
|
@@ -275,8 +260,7 @@ var sCoins = {
|
|
|
275
260
|
sfdusd: "sfdusd",
|
|
276
261
|
sfud: "sfud",
|
|
277
262
|
sdeep: "sdeep",
|
|
278
|
-
sblub: "sblub"
|
|
279
|
-
smusd: "smusd"
|
|
263
|
+
sblub: "sblub"
|
|
280
264
|
};
|
|
281
265
|
var stakeMarketCoins = {
|
|
282
266
|
susdc: "susdc",
|
|
@@ -330,8 +314,7 @@ var coinIds = {
|
|
|
330
314
|
// Sui bridge assets
|
|
331
315
|
sbeth: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29",
|
|
332
316
|
sbusdt: "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068",
|
|
333
|
-
sbwbtc: "0xaafb102dd0902f5055cadecd687fb5b71ca82ef0e0285d90afde828ec58ca96b"
|
|
334
|
-
musd: "0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722"
|
|
317
|
+
sbwbtc: "0xaafb102dd0902f5055cadecd687fb5b71ca82ef0e0285d90afde828ec58ca96b"
|
|
335
318
|
};
|
|
336
319
|
var wormholeCoinIds = {
|
|
337
320
|
weth: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5",
|
|
@@ -345,8 +328,10 @@ var voloCoinIds = {
|
|
|
345
328
|
vsui: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55"
|
|
346
329
|
};
|
|
347
330
|
var sCoinIds = {
|
|
348
|
-
ssui:
|
|
349
|
-
|
|
331
|
+
// ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI', // @TODO: restore on prod
|
|
332
|
+
ssui: "0x88618204de2dfdc2597681a8441ee726b0dc13494c41e319c3264eb7b35fea90::scallop_sui::SCALLOP_SUI",
|
|
333
|
+
// ssca: '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA', // @TODO: restore on prod
|
|
334
|
+
ssca: "0x9f64a180373a6b66595025ae16a4ab701f0af1dd5c7ce1ac91dc112e52c2a3f8::scallop_sca::SCALLOP_SCA",
|
|
350
335
|
scetus: "0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS",
|
|
351
336
|
// Wormhole assets
|
|
352
337
|
sweth: "0x67540ceb850d418679e69f1fb6b2093d6df78a2a699ffc733f7646096d552e9b::scallop_wormhole_eth::SCALLOP_WORMHOLE_ETH",
|
|
@@ -357,19 +342,25 @@ var sCoinIds = {
|
|
|
357
342
|
shasui: "0x9a2376943f7d22f88087c259c5889925f332ca4347e669dc37d54c2bf651af3c::scallop_ha_sui::SCALLOP_HA_SUI",
|
|
358
343
|
svsui: "0xe1a1cc6bcf0001a015eab84bcc6713393ce20535f55b8b6f35c142e057a25fbe::scallop_v_sui::SCALLOP_V_SUI",
|
|
359
344
|
// stable coins
|
|
360
|
-
susdc:
|
|
345
|
+
susdc: (
|
|
346
|
+
// '0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC', // @TODO: restore on prod
|
|
347
|
+
"0x55ed015f9f006c0c96ad36ebe3b3570d088e8498f52defea48e5634c110e485c::scallop_usdc::SCALLOP_USDC"
|
|
348
|
+
),
|
|
361
349
|
swusdc: "0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC",
|
|
362
350
|
swusdt: "0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT",
|
|
363
351
|
sfdusd: "0x6711551c1e7652a270d9fbf0eee25d99594c157cde3cb5fbb49035eb59b1b001::scallop_fdusd::SCALLOP_FDUSD",
|
|
364
352
|
// isolated assets
|
|
365
|
-
sdeep:
|
|
366
|
-
|
|
353
|
+
sdeep: (
|
|
354
|
+
// '0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP', // @TODO: restore on prod
|
|
355
|
+
"0x34f0a2e793e1f79ceac72cfe3bb95f65541da449418289ccd12922d16140c882::scallop_deep::SCALLOP_DEEP"
|
|
356
|
+
),
|
|
357
|
+
// sfud: '0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD', // @TODO: restore on prod
|
|
358
|
+
sfud: "0x3b23c05f917052255a0b16a534dbd4446911aa4a30bd3497cdf5b736551e7ef8::scallop_fud::SCALLOP_FUD",
|
|
367
359
|
sblub: "0xe72f65446eabfad2103037af2d49d24599106fb44bf4c046c1e7e9acf6844dd0::scallop_blub::SCALLOP_BLUB",
|
|
368
360
|
// Sui bridge assets
|
|
369
361
|
ssbeth: "0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH",
|
|
370
362
|
ssbusdt: "0xb1d7df34829d1513b73ba17cb7ad90c88d1e104bb65ab8f62f13e0cc103783d3::scallop_sb_usdt::SCALLOP_SB_USDT",
|
|
371
|
-
ssbwbtc: "0x08c0fe357d3a138f4552bee393ce3a28a45bebcca43373d6a90bc44ab76f82e2::scallop_sb_wbtc::SCALLOP_SB_WBTC"
|
|
372
|
-
smusd: "0x0a228d1c59071eccf3716076a1f71216846ee256d9fb07ea11fb7c1eb56435a5::scallop_musd::SCALLOP_MUSD"
|
|
363
|
+
ssbwbtc: "0x08c0fe357d3a138f4552bee393ce3a28a45bebcca43373d6a90bc44ab76f82e2::scallop_sb_wbtc::SCALLOP_SB_WBTC"
|
|
373
364
|
};
|
|
374
365
|
var sCoinTypeToName = Object.entries(sCoinIds).reduce(
|
|
375
366
|
(acc, [coinName, coinType]) => {
|
|
@@ -471,30 +462,54 @@ var POOL_ADDRESSES = {
|
|
|
471
462
|
pythFeedObjectId: "0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2"
|
|
472
463
|
},
|
|
473
464
|
usdc: {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
465
|
+
...{
|
|
466
|
+
coinName: "usdc",
|
|
467
|
+
symbol: "USDC",
|
|
468
|
+
lendingPoolAddress: "0xd3be98bf540f7603eeb550c0c0a19dbfc78822f25158b5fa84ebd9609def415f",
|
|
469
|
+
collateralPoolAddress: "0x8f0d529ba179c5b3d508213003eab813aaae31f78226099639b9a69d1aec17af",
|
|
470
|
+
borrowDynamic: "0x77837ecd4f26fac9a410fff594f2c0bd3288904a15492ca77cb8a52684dbb866",
|
|
471
|
+
interestModel: "0xaae3f179d63009380cbdcb9acb12907afc9c3cb79cc3460be296a9c6d28f3ff3",
|
|
472
|
+
riskModel: "0x198b24db213bfeb8b3c80ae63dde92e32fd24984d25da8233ff777b851edd574",
|
|
473
|
+
borrowFeeKey: "0xd37c5316cfe0a5967d14264fa6b423f880518b294a1ee6581ccbb49ccc401fb8",
|
|
474
|
+
supplyLimitKey: "0x4be9ae54ac4d320f4f9c14cae78cb85c8e0e67791dd9bdba6d2db20614a28a24",
|
|
475
|
+
borrowLimitKey: "0x6b01093cba95b835181f00e3a2c31ed8dfc8d64fe3db0fb80933a09f66e1ccf1",
|
|
476
|
+
spool: "0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918",
|
|
477
|
+
spoolReward: "0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166",
|
|
478
|
+
sCoinTreasury: "0xbe6b63021f3d82e0e7e977cdd718ed7c019cf2eba374b7b546220402452f938e",
|
|
479
|
+
sCoinType: "0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC",
|
|
480
|
+
sCoinName: "susdc",
|
|
481
|
+
sCoinSymbol: "sUSDC",
|
|
482
|
+
coinMetadataId: "0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6",
|
|
483
|
+
coinType: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
484
|
+
sCoinMetadataId: "0x763a21eba338e00bc684aaad80491c89eea5f247b59c47df45b17610c9ad58f2",
|
|
485
|
+
spoolName: "susdc",
|
|
486
|
+
decimals: 6,
|
|
487
|
+
pythFeed: "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
|
|
488
|
+
pythFeedObjectId: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab"
|
|
489
|
+
},
|
|
490
|
+
...{
|
|
491
|
+
coinName: "usdc",
|
|
492
|
+
symbol: "USDC",
|
|
493
|
+
lendingPoolAddress: "0x13319d295914b390b22484373f20f822bca10314c34c227ae6e28df3d9aa8e01",
|
|
494
|
+
collateralPoolAddress: "0x2fdcf63682577f6bfdd4296500067543ba9877d5d5e41ebd9e51b97ab071ce69",
|
|
495
|
+
borrowDynamic: "0x7fd0660f0102789ad039542165c6cbc2d90ba3c1d9dbd4ac4ae8804d80817542",
|
|
496
|
+
interestModel: "0xd4e7b06a79f63706523167f055296db641b0f8ddd6734c05e205f2de0fcefdd0",
|
|
497
|
+
riskModel: "0x19e5993350186f192ffeb2cba0650b04c291390e149c8ac9b324ecf394daaa1a",
|
|
498
|
+
spool: "0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918",
|
|
499
|
+
spoolReward: "0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166",
|
|
500
|
+
sCoinTreasury: "0x6ef82ef94472dcb8c2cdeac8df38874024c08570ca165986ba56d1e38fe0c0a3",
|
|
501
|
+
sCoinType: "0x55ed015f9f006c0c96ad36ebe3b3570d088e8498f52defea48e5634c110e485c::scallop_usdc::SCALLOP_USDC",
|
|
502
|
+
sCoinName: "susdc",
|
|
503
|
+
sCoinSymbol: "sUSDC",
|
|
504
|
+
coinMetadataId: "0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6",
|
|
505
|
+
coinType: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
506
|
+
spoolName: "susdc",
|
|
507
|
+
decimals: 6,
|
|
508
|
+
pythFeed: "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
|
|
509
|
+
pythFeedObjectId: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab"
|
|
510
|
+
}
|
|
497
511
|
},
|
|
512
|
+
// @TODO: restore on prod
|
|
498
513
|
weth: {
|
|
499
514
|
coinName: "weth",
|
|
500
515
|
symbol: "wETH",
|
|
@@ -593,30 +608,54 @@ var POOL_ADDRESSES = {
|
|
|
593
608
|
pythFeedObjectId: "0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572"
|
|
594
609
|
},
|
|
595
610
|
sui: {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
611
|
+
...{
|
|
612
|
+
coinName: "sui",
|
|
613
|
+
symbol: "SUI",
|
|
614
|
+
lendingPoolAddress: "0x9c9077abf7a29eebce41e33addbcd6f5246a5221dd733e56ea0f00ae1b25c9e8",
|
|
615
|
+
collateralPoolAddress: "0x75aacfb7dcbf92ee0111fc1bf975b12569e4ba632e81ed7ae5ac090d40cd3acb",
|
|
616
|
+
borrowDynamic: "0xbf68e6159c99dcaf87717385f1143d2891c2d19663bd51f0bc9b6909e4bb7c27",
|
|
617
|
+
interestModel: "0x0dad9baa89b863c15a0487575de7cc428b01f1aa3998ad7a9e9752d96e83ffa9",
|
|
618
|
+
riskModel: "0xcd6675864690b5648a6e309f2f02a66914b2b2bd9c31936f4e0f7fc0f792bc86",
|
|
619
|
+
borrowFeeKey: "0xda5ede87a05c0677b17511c859b22d0a2b0229ee374d5d7a1274cb836b9fe5f8",
|
|
620
|
+
supplyLimitKey: "0x0602418e66fb7a73fa997077bd66f248ad5b090d43344a14b9f1db598ecc1d47",
|
|
621
|
+
borrowLimitKey: "0x2b33a7efdcf6a6df24f4d8a356dd52f58d75bc023c3f171d99502d4d008b53f0",
|
|
622
|
+
spool: "0x4f0ba970d3c11db05c8f40c64a15b6a33322db3702d634ced6536960ab6f3ee4",
|
|
623
|
+
spoolReward: "0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9",
|
|
624
|
+
sCoinTreasury: "0x5c1678c8261ac9eec024d4d630006a9f55c80dc0b1aa38a003fcb1d425818c6b",
|
|
625
|
+
sCoinType: "0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI",
|
|
626
|
+
sCoinName: "ssui",
|
|
627
|
+
sCoinSymbol: "sSUI",
|
|
628
|
+
coinMetadataId: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
|
|
629
|
+
coinType: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
|
|
630
|
+
sCoinMetadataId: "0xac724644f481f4870ecdc29b9549aa8ea5180f10827c0d97b493f9f65a91455d",
|
|
631
|
+
spoolName: "ssui",
|
|
632
|
+
decimals: 9,
|
|
633
|
+
pythFeed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
634
|
+
pythFeedObjectId: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
635
|
+
},
|
|
636
|
+
...{
|
|
637
|
+
coinName: "sui",
|
|
638
|
+
symbol: "SUI",
|
|
639
|
+
lendingPoolAddress: "0xeb86ad67543c1ac2c4cbaf178d38a45ab27c2e69d60f0f8badd83f563f012c3c",
|
|
640
|
+
collateralPoolAddress: "0xcba7bb07d4d3ce01d81e71d9def680aa8b417347bfd7834aee8fc3b85b61c9a1",
|
|
641
|
+
borrowDynamic: "0xd47c2fd3dbb95ed06e5da92f6b99611ba94a36efa6a13d9b33b02519761cc84e",
|
|
642
|
+
interestModel: "0x4742bb49aa49ab4e5d9dfa119cddc027d1b7811ac42ca1ce794818d4a4da68e7",
|
|
643
|
+
riskModel: "0x6dc356e829cfca2d79f0d68a79b5ddd5296ad0c955a38e2fc397485e2b629367",
|
|
644
|
+
spool: "0xb9617f83c06ebdeac0a8834782b1015e1cc7ea23739e30c132c4bfb95c37a579",
|
|
645
|
+
spoolReward: "0xc3206071a8d43212efb6e3b5504f2321f8df97ab122b466c0bc7cfdf398dc13a",
|
|
646
|
+
sCoinTreasury: "0x03f1d94a40bd9f5d556bacb5c5245732b185572f6a29b36ad8b555d9a8a24f09",
|
|
647
|
+
sCoinType: "0x88618204de2dfdc2597681a8441ee726b0dc13494c41e319c3264eb7b35fea90::scallop_sui::SCALLOP_SUI",
|
|
648
|
+
sCoinName: "ssui",
|
|
649
|
+
sCoinSymbol: "sSUI",
|
|
650
|
+
coinMetadataId: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
|
|
651
|
+
coinType: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
|
|
652
|
+
spoolName: "ssui",
|
|
653
|
+
decimals: 9,
|
|
654
|
+
pythFeed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
655
|
+
pythFeedObjectId: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
656
|
+
}
|
|
619
657
|
},
|
|
658
|
+
// @TODO: restore on prod
|
|
620
659
|
wapt: {
|
|
621
660
|
coinName: "wapt",
|
|
622
661
|
symbol: "wAPT",
|
|
@@ -755,48 +794,88 @@ var POOL_ADDRESSES = {
|
|
|
755
794
|
pythFeedObjectId: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
756
795
|
},
|
|
757
796
|
sca: {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
797
|
+
...{
|
|
798
|
+
coinName: "sca",
|
|
799
|
+
symbol: "SCA",
|
|
800
|
+
lendingPoolAddress: "0x6fc7d4211fc7018b6c75e7b908b88f2e0536443239804a3d32af547637bd28d7",
|
|
801
|
+
collateralPoolAddress: "0xff677a5d9e9dc8f08f0a8681ebfc7481d1c7d57bc441f2881974adcdd7b13c31",
|
|
802
|
+
borrowDynamic: "0x4e24f52edd739dab59ca4c6353ca430b7ce57e7f333abd0957958570a7cd09ca",
|
|
803
|
+
interestModel: "0xbdcd48cf5b1a814911dc2d5c72d393a980c87820199fe5d799289ce94f4c47df",
|
|
804
|
+
riskModel: "0xc437c24b67b8e2676907700fa395af337ad6463d2c0b4f4fa2e9276414026089",
|
|
805
|
+
borrowFeeKey: "0xee55ba0f9800a62d9e7aef667f87e658258f41814d2c9fa02e25590671b4e5ad",
|
|
806
|
+
supplyLimitKey: "0x8dd938856b972a10ea27ecab2af7ed78e48fc5f6ccedaf2b2119959f747dc2e3",
|
|
807
|
+
borrowLimitKey: "0x04c7de61c5b42972f9bf6a8b1848e5fea2d037ee8deba81741ecd4a70aa80d30",
|
|
808
|
+
sCoinTreasury: "0xe04bfc95e00252bd654ee13c08edef9ac5e4b6ae4074e8390db39e9a0109c529",
|
|
809
|
+
sCoinType: "0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA",
|
|
810
|
+
sCoinName: "ssca",
|
|
811
|
+
sCoinSymbol: "sSCA",
|
|
812
|
+
coinMetadataId: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
|
|
813
|
+
coinType: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",
|
|
814
|
+
sCoinMetadataId: "0x27e3877491b308dfac46fb3d9f7dfa6a1e8b7dc3c374e92ecda7976055746964",
|
|
815
|
+
decimals: 9,
|
|
816
|
+
pythFeed: "7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc",
|
|
817
|
+
pythFeedObjectId: "0xf6de1d3279a269a597d813cbaca59aa906543ab9a8c64e84a4722f1a20863985"
|
|
818
|
+
},
|
|
819
|
+
...{
|
|
820
|
+
coinName: "sca",
|
|
821
|
+
symbol: "SCA",
|
|
822
|
+
lendingPoolAddress: "0xd08ef85bc753616ce0f1e3ac01bbc8bd1ee53e03b1e82aaa9690db5cd285ef4c",
|
|
823
|
+
collateralPoolAddress: "0x4f59b8ef2cdd195830890cf0c01e29c159e48a6a6c766c64fd4b26cfa9ee58c6",
|
|
824
|
+
borrowDynamic: "0x7f6e11fbd32b5d0223f03bfda67a5b48c551a09cfff88edc187591f9a4b0ab10",
|
|
825
|
+
interestModel: "0xcb10daf0fee6f416463444f5b47aac0f0197a889bc60be2c4f90916f6a8d2faa",
|
|
826
|
+
riskModel: "0x043f21a35bd1e1060a7c579db46e10cfd039d0b75d6bfd758de97b60434ae708",
|
|
827
|
+
sCoinTreasury: "0x1b05d2cd8b20dba19da073a54195fc52d2f438ea19dea0713bae7a7dab308199",
|
|
828
|
+
sCoinType: "0x9f64a180373a6b66595025ae16a4ab701f0af1dd5c7ce1ac91dc112e52c2a3f8::scallop_sca::SCALLOP_SCA",
|
|
829
|
+
sCoinName: "ssca",
|
|
830
|
+
sCoinSymbol: "sSCA",
|
|
831
|
+
coinMetadataId: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
|
|
832
|
+
coinType: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",
|
|
833
|
+
decimals: 9,
|
|
834
|
+
pythFeed: "7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc",
|
|
835
|
+
pythFeedObjectId: "0xf6de1d3279a269a597d813cbaca59aa906543ab9a8c64e84a4722f1a20863985"
|
|
836
|
+
}
|
|
778
837
|
},
|
|
838
|
+
// @TODO: restore on prod
|
|
779
839
|
fud: {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
840
|
+
...{
|
|
841
|
+
coinName: "fud",
|
|
842
|
+
symbol: "FUD",
|
|
843
|
+
lendingPoolAddress: "0xefed2cbe76b344792ac724523c8b2236740d1cea2100d46a0ed0dc760c7f4231",
|
|
844
|
+
borrowDynamic: "0x14367ddca30e2860cb89ed4eaca20c7ece260c5d59dd9990d2c85a8321326acb",
|
|
845
|
+
interestModel: "0x2600ac100ef154eb2329ffd3aad47aca308ff9f9348de3e8e94aaeb906ec2303",
|
|
846
|
+
borrowFeeKey: "0xa87e8b26e07ff35ac9fb57adcc779be2883080fc7d12de2d9e7e16d8d8d5e529",
|
|
847
|
+
supplyLimitKey: "0xf98419aecc37a3c5de716f8ec590f8991a5be34da72ce1a2da09531ff45adf7d",
|
|
848
|
+
borrowLimitKey: "0x3d928a001c453c50004baa54e14b0a0e1b0907d9c613dfd76064fd7ed4e8beb8",
|
|
849
|
+
isolatedAssetKey: "0xfcb533e9e4e31f9c9f32d6cbf7fbb3425f1d60474e229a363a2dc7f835d587e2",
|
|
850
|
+
sCoinTreasury: "0xf25212f11d182decff7a86165699a73e3d5787aced203ca539f43cfbc10db867",
|
|
851
|
+
sCoinType: "0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD",
|
|
852
|
+
sCoinName: "sfud",
|
|
853
|
+
sCoinSymbol: "sFUD",
|
|
854
|
+
coinMetadataId: "0x01087411ef48aaac1eb6e24803213e3a60a03b147dac930e5e341f17a85e524e",
|
|
855
|
+
coinType: "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
|
|
856
|
+
sCoinMetadataId: "0x4e03390de36b8c84e0a8297d3d0d08a8a34bed93787e37fcb26bfc26df33226c",
|
|
857
|
+
decimals: 5,
|
|
858
|
+
pythFeed: "6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75",
|
|
859
|
+
pythFeedObjectId: "0x4531c3ed0d22f21f5fce882905372006c9aafa30f01db03b789e95a6c50de7b2"
|
|
860
|
+
},
|
|
861
|
+
...{
|
|
862
|
+
coinName: "fud",
|
|
863
|
+
symbol: "FUD",
|
|
864
|
+
lendingPoolAddress: "0xc8a078d15ee7bbff49a14835f36951833d2d55c91ffd2972251dadbff8045ca8",
|
|
865
|
+
borrowDynamic: "0x345a2fa0fe5d5d704fd8ad609a9b7529f22e3cda738ad26756ad2a85e5d43777",
|
|
866
|
+
interestModel: "0xc84a22d8bca58e5f05673d1de2a7406b1b7bc9dcd15fd848ba6555c7ecab9d83",
|
|
867
|
+
sCoinTreasury: "0x858c492d51425b922c040c1a389e185b3b00d565e7d72ead1a81dc733104660d",
|
|
868
|
+
sCoinType: "0x3b23c05f917052255a0b16a534dbd4446911aa4a30bd3497cdf5b736551e7ef8::scallop_fud::SCALLOP_FUD",
|
|
869
|
+
sCoinName: "sfud",
|
|
870
|
+
sCoinSymbol: "sFUD",
|
|
871
|
+
coinMetadataId: "0x01087411ef48aaac1eb6e24803213e3a60a03b147dac930e5e341f17a85e524e",
|
|
872
|
+
coinType: "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
|
|
873
|
+
decimals: 5,
|
|
874
|
+
pythFeed: "6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75",
|
|
875
|
+
pythFeedObjectId: "0x4531c3ed0d22f21f5fce882905372006c9aafa30f01db03b789e95a6c50de7b2"
|
|
876
|
+
}
|
|
799
877
|
},
|
|
878
|
+
// @TODO: restore on prod
|
|
800
879
|
blub: {
|
|
801
880
|
coinName: "blub",
|
|
802
881
|
symbol: "BLUB",
|
|
@@ -817,26 +896,45 @@ var POOL_ADDRESSES = {
|
|
|
817
896
|
pythFeedObjectId: "0x246658c3324f2477568c78cca622518fbc6969a004b841d81409d24a7ec39b18"
|
|
818
897
|
},
|
|
819
898
|
deep: {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
899
|
+
...{
|
|
900
|
+
coinName: "deep",
|
|
901
|
+
symbol: "DEEP",
|
|
902
|
+
lendingPoolAddress: "0xf4a67ffb43da1e1c61c049f188f19463ea8dbbf2d5ef4722d6df854ff1b1cc03",
|
|
903
|
+
borrowDynamic: "0x95e00d7466f97a100e70f08bd37788dc49335796f6f49fab996d40dd0681c6d3",
|
|
904
|
+
interestModel: "0x4143c298506a332d92ea8a995e6f3991ee3215f58f6fc6441752835d275b9a69",
|
|
905
|
+
borrowFeeKey: "0xb14ee43f4ad2a2c40bac8c4406a401690e93c982e289cf3802fedf74a159cab2",
|
|
906
|
+
supplyLimitKey: "0x599528fdfdc253e90dfd0acf4f4a166b391e2aac1ca6528abbff63225b548fee",
|
|
907
|
+
borrowLimitKey: "0xf4217e8ef9d9c32e8992092e910a77535a8124c19b8a762a673f227f5f765a4e",
|
|
908
|
+
isolatedAssetKey: "0x208d3a24ba369dcfc8f0387333d1512b98199eb150d2f2a69359ff708cf761e3",
|
|
909
|
+
sCoinTreasury: "0xc63838fabe37b25ad897392d89876d920f5e0c6a406bf3abcb84753d2829bc88",
|
|
910
|
+
sCoinType: "0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP",
|
|
911
|
+
sCoinName: "sdeep",
|
|
912
|
+
sCoinSymbol: "sDEEP",
|
|
913
|
+
coinMetadataId: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
|
|
914
|
+
coinType: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
|
|
915
|
+
sCoinMetadataId: "0x2443014594a500a9119e11c6c6a86e865834f496c4614280ce8cace33c0b072e",
|
|
916
|
+
decimals: 6,
|
|
917
|
+
pythFeed: "29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
|
|
918
|
+
pythFeedObjectId: "0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed"
|
|
919
|
+
},
|
|
920
|
+
...{
|
|
921
|
+
coinName: "deep",
|
|
922
|
+
symbol: "DEEP",
|
|
923
|
+
lendingPoolAddress: "0xfb8e4f68c9b14034da7f1f4703013dda69ebbb4578f835825bcf92ab89c3b5ae",
|
|
924
|
+
borrowDynamic: "0xbf983b12a8707b174c0b037096ba2fbf1b30e6efb9cce14fc35207de0a696f79",
|
|
925
|
+
interestModel: "0xb7f04cd3aaaefe671a79f9aed8646ae085a7e6812c1604044977c9355e0769c8",
|
|
926
|
+
sCoinTreasury: "0x71d41465cf2d16fa0206126526bebdf65c8871d1fcfbd0c2237db2306afd67ba",
|
|
927
|
+
sCoinType: "0x34f0a2e793e1f79ceac72cfe3bb95f65541da449418289ccd12922d16140c882::scallop_deep::SCALLOP_DEEP",
|
|
928
|
+
sCoinName: "sdeep",
|
|
929
|
+
sCoinSymbol: "sDEEP",
|
|
930
|
+
coinMetadataId: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
|
|
931
|
+
coinType: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
|
|
932
|
+
decimals: 6,
|
|
933
|
+
pythFeed: "29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
|
|
934
|
+
pythFeedObjectId: "0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed"
|
|
935
|
+
}
|
|
839
936
|
},
|
|
937
|
+
// @TODO: restore on prod
|
|
840
938
|
fdusd: {
|
|
841
939
|
coinName: "fdusd",
|
|
842
940
|
symbol: "FDUSD",
|
|
@@ -857,29 +955,6 @@ var POOL_ADDRESSES = {
|
|
|
857
955
|
decimals: 6,
|
|
858
956
|
pythFeed: "0xccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979",
|
|
859
957
|
pythFeedObjectId: "0x5f6583b2b0fe1ecf94aaffeaab8a838794693960cea48c0da282d5f4a24be027"
|
|
860
|
-
},
|
|
861
|
-
// @TODO: add pyth feed
|
|
862
|
-
musd: {
|
|
863
|
-
coinName: "musd",
|
|
864
|
-
symbol: "mUSD",
|
|
865
|
-
lendingPoolAddress: "0x0565254220e7ca857a87341898bdebeb9e5d6f8f8fe68eb25dd3e257d41a0b0c",
|
|
866
|
-
collateralPoolAddress: void 0,
|
|
867
|
-
borrowDynamic: "0x9448dc2ae8054d5b735fd617fb4ca57046ddc98bfff91ce31de1df452f3bf695",
|
|
868
|
-
interestModel: "0xc3b57c57814e22ac42c7062922a0437ebf40495e37aee32cbb94cba0693970ed",
|
|
869
|
-
riskModel: void 0,
|
|
870
|
-
borrowFeeKey: "0xfdb02d76dc67553fd15f42f1de49ca79cd2812bdaf8bcd079cfe17ce23ed9fc4",
|
|
871
|
-
supplyLimitKey: "0x340aaae070f9489b59c4257610babf6f170abf43fbe51cf7de1e2e04492f6823",
|
|
872
|
-
isolatedAssetKey: "0xe10f03b13d2cdb46543130bafaf1884c9a5a7712b5932aae15b2f8d4fc31a774",
|
|
873
|
-
sCoinTreasury: "0xadfd554635ccc87e992f23ca838f0f16c14874e324a1b79b77f6bfe118edea9f",
|
|
874
|
-
sCoinType: "0x0a228d1c59071eccf3716076a1f71216846ee256d9fb07ea11fb7c1eb56435a5::scallop_musd::SCALLOP_MUSD",
|
|
875
|
-
sCoinName: "smusd",
|
|
876
|
-
sCoinSymbol: "smUSD",
|
|
877
|
-
coinMetadataId: "0xc154abd271b24032a2c80d96c1b82109490bb600ed189ef881d8c9467ed44a4f",
|
|
878
|
-
coinType: "0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD",
|
|
879
|
-
sCoinMetadataId: "0xb924f8c3d4b993172d4fc553c1ea242e8ca539e83edc3edaf5512ae44dfa6863",
|
|
880
|
-
decimals: 0,
|
|
881
|
-
pythFeed: "",
|
|
882
|
-
pythFeedObjectId: ""
|
|
883
958
|
}
|
|
884
959
|
};
|
|
885
960
|
|
|
@@ -908,9 +983,7 @@ var PYTH_FEED_IDS = {
|
|
|
908
983
|
fdusd: "0xccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979",
|
|
909
984
|
deep: "29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
|
|
910
985
|
fud: "6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75",
|
|
911
|
-
blub: "5fc11ffe4975b624be495be038da30e30bee2004d8ae6282b5364577ef4ca92c"
|
|
912
|
-
musd: ""
|
|
913
|
-
// @TODO: add mUSD pyth
|
|
986
|
+
blub: "5fc11ffe4975b624be495be038da30e30bee2004d8ae6282b5364577ef4ca92c"
|
|
914
987
|
};
|
|
915
988
|
|
|
916
989
|
// src/constants/queryKeys.ts
|
|
@@ -1018,21 +1091,13 @@ var RPC_PROVIDERS = [
|
|
|
1018
1091
|
// src/constants/testAddress.ts
|
|
1019
1092
|
var TEST_ADDRESSES = {
|
|
1020
1093
|
core: {
|
|
1021
|
-
|
|
1022
|
-
// '0x07871c4b3c847a0f674510d4978d5cf6f960452795e8ff6f189fd2088a3f6ac7',
|
|
1023
|
-
version: "0xd318de9b0f6873879a82cbfcc2daa1d1591a8b54e7cea9f4b567da63c692a52b",
|
|
1094
|
+
version: "0xee15d07800e2ad4852505c57cd86afea774af02c17388f8bd907de75f915b4f4",
|
|
1024
1095
|
versionCap: "0x590a4011cb649b3878f3ea14b3a78674642a9548d79b7e091ef679574b158a07",
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
object: "0x6c23585e940a989588432509107e98bae06dbca4e333f26d0635d401b3c7c76d",
|
|
1028
|
-
// market:
|
|
1029
|
-
// '0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9',
|
|
1030
|
-
market: "0x9d6434e97f3f98fd9b0c0e1dca22632073985abcd22541feae7ee1e34cbe3af2",
|
|
1096
|
+
object: "0xb03fa00e2d9f17d78a9d48bd94d8852abec68c19d55e819096b1e062e69bfad1",
|
|
1097
|
+
market: "0xa7f41efe3b551c20ad6d6cea6ccd0fd68d2e2eaaacdca5e62d956209f6a51312",
|
|
1031
1098
|
adminCap: "0x09689d018e71c337d9db6d67cbca06b74ed92196103624028ccc3ecea411777c",
|
|
1032
1099
|
coinDecimalsRegistry: "0x200abe9bf19751cc566ae35aa58e2b7e4ff688fc1130f8d8909ea09bc137d668",
|
|
1033
|
-
|
|
1034
|
-
// '0x733e30b7c94d619d78cb8f5bc4bfbb759ced9a531239028caabb2474e5be59c9',
|
|
1035
|
-
obligationAccessStore: "0x46e9b44a77ee9c9d33cc2689ecdfbb8f681935cbc6bdf6ac3df048e396c36c82",
|
|
1100
|
+
obligationAccessStore: "0xb7d7e1464936fbdcdd4913308b40335e662401029635289bdb317c7dde9d6c68",
|
|
1036
1101
|
coins: {
|
|
1037
1102
|
usdc: {
|
|
1038
1103
|
id: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7",
|
|
@@ -1047,97 +1112,6 @@ var TEST_ADDRESSES = {
|
|
|
1047
1112
|
}
|
|
1048
1113
|
}
|
|
1049
1114
|
},
|
|
1050
|
-
cetus: {
|
|
1051
|
-
id: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b",
|
|
1052
|
-
metaData: "0x4c0dce55eff2db5419bbd2d239d1aa22b4a400c01bbb648b058a9883989025da",
|
|
1053
|
-
treasury: "",
|
|
1054
|
-
oracle: {
|
|
1055
|
-
supra: "",
|
|
1056
|
-
switchboard: "",
|
|
1057
|
-
pyth: {
|
|
1058
|
-
feed: "e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef",
|
|
1059
|
-
feedObject: "0x24c0247fb22457a719efac7f670cdc79be321b521460bd6bd2ccfa9f80713b14"
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
},
|
|
1063
|
-
wapt: {
|
|
1064
|
-
id: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37",
|
|
1065
|
-
metaData: "0xc969c5251f372c0f34c32759f1d315cf1ea0ee5e4454b52aea08778eacfdd0a8",
|
|
1066
|
-
treasury: "",
|
|
1067
|
-
oracle: {
|
|
1068
|
-
supra: "",
|
|
1069
|
-
switchboard: "",
|
|
1070
|
-
pyth: {
|
|
1071
|
-
feed: "03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5",
|
|
1072
|
-
feedObject: "0x7c5b7837c44a69b469325463ac0673ac1aa8435ff44ddb4191c9ae380463647f"
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
},
|
|
1076
|
-
wsol: {
|
|
1077
|
-
id: "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8",
|
|
1078
|
-
metaData: "0x4d2c39082b4477e3e79dc4562d939147ab90c42fc5f3e4acf03b94383cd69b6e",
|
|
1079
|
-
treasury: "",
|
|
1080
|
-
oracle: {
|
|
1081
|
-
supra: "",
|
|
1082
|
-
switchboard: "",
|
|
1083
|
-
pyth: {
|
|
1084
|
-
feed: "ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d",
|
|
1085
|
-
feedObject: "0x9d0d275efbd37d8a8855f6f2c761fa5983293dd8ce202ee5196626de8fcd4469"
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
},
|
|
1089
|
-
wbtc: {
|
|
1090
|
-
id: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881",
|
|
1091
|
-
metaData: "0x5d3c6e60eeff8a05b693b481539e7847dfe33013e7070cdcb387f5c0cac05dfd",
|
|
1092
|
-
treasury: "",
|
|
1093
|
-
oracle: {
|
|
1094
|
-
supra: "",
|
|
1095
|
-
switchboard: "",
|
|
1096
|
-
pyth: {
|
|
1097
|
-
feed: "e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
|
|
1098
|
-
feedObject: "0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2"
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
},
|
|
1102
|
-
weth: {
|
|
1103
|
-
id: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5",
|
|
1104
|
-
metaData: "0x8900e4ceede3363bef086d6b50ca89d816d0e90bf6bc46efefe1f8455e08f50f",
|
|
1105
|
-
treasury: "",
|
|
1106
|
-
oracle: {
|
|
1107
|
-
supra: "",
|
|
1108
|
-
switchboard: "",
|
|
1109
|
-
pyth: {
|
|
1110
|
-
feed: "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
|
|
1111
|
-
feedObject: "0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab"
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
},
|
|
1115
|
-
wusdc: {
|
|
1116
|
-
id: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf",
|
|
1117
|
-
metaData: "0x4fbf84f3029bd0c0b77164b587963be957f853eccf834a67bb9ecba6ec80f189",
|
|
1118
|
-
treasury: "",
|
|
1119
|
-
oracle: {
|
|
1120
|
-
supra: "",
|
|
1121
|
-
switchboard: "",
|
|
1122
|
-
pyth: {
|
|
1123
|
-
feed: "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
|
|
1124
|
-
feedObject: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab"
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
},
|
|
1128
|
-
wusdt: {
|
|
1129
|
-
id: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c",
|
|
1130
|
-
metaData: "0xfb0e3eb97dd158a5ae979dddfa24348063843c5b20eb8381dd5fa7c93699e45c",
|
|
1131
|
-
treasury: "",
|
|
1132
|
-
oracle: {
|
|
1133
|
-
supra: "",
|
|
1134
|
-
switchboard: "",
|
|
1135
|
-
pyth: {
|
|
1136
|
-
feed: "2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
|
|
1137
|
-
feedObject: "0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572"
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
},
|
|
1141
1115
|
sui: {
|
|
1142
1116
|
id: "0x0000000000000000000000000000000000000000000000000000000000000002",
|
|
1143
1117
|
metaData: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
|
|
@@ -1151,45 +1125,6 @@ var TEST_ADDRESSES = {
|
|
|
1151
1125
|
}
|
|
1152
1126
|
}
|
|
1153
1127
|
},
|
|
1154
|
-
afsui: {
|
|
1155
|
-
id: "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc",
|
|
1156
|
-
metaData: "0x2f9217f533e51334873a39b8026a4aa6919497b47f49d0986a4f1aec66f8a34d",
|
|
1157
|
-
treasury: "",
|
|
1158
|
-
oracle: {
|
|
1159
|
-
supra: "",
|
|
1160
|
-
switchboard: "",
|
|
1161
|
-
pyth: {
|
|
1162
|
-
feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
1163
|
-
feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
},
|
|
1167
|
-
hasui: {
|
|
1168
|
-
id: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d",
|
|
1169
|
-
metaData: "0x2c5f33af93f6511df699aaaa5822d823aac6ed99d4a0de2a4a50b3afa0172e24",
|
|
1170
|
-
treasury: "",
|
|
1171
|
-
oracle: {
|
|
1172
|
-
supra: "",
|
|
1173
|
-
switchboard: "",
|
|
1174
|
-
pyth: {
|
|
1175
|
-
feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
1176
|
-
feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
},
|
|
1180
|
-
vsui: {
|
|
1181
|
-
id: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55",
|
|
1182
|
-
metaData: "0xabd84a23467b33854ab25cf862006fd97479f8f6f53e50fe732c43a274d939bd",
|
|
1183
|
-
treasury: "",
|
|
1184
|
-
oracle: {
|
|
1185
|
-
supra: "",
|
|
1186
|
-
switchboard: "",
|
|
1187
|
-
pyth: {
|
|
1188
|
-
feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
1189
|
-
feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
},
|
|
1193
1128
|
sca: {
|
|
1194
1129
|
id: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6",
|
|
1195
1130
|
metaData: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
|
|
@@ -1203,41 +1138,6 @@ var TEST_ADDRESSES = {
|
|
|
1203
1138
|
}
|
|
1204
1139
|
}
|
|
1205
1140
|
},
|
|
1206
|
-
sbeth: {
|
|
1207
|
-
id: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29",
|
|
1208
|
-
metaData: "0x89b04ba87f8832d4d76e17a1c9dce72eb3e64d372cf02012b8d2de5384faeef0",
|
|
1209
|
-
treasury: "",
|
|
1210
|
-
oracle: {
|
|
1211
|
-
supra: "",
|
|
1212
|
-
switchboard: "",
|
|
1213
|
-
pyth: {
|
|
1214
|
-
feed: "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
|
|
1215
|
-
feedObject: "0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab"
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
},
|
|
1219
|
-
// @TODO: add test address
|
|
1220
|
-
// @ts-ignore
|
|
1221
|
-
sbusdt: {},
|
|
1222
|
-
// @ts-ignore
|
|
1223
|
-
sbwbtc: {},
|
|
1224
|
-
// @ts-ignore
|
|
1225
|
-
blub: {},
|
|
1226
|
-
// @ts-ignore
|
|
1227
|
-
musd: {},
|
|
1228
|
-
fdusd: {
|
|
1229
|
-
id: "0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a",
|
|
1230
|
-
metaData: "0xdebee5265a67c186ed87fe93303d33dfe1de53e3b4fd7d9329c2852860acd3e7",
|
|
1231
|
-
treasury: "",
|
|
1232
|
-
oracle: {
|
|
1233
|
-
supra: "",
|
|
1234
|
-
switchboard: "",
|
|
1235
|
-
pyth: {
|
|
1236
|
-
feed: "0xccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979",
|
|
1237
|
-
feedObject: "0x5f6583b2b0fe1ecf94aaffeaab8a838794693960cea48c0da282d5f4a24be027"
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
},
|
|
1241
1141
|
deep: {
|
|
1242
1142
|
id: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270",
|
|
1243
1143
|
metaData: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
|
|
@@ -1266,12 +1166,12 @@ var TEST_ADDRESSES = {
|
|
|
1266
1166
|
}
|
|
1267
1167
|
},
|
|
1268
1168
|
oracles: {
|
|
1269
|
-
xOracle: "
|
|
1169
|
+
xOracle: "0x0c09daac413e834f2fe69601c41e836022fa9a185df6b56a80f6bcd8a3ecb8a2",
|
|
1270
1170
|
xOracleCap: "0x1edeae568fde99e090dbdec4bcdbd33a15f53a1ce1f87aeef1a560dedf4b4a90",
|
|
1271
1171
|
supra: { registry: "", registryCap: "", holder: "" },
|
|
1272
1172
|
switchboard: { registry: "", registryCap: "" },
|
|
1273
1173
|
pyth: {
|
|
1274
|
-
registry: "
|
|
1174
|
+
registry: "0xdcf813893649521abd27816ba8d946b0cb7fc98d776cc9adcecba54688ccc109",
|
|
1275
1175
|
registryCap: "0xbcb07141eb1f7e01fbda4130ecf5f5adaeabb77f5d9c32158b7532bcd2197acd",
|
|
1276
1176
|
state: "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8",
|
|
1277
1177
|
wormhole: "0x5306f64e312b581766351c07af79c72fcb1cd25147157fdc2f8ad76de9a3fb6a",
|
|
@@ -1296,46 +1196,36 @@ var TEST_ADDRESSES = {
|
|
|
1296
1196
|
upgradeCap: "0x3f203f6fff6a69d151e4f1cd931f22b68c489ef2759765662fc7baf673943c9e"
|
|
1297
1197
|
},
|
|
1298
1198
|
protocol: {
|
|
1299
|
-
id: "
|
|
1199
|
+
id: "0xb03fa00e2d9f17d78a9d48bd94d8852abec68c19d55e819096b1e062e69bfad1",
|
|
1300
1200
|
upgradeCap: "0x38527d154618d1fd5a644b90717fe07cf0e9f26b46b63e9568e611a3f86d5c1a"
|
|
1301
1201
|
},
|
|
1302
|
-
// protocol: {
|
|
1303
|
-
// id: '0x6e641f0dca8aedab3101d047e96439178f16301bf0b57fe8745086ff1195eb3e',
|
|
1304
|
-
// upgradeCap:
|
|
1305
|
-
// '0x38527d154618d1fd5a644b90717fe07cf0e9f26b46b63e9568e611a3f86d5c1a',
|
|
1306
|
-
// },
|
|
1307
1202
|
protocolWhitelist: {
|
|
1308
1203
|
id: "0x4c262d9343dac53ecb28f482a2a3f62c73d0ebac5b5f03d57383d56ff219acdf",
|
|
1309
1204
|
upgradeCap: "0x4a5e88a75039b00988f633f811f58117f31b8627a46bf822aa114d9010049449"
|
|
1310
1205
|
},
|
|
1311
|
-
// query: {
|
|
1312
|
-
// id: '0xb8d603a39114a5efef3dd0bf84df0bed1be1fbd39b78b7dd6e8a61ccc5e6006f',
|
|
1313
|
-
// upgradeCap:
|
|
1314
|
-
// '0x0d535c35f608b9b01b7ccce11acf43b1dd80c1b72bf8b541744a6e28e8d2745f',
|
|
1315
|
-
// },
|
|
1316
1206
|
query: {
|
|
1317
|
-
id: "
|
|
1207
|
+
id: "0x3a0dbce719fc56a96bf8e8dd53cd57eb9c313642a88d99b86f51208762eba258",
|
|
1208
|
+
object: "",
|
|
1318
1209
|
upgradeCap: "0x0d535c35f608b9b01b7ccce11acf43b1dd80c1b72bf8b541744a6e28e8d2745f"
|
|
1319
1210
|
},
|
|
1320
|
-
supra: { id: "", upgradeCap: "" },
|
|
1211
|
+
supra: { id: "", object: "", upgradeCap: "" },
|
|
1321
1212
|
pyth: {
|
|
1322
|
-
id: "
|
|
1213
|
+
id: "0xe622909f9252d4ef1737c41ea430ef44203d8f5dc8e01e1b3950a31405bc54eb",
|
|
1214
|
+
object: "0xe622909f9252d4ef1737c41ea430ef44203d8f5dc8e01e1b3950a31405bc54eb",
|
|
1323
1215
|
upgradeCap: "0xdf0ffbae1ea5bb25fbca5efba433dcf00c7cced65679af2f04728901275c6157"
|
|
1324
1216
|
},
|
|
1325
1217
|
switchboard: { id: "", upgradeCap: "" },
|
|
1326
1218
|
xOracle: {
|
|
1327
|
-
id: "
|
|
1219
|
+
id: "0xe7511600c924f1d0ac4b3fa5de3ae26b8845545902b015dc5fc7894307365d7b",
|
|
1220
|
+
object: "0xe7511600c924f1d0ac4b3fa5de3ae26b8845545902b015dc5fc7894307365d7b",
|
|
1328
1221
|
upgradeCap: "0x0f928a6b2e26b73330fecaf9b44acfc9800a4a9794d6415c2a3153bc70e3c1f0"
|
|
1329
1222
|
},
|
|
1330
1223
|
testCoin: { id: "", upgradeCap: "" }
|
|
1331
1224
|
}
|
|
1332
1225
|
},
|
|
1333
1226
|
spool: {
|
|
1334
|
-
// id: '0x7c4fdabe81c31b19a45d1e572a52a539997a90903fbb5bfab71480abe0fa62c3',
|
|
1335
1227
|
id: "0x1742655fe5872dfa6456673f9e38612a4965e6979e6cd7696a7f1225f28bae21",
|
|
1336
1228
|
adminCap: "0xdd8a047cbbf802bfcde5288b8ef1910965d789cc614da11d39af05fca0bd020a",
|
|
1337
|
-
// object:
|
|
1338
|
-
// '0xe87f1b2d498106a2c61421cec75b7b5c5e348512b0dc263949a0e7a3c256571a',
|
|
1339
1229
|
object: "0x1742655fe5872dfa6456673f9e38612a4965e6979e6cd7696a7f1225f28bae21",
|
|
1340
1230
|
pools: {
|
|
1341
1231
|
sweth: {
|
|
@@ -1343,72 +1233,48 @@ var TEST_ADDRESSES = {
|
|
|
1343
1233
|
rewardPoolId: "0x957de68a18d87817de8309b30c1ec269a4d87ae513abbeed86b5619cb9ce1077"
|
|
1344
1234
|
},
|
|
1345
1235
|
ssui: {
|
|
1346
|
-
// id: '0x4f0ba970d3c11db05c8f40c64a15b6a33322db3702d634ced6536960ab6f3ee4',
|
|
1347
1236
|
id: "0xb9617f83c06ebdeac0a8834782b1015e1cc7ea23739e30c132c4bfb95c37a579",
|
|
1348
|
-
rewardPoolId:
|
|
1349
|
-
// '0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9',
|
|
1350
|
-
"0xc3206071a8d43212efb6e3b5504f2321f8df97ab122b466c0bc7cfdf398dc13a"
|
|
1351
|
-
)
|
|
1237
|
+
rewardPoolId: "0xc3206071a8d43212efb6e3b5504f2321f8df97ab122b466c0bc7cfdf398dc13a"
|
|
1352
1238
|
},
|
|
1353
1239
|
susdc: {
|
|
1354
1240
|
id: "0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918",
|
|
1355
1241
|
rewardPoolId: "0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166"
|
|
1356
1242
|
},
|
|
1357
1243
|
swusdc: {
|
|
1358
|
-
// id: '0x4ace6648ddc64e646ba47a957c562c32c9599b3bba8f5ac1aadb2ae23a2f8ca0',
|
|
1359
1244
|
id: "0xf1b383b9cf2e9f515fc69567df1053098f273849d09cd84b0278a773429bd2b2",
|
|
1360
|
-
rewardPoolId:
|
|
1361
|
-
// '0xf4268cc9b9413b9bfe09e8966b8de650494c9e5784bf0930759cfef4904daff8',
|
|
1362
|
-
"0xc71c53ee6505d928ba15bea4fe4f45d98c9c31eced94b72d00a7827d4b7ba3ff"
|
|
1363
|
-
)
|
|
1245
|
+
rewardPoolId: "0xc71c53ee6505d928ba15bea4fe4f45d98c9c31eced94b72d00a7827d4b7ba3ff"
|
|
1364
1246
|
},
|
|
1365
1247
|
swusdt: {
|
|
1366
|
-
// id: '0xcb328f7ffa7f9342ed85af3fdb2f22919e1a06dfb2f713c04c73543870d7548f',
|
|
1367
1248
|
id: "0xb5567dfa5c7fc17a249e959732664c50713dd8c23db1a11376b27df800c17418",
|
|
1368
|
-
rewardPoolId:
|
|
1369
|
-
// '0x2c9f934d67a5baa586ceec2cc24163a2f049a6af3d5ba36b84d8ac40f25c4080',
|
|
1370
|
-
"0x60768b0687ff0235e376a039709a683e4c436098785e473b67b32dbab47b69ab"
|
|
1371
|
-
)
|
|
1249
|
+
rewardPoolId: "0x60768b0687ff0235e376a039709a683e4c436098785e473b67b32dbab47b69ab"
|
|
1372
1250
|
},
|
|
1373
1251
|
scetus: {
|
|
1374
1252
|
id: "0xac1bb13bf4472a637c18c2415fb0e3c1227ea2bcf35242e50563c98215bd298e",
|
|
1375
1253
|
rewardPoolId: "0x6835c1224126a45086fc6406adc249e3f30df18d779ca4f4e570e38716a17f3f"
|
|
1376
1254
|
},
|
|
1377
1255
|
safsui: {
|
|
1378
|
-
// id: '0xeedf438abcaa6ce4d9625ffca110920592d5867e4c5637d84ad9f466c4feb800',
|
|
1379
1256
|
id: "0xc568bb4c991258e839aa54802ecda04fcd9838c826bc3b42b40af81b23c458c8",
|
|
1380
|
-
rewardPoolId:
|
|
1381
|
-
// '0x89255a2f86ed7fbfef35ab8b7be48cc7667015975be2685dd9a55a9a64baf76e',
|
|
1382
|
-
"0x389a3cbeda742b918941bb24fd00e077bad3367484394d6234f8209b9a6aa03d"
|
|
1383
|
-
)
|
|
1257
|
+
rewardPoolId: "0x389a3cbeda742b918941bb24fd00e077bad3367484394d6234f8209b9a6aa03d"
|
|
1384
1258
|
},
|
|
1385
1259
|
shasui: {
|
|
1386
|
-
// id: '0xa6148bc1b623e936d39a952ceb5bea79e8b37228a8f595067bf1852efd3c34aa',
|
|
1387
1260
|
id: "0x93f3f4499bf89f2d05ddc1f8b15f51701a7c6c4d0ac0b9c3bc99462cbbd8e321",
|
|
1388
|
-
rewardPoolId:
|
|
1389
|
-
// '0x6f3563644d3e2ef13176dbf9d865bd93479df60ccbe07b7e66db57f6309f5a66',
|
|
1390
|
-
"0x94cee1be7f5ff34193f3aabef0b14142cb28af4d905fe487a9a7d85a15edb6aa"
|
|
1391
|
-
)
|
|
1261
|
+
rewardPoolId: "0x94cee1be7f5ff34193f3aabef0b14142cb28af4d905fe487a9a7d85a15edb6aa"
|
|
1392
1262
|
},
|
|
1393
1263
|
svsui: {
|
|
1394
|
-
// id: '0x69ce8e537e750a95381e6040794afa5ab1758353a1a2e1de7760391b01f91670',
|
|
1395
1264
|
id: "0xa970e9087f80cb59e9299b8e7af7175d977ad6c9af0322aa4440e138fbd7ae00",
|
|
1396
|
-
rewardPoolId:
|
|
1397
|
-
// '0xbca914adce058ad0902c7f3cfcd698392a475f00dcfdc3f76001d0370b98777a',
|
|
1398
|
-
"0x38eee9699c4fc132a6623e54b865f047df4fc6eb83af807300f44e8f4b235ff0"
|
|
1399
|
-
)
|
|
1265
|
+
rewardPoolId: "0x38eee9699c4fc132a6623e54b865f047df4fc6eb83af807300f44e8f4b235ff0"
|
|
1400
1266
|
}
|
|
1401
1267
|
},
|
|
1402
1268
|
config: ""
|
|
1403
1269
|
},
|
|
1404
1270
|
borrowIncentive: {
|
|
1405
|
-
id: "
|
|
1271
|
+
id: "0x8fe05c796e779c71e7739dcaecefb8757ff9482f62e419dbd0dd9c35b740054f",
|
|
1406
1272
|
adminCap: "0x56ac8e6f2b360b2b35c0168d72cc6cd17d9592afb83709865cb87af24bb2025b",
|
|
1407
|
-
object: "
|
|
1408
|
-
query: "
|
|
1409
|
-
incentivePools: "
|
|
1410
|
-
incentiveAccounts: "
|
|
1411
|
-
config: "
|
|
1273
|
+
object: "0x8fe05c796e779c71e7739dcaecefb8757ff9482f62e419dbd0dd9c35b740054f",
|
|
1274
|
+
query: "0x5fba54ac5862f087112c54c02339623bd245721f5e21ea3330fc8c8afc8f51f4",
|
|
1275
|
+
incentivePools: "0xcace4f4736229043d9f897667d046370b8a4d6534bfd307787c40b4c9f42514a",
|
|
1276
|
+
incentiveAccounts: "0x41ff558f580ca0f711910fd6ef687fce9df76ee8e7fc5e150bdfae08e17fae62",
|
|
1277
|
+
config: "0x9636e7b947b806b9fe438d037f02bb24026c5b2691d2f6bad349c2e117f77cc3"
|
|
1412
1278
|
},
|
|
1413
1279
|
referral: {
|
|
1414
1280
|
id: "0x1bf5a8ce77050d8052549d743e16b469f15aa6b81b752b78b6ebb65179665f5a",
|
|
@@ -1420,8 +1286,6 @@ var TEST_ADDRESSES = {
|
|
|
1420
1286
|
revenueTableId: "0x595baa3654c297bff84ab7786a2d250f019cefc66e8df8e89fd9d41e02bd30dd",
|
|
1421
1287
|
referralTiers: "0x144350f3db9b46d11b140084cd54e6de0b9c3b8d265ce8059b51d0ef58ea464b",
|
|
1422
1288
|
tiersTableId: "0xeac755a7a8b7798530905ac79e8c114f19d0f130f6eab012954f08faac29c75d",
|
|
1423
|
-
// authorizedWitnessList:
|
|
1424
|
-
// '0xf21b0ed043c9bb70842c0129159f4943dbcc3c9ef2f2f808af65f8be25cfd20e',
|
|
1425
1289
|
authorizedWitnessList: "0x9d6223dc52015b8a3986a573590ef2af8f1b8f3e4685513888c052f001b87e7f",
|
|
1426
1290
|
version: "0x3545849eb97723e676a476ec9d4fe5f2eb0eb2c6b78972851114fd4c7ed4639f"
|
|
1427
1291
|
},
|
|
@@ -1441,19 +1305,19 @@ var TEST_ADDRESSES = {
|
|
|
1441
1305
|
userRewardTableId: "0x748a80395849ed37db1b0e14f2ab5d1d96458d2359ab3a84eb079d0f4ac7cf2e"
|
|
1442
1306
|
},
|
|
1443
1307
|
scoin: {
|
|
1444
|
-
id: "
|
|
1308
|
+
id: "0x826a4934bee9487e558eed603cf42f30cdc4321d6f31083930791b95f903b9f9",
|
|
1445
1309
|
coins: {
|
|
1446
1310
|
ssui: {
|
|
1447
|
-
coinType: "
|
|
1448
|
-
treasury: "
|
|
1449
|
-
},
|
|
1450
|
-
scetus: {
|
|
1451
|
-
coinType: "0x8b71e6d323ed78515af2bead13bf3d0da1562ba4a99234eb7c4f14fd39ef0427::scallop_cetus::SCALLOP_CETUS",
|
|
1452
|
-
treasury: "0xd786f4b2d26278cc7911a3445b1b085eab60f269ef9dbb6b87e803d52f155003"
|
|
1311
|
+
coinType: "0x88618204de2dfdc2597681a8441ee726b0dc13494c41e319c3264eb7b35fea90::scallop_sui::SCALLOP_SUI",
|
|
1312
|
+
treasury: "0x03f1d94a40bd9f5d556bacb5c5245732b185572f6a29b36ad8b555d9a8a24f09"
|
|
1453
1313
|
},
|
|
1454
1314
|
ssca: {
|
|
1455
|
-
coinType: "
|
|
1456
|
-
treasury: "
|
|
1315
|
+
coinType: "0x9f64a180373a6b66595025ae16a4ab701f0af1dd5c7ce1ac91dc112e52c2a3f8::scallop_sca::SCALLOP_SCA",
|
|
1316
|
+
treasury: "0x1b05d2cd8b20dba19da073a54195fc52d2f438ea19dea0713bae7a7dab308199"
|
|
1317
|
+
},
|
|
1318
|
+
susdc: {
|
|
1319
|
+
coinType: "0x55ed015f9f006c0c96ad36ebe3b3570d088e8498f52defea48e5634c110e485c::scallop_usdc::SCALLOP_USDC",
|
|
1320
|
+
treasury: "0x6ef82ef94472dcb8c2cdeac8df38874024c08570ca165986ba56d1e38fe0c0a3"
|
|
1457
1321
|
},
|
|
1458
1322
|
swusdc: {
|
|
1459
1323
|
coinType: "0xf5447c4305a486d8c8557559887c2c39449ddb5e748f15d33946d02a1663c158::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC",
|
|
@@ -1488,12 +1352,12 @@ var TEST_ADDRESSES = {
|
|
|
1488
1352
|
treasury: "0xdad9bc6293e694f67a5274ea51b596e0bdabfafc585ae6d7e82888e65f1a03e0"
|
|
1489
1353
|
},
|
|
1490
1354
|
sdeep: {
|
|
1491
|
-
coinType: "
|
|
1492
|
-
treasury: "
|
|
1355
|
+
coinType: "0x34f0a2e793e1f79ceac72cfe3bb95f65541da449418289ccd12922d16140c882::scallop_deep::SCALLOP_DEEP",
|
|
1356
|
+
treasury: "0x71d41465cf2d16fa0206126526bebdf65c8871d1fcfbd0c2237db2306afd67ba"
|
|
1493
1357
|
},
|
|
1494
1358
|
sfud: {
|
|
1495
|
-
coinType: "
|
|
1496
|
-
treasury: "
|
|
1359
|
+
coinType: "0x3b23c05f917052255a0b16a534dbd4446911aa4a30bd3497cdf5b736551e7ef8::scallop_fud::SCALLOP_FUD",
|
|
1360
|
+
treasury: "0x858c492d51425b922c040c1a389e185b3b00d565e7d72ead1a81dc733104660d"
|
|
1497
1361
|
}
|
|
1498
1362
|
}
|
|
1499
1363
|
}
|
|
@@ -1506,6 +1370,31 @@ var MAX_LOCK_DURATION = MAX_LOCK_ROUNDS * UNLOCK_ROUND_DURATION;
|
|
|
1506
1370
|
var MIN_INITIAL_LOCK_AMOUNT = 1e10;
|
|
1507
1371
|
var MIN_TOP_UP_AMOUNT = 1e9;
|
|
1508
1372
|
|
|
1373
|
+
// src/constants/xoracle.ts
|
|
1374
|
+
var xOracleList = {
|
|
1375
|
+
// @TODO: Update to real oracle list
|
|
1376
|
+
usdc: { primary: ["pyth"], secondary: [] },
|
|
1377
|
+
sbeth: { primary: [], secondary: [] },
|
|
1378
|
+
sbusdt: { primary: [], secondary: [] },
|
|
1379
|
+
sbwbtc: { primary: [], secondary: [] },
|
|
1380
|
+
weth: { primary: [], secondary: [] },
|
|
1381
|
+
wbtc: { primary: [], secondary: [] },
|
|
1382
|
+
wusdc: { primary: [], secondary: [] },
|
|
1383
|
+
wusdt: { primary: [], secondary: [] },
|
|
1384
|
+
sui: { primary: ["pyth"], secondary: [] },
|
|
1385
|
+
wapt: { primary: [], secondary: [] },
|
|
1386
|
+
wsol: { primary: [], secondary: [] },
|
|
1387
|
+
cetus: { primary: [], secondary: [] },
|
|
1388
|
+
afsui: { primary: [], secondary: [] },
|
|
1389
|
+
hasui: { primary: [], secondary: [] },
|
|
1390
|
+
vsui: { primary: [], secondary: [] },
|
|
1391
|
+
sca: { primary: ["pyth"], secondary: [] },
|
|
1392
|
+
fud: { primary: ["pyth"], secondary: [] },
|
|
1393
|
+
deep: { primary: ["pyth"], secondary: [] },
|
|
1394
|
+
fdusd: { primary: [], secondary: [] },
|
|
1395
|
+
blub: { primary: [], secondary: [] }
|
|
1396
|
+
};
|
|
1397
|
+
|
|
1509
1398
|
// src/models/scallopCache.ts
|
|
1510
1399
|
import { QueryClient } from "@tanstack/query-core";
|
|
1511
1400
|
import {
|
|
@@ -3048,13 +2937,10 @@ var parseAssetSymbol = (coinName) => {
|
|
|
3048
2937
|
return `w${coinName.slice(1).toUpperCase()}`;
|
|
3049
2938
|
}
|
|
3050
2939
|
if (isSuiBridgeAsset(coinName)) {
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
return "sbwBTC";
|
|
3054
|
-
default: {
|
|
3055
|
-
return `sb${coinName.slice(2).toUpperCase()}`;
|
|
3056
|
-
}
|
|
2940
|
+
if (coinName.startsWith("sbw") && coinName.length > 3) {
|
|
2941
|
+
return `sbw${coinName.slice(3).toUpperCase()}`;
|
|
3057
2942
|
}
|
|
2943
|
+
return `sb${coinName.slice(2).toUpperCase()}`;
|
|
3058
2944
|
}
|
|
3059
2945
|
if (isMarketCoin(coinName)) {
|
|
3060
2946
|
const assetCoinName = coinName.slice(1).toLowerCase();
|
|
@@ -3067,8 +2953,6 @@ var parseAssetSymbol = (coinName) => {
|
|
|
3067
2953
|
return "haSUI";
|
|
3068
2954
|
case "vsui":
|
|
3069
2955
|
return "vSUI";
|
|
3070
|
-
case "musd":
|
|
3071
|
-
return "mUSD";
|
|
3072
2956
|
default:
|
|
3073
2957
|
return coinName.toUpperCase();
|
|
3074
2958
|
}
|
|
@@ -3086,7 +2970,7 @@ var parseDataFromPythPriceFeed = (feed, address) => {
|
|
|
3086
2970
|
publishTime: Number(feed.price.publishTime) * 10 ** 3
|
|
3087
2971
|
};
|
|
3088
2972
|
} else {
|
|
3089
|
-
throw new Error(
|
|
2973
|
+
throw new Error(`Invalid feed id: ${feed.id}`);
|
|
3090
2974
|
}
|
|
3091
2975
|
};
|
|
3092
2976
|
var findClosestUnlockRound = (unlockAtInSecondTimestamp) => {
|
|
@@ -3334,7 +3218,7 @@ var getBindedVeScaKey = async ({
|
|
|
3334
3218
|
};
|
|
3335
3219
|
|
|
3336
3220
|
// src/queries/coreQuery.ts
|
|
3337
|
-
import { normalizeStructTag as normalizeStructTag4 } from "@mysten/sui/utils";
|
|
3221
|
+
import { normalizeStructTag as normalizeStructTag4, SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
|
|
3338
3222
|
import BigNumber3 from "bignumber.js";
|
|
3339
3223
|
|
|
3340
3224
|
// src/queries/supplyLimitQuery.ts
|
|
@@ -4075,7 +3959,7 @@ var getObligations = async ({
|
|
|
4075
3959
|
address
|
|
4076
3960
|
}, ownerAddress) => {
|
|
4077
3961
|
const owner = ownerAddress;
|
|
4078
|
-
const protocolObjectId = address.get("core.object")
|
|
3962
|
+
const protocolObjectId = address.get("core.object") || PROTOCOL_OBJECT_ID;
|
|
4079
3963
|
const keyObjectsResponse = [];
|
|
4080
3964
|
let hasNextPage = false;
|
|
4081
3965
|
let nextCursor = null;
|
|
@@ -4136,10 +4020,19 @@ var getObligationLocked = async (cache, obligation) => {
|
|
|
4136
4020
|
};
|
|
4137
4021
|
var queryObligation = async ({
|
|
4138
4022
|
address
|
|
4139
|
-
}, obligationId) => {
|
|
4023
|
+
}, obligationId, version = address.get("core.version"), market = address.get("core.market")) => {
|
|
4140
4024
|
const packageId = address.get("core.packages.query.id");
|
|
4141
4025
|
const queryTarget = `${packageId}::obligation_query::obligation_data`;
|
|
4142
|
-
const args = [
|
|
4026
|
+
const args = [
|
|
4027
|
+
version,
|
|
4028
|
+
market,
|
|
4029
|
+
obligationId,
|
|
4030
|
+
{
|
|
4031
|
+
objectId: SUI_CLOCK_OBJECT_ID,
|
|
4032
|
+
mutable: false,
|
|
4033
|
+
initialSharedVersion: "1"
|
|
4034
|
+
}
|
|
4035
|
+
];
|
|
4143
4036
|
const queryResult = await address.cache.queryInspectTxn(
|
|
4144
4037
|
{ queryTarget, args }
|
|
4145
4038
|
// txBlock
|
|
@@ -5093,9 +4986,9 @@ var getPythPrices = async ({
|
|
|
5093
4986
|
{}
|
|
5094
4987
|
);
|
|
5095
4988
|
};
|
|
5096
|
-
var getAllCoinPrices = async (query, marketPools, coinPrices) => {
|
|
5097
|
-
coinPrices = coinPrices ?? await query.utils.getCoinPrices();
|
|
5098
|
-
marketPools = marketPools ?? (await query.getMarketPools(void 0, { coinPrices })).pools;
|
|
4989
|
+
var getAllCoinPrices = async (query, marketPools, coinPrices, indexer = false) => {
|
|
4990
|
+
coinPrices = coinPrices ?? (indexer ? await query.getCoinPricesByIndexer() : await query.utils.getCoinPrices());
|
|
4991
|
+
marketPools = marketPools ?? (await query.getMarketPools(void 0, { coinPrices, indexer })).pools;
|
|
5099
4992
|
if (!marketPools) {
|
|
5100
4993
|
throw new Error(`Failed to fetch market pool for getAllCoinPrices`);
|
|
5101
4994
|
}
|
|
@@ -5575,7 +5468,7 @@ var getStakeRewardPool = async ({
|
|
|
5575
5468
|
|
|
5576
5469
|
// src/queries/vescaQuery.ts
|
|
5577
5470
|
import BigNumber8 from "bignumber.js";
|
|
5578
|
-
import { SUI_CLOCK_OBJECT_ID, SuiTxBlock as SuiTxBlock2 } from "@scallop-io/sui-kit";
|
|
5471
|
+
import { SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID2, SuiTxBlock as SuiTxBlock2 } from "@scallop-io/sui-kit";
|
|
5579
5472
|
import { bcs as bcs2 } from "@mysten/sui/bcs";
|
|
5580
5473
|
import { z as zod5 } from "zod";
|
|
5581
5474
|
import assert2 from "assert";
|
|
@@ -5676,25 +5569,15 @@ var getTotalVeScaTreasuryAmount = async (utils, veScaTreasury) => {
|
|
|
5676
5569
|
const veScaConfig = utils.address.get("vesca.config");
|
|
5677
5570
|
veScaTreasury = veScaTreasury ?? utils.address.get("vesca.treasury");
|
|
5678
5571
|
const txb = new SuiTxBlock2();
|
|
5572
|
+
const clockObjectRef = txb.sharedObjectRef({
|
|
5573
|
+
objectId: SUI_CLOCK_OBJECT_ID2,
|
|
5574
|
+
mutable: false,
|
|
5575
|
+
initialSharedVersion: "1"
|
|
5576
|
+
});
|
|
5679
5577
|
const refreshQueryTarget = `${veScaPkgId}::treasury::refresh`;
|
|
5680
|
-
const refreshArgs = [
|
|
5681
|
-
veScaConfig,
|
|
5682
|
-
veScaTreasury,
|
|
5683
|
-
txb.sharedObjectRef({
|
|
5684
|
-
objectId: SUI_CLOCK_OBJECT_ID,
|
|
5685
|
-
mutable: false,
|
|
5686
|
-
initialSharedVersion: "1"
|
|
5687
|
-
})
|
|
5688
|
-
];
|
|
5578
|
+
const refreshArgs = [veScaConfig, veScaTreasury, clockObjectRef];
|
|
5689
5579
|
const veScaAmountQueryTarget = `${veScaPkgId}::treasury::total_ve_sca_amount`;
|
|
5690
|
-
const veScaAmountArgs = [
|
|
5691
|
-
veScaTreasury,
|
|
5692
|
-
txb.sharedObjectRef({
|
|
5693
|
-
objectId: SUI_CLOCK_OBJECT_ID,
|
|
5694
|
-
mutable: false,
|
|
5695
|
-
initialSharedVersion: "1"
|
|
5696
|
-
})
|
|
5697
|
-
];
|
|
5580
|
+
const veScaAmountArgs = [veScaTreasury, clockObjectRef];
|
|
5698
5581
|
const resolvedRefreshArgs = await Promise.all(
|
|
5699
5582
|
refreshArgs.map(async (arg) => {
|
|
5700
5583
|
if (typeof arg === "string") {
|
|
@@ -5758,7 +5641,7 @@ var getVeScaTreasuryInfo = async (utils) => {
|
|
|
5758
5641
|
};
|
|
5759
5642
|
|
|
5760
5643
|
// src/queries/poolAddressesQuery.ts
|
|
5761
|
-
var getAllAddresses = async (query, pools) => {
|
|
5644
|
+
var getAllAddresses = async (query, pools = [...SUPPORT_POOLS]) => {
|
|
5762
5645
|
const results = {};
|
|
5763
5646
|
const marketId = query.address.get("core.market");
|
|
5764
5647
|
const marketObject = (await query.cache.queryGetObject(marketId))?.data;
|
|
@@ -5883,6 +5766,78 @@ var getAllAddresses = async (query, pools) => {
|
|
|
5883
5766
|
return results;
|
|
5884
5767
|
};
|
|
5885
5768
|
|
|
5769
|
+
// src/queries/xOracleQuery.ts
|
|
5770
|
+
var PRIMARY_PRICE_UPDATE_POLICY = "0xbcd908d0ee6d63d726e61676f3feeec3d19817f4849bbecf372dd3399f247f6b";
|
|
5771
|
+
var SECONDARY_PRICE_UPDDATE_POLICY = "0x624a6f120777bb30e718b86e836c205ef4229448052377dc3d78272a6662b2c0";
|
|
5772
|
+
var getPriceUpdatePolicies = async (address) => {
|
|
5773
|
+
const priceUpdatePolicyRulesKeyType = `${address.get("core.packages.xOracle.object")}::price_update_policy::PriceUpdatePolicyRulesKey`;
|
|
5774
|
+
const [primaryPriceUpdatePolicyTable, secondaryPriceUpdatePolicyTable] = await Promise.all([
|
|
5775
|
+
address.cache.queryGetDynamicFieldObject({
|
|
5776
|
+
parentId: PRIMARY_PRICE_UPDATE_POLICY,
|
|
5777
|
+
name: {
|
|
5778
|
+
type: priceUpdatePolicyRulesKeyType,
|
|
5779
|
+
value: { dummy_field: false }
|
|
5780
|
+
}
|
|
5781
|
+
}),
|
|
5782
|
+
address.cache.queryGetDynamicFieldObject({
|
|
5783
|
+
parentId: SECONDARY_PRICE_UPDDATE_POLICY,
|
|
5784
|
+
name: {
|
|
5785
|
+
type: priceUpdatePolicyRulesKeyType,
|
|
5786
|
+
value: { dummy_field: false }
|
|
5787
|
+
}
|
|
5788
|
+
})
|
|
5789
|
+
]);
|
|
5790
|
+
return {
|
|
5791
|
+
primary: primaryPriceUpdatePolicyTable,
|
|
5792
|
+
secondary: secondaryPriceUpdatePolicyTable
|
|
5793
|
+
};
|
|
5794
|
+
};
|
|
5795
|
+
var PRIMARY_PRICE_UPDATE_POLICY_VECSET_ID = "0xfb1330aa028ed6a159b742c71b5a79b3b6824cf71efa40ea82b52486ad209264";
|
|
5796
|
+
var SECONDARY_PRICE_UPDATE_POLICY_VECSET_ID = "0x4b827acc73f3f53f808dd73a7ee0a60ae61e84322176bece72b26467030b467c";
|
|
5797
|
+
var getAssetOracles = async (utils, ruleType) => {
|
|
5798
|
+
const ruleTypeNameToOracleType = {
|
|
5799
|
+
[`${utils.address.get("core.packages.pyth.object")}::rule::Rule`]: "pyth",
|
|
5800
|
+
[`${utils.address.get("core.packages.supra.object")}::rule::Rule`]: "supra",
|
|
5801
|
+
[`${utils.address.get("core.packages.switchboard.object")}::rule::Rule`]: "switchboard"
|
|
5802
|
+
};
|
|
5803
|
+
const assetPrimaryOracles = {};
|
|
5804
|
+
let cursor = null;
|
|
5805
|
+
do {
|
|
5806
|
+
const response = await utils.cache.queryGetDynamicFields({
|
|
5807
|
+
parentId: ruleType === "primary" ? PRIMARY_PRICE_UPDATE_POLICY_VECSET_ID : SECONDARY_PRICE_UPDATE_POLICY_VECSET_ID,
|
|
5808
|
+
cursor,
|
|
5809
|
+
limit: 10
|
|
5810
|
+
});
|
|
5811
|
+
if (!response)
|
|
5812
|
+
break;
|
|
5813
|
+
const { data, hasNextPage, nextCursor } = response;
|
|
5814
|
+
cursor = nextCursor;
|
|
5815
|
+
const objectIds = data.map((dynamicField) => dynamicField.objectId);
|
|
5816
|
+
const objectResponses = await utils.cache.queryGetObjects(objectIds);
|
|
5817
|
+
objectResponses.forEach((object) => {
|
|
5818
|
+
if (!object.content || object.content.dataType !== "moveObject")
|
|
5819
|
+
return;
|
|
5820
|
+
const fields = object.content.fields;
|
|
5821
|
+
const typeName = fields.name.fields.name;
|
|
5822
|
+
const assetName = utils.parseCoinNameFromType(`0x${typeName}`);
|
|
5823
|
+
if (!assetName)
|
|
5824
|
+
throw new Error(`Invalid asset name: ${assetName}`);
|
|
5825
|
+
if (!assetPrimaryOracles[assetName]) {
|
|
5826
|
+
assetPrimaryOracles[assetName] = [];
|
|
5827
|
+
}
|
|
5828
|
+
const value = fields.value;
|
|
5829
|
+
value.fields.contents.forEach((content) => {
|
|
5830
|
+
assetPrimaryOracles[assetName].push(
|
|
5831
|
+
ruleTypeNameToOracleType[`0x${content.fields.name}`]
|
|
5832
|
+
);
|
|
5833
|
+
});
|
|
5834
|
+
});
|
|
5835
|
+
if (!hasNextPage)
|
|
5836
|
+
break;
|
|
5837
|
+
} while (cursor);
|
|
5838
|
+
return assetPrimaryOracles;
|
|
5839
|
+
};
|
|
5840
|
+
|
|
5886
5841
|
// src/models/scallopUtils.ts
|
|
5887
5842
|
var ScallopUtils = class {
|
|
5888
5843
|
constructor(params, instance) {
|
|
@@ -6074,7 +6029,7 @@ var ScallopUtils = class {
|
|
|
6074
6029
|
* @return Market coin type.
|
|
6075
6030
|
*/
|
|
6076
6031
|
parseMarketCoinType(coinName) {
|
|
6077
|
-
const protocolObjectId = this.address.get("core.object")
|
|
6032
|
+
const protocolObjectId = this.address.get("core.object") || PROTOCOL_OBJECT_ID;
|
|
6078
6033
|
const coinType = this.parseCoinType(coinName, true);
|
|
6079
6034
|
return `${protocolObjectId}::reserve::MarketCoin<${coinType}>`;
|
|
6080
6035
|
}
|
|
@@ -6365,22 +6320,28 @@ import { normalizeSuiAddress as normalizeSuiAddress2 } from "@mysten/sui/utils";
|
|
|
6365
6320
|
|
|
6366
6321
|
// src/builders/coreBuilder.ts
|
|
6367
6322
|
import { Transaction } from "@mysten/sui/transactions";
|
|
6368
|
-
import { SUI_CLOCK_OBJECT_ID as
|
|
6323
|
+
import { SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID4 } from "@mysten/sui/utils";
|
|
6369
6324
|
import { SuiTxBlock as SuiKitTxBlock } from "@scallop-io/sui-kit";
|
|
6370
6325
|
|
|
6371
6326
|
// src/builders/oracle.ts
|
|
6372
|
-
import { SUI_CLOCK_OBJECT_ID as
|
|
6327
|
+
import { SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID3 } from "@mysten/sui/utils";
|
|
6373
6328
|
import {
|
|
6374
6329
|
SuiPythClient,
|
|
6375
6330
|
SuiPriceServiceConnection as SuiPriceServiceConnection2
|
|
6376
6331
|
} from "@pythnetwork/pyth-sui-js";
|
|
6377
|
-
var updateOracles = async (builder, txBlock, assetCoinNames
|
|
6332
|
+
var updateOracles = async (builder, txBlock, assetCoinNames = [
|
|
6333
|
+
.../* @__PURE__ */ new Set([...SUPPORT_POOLS, ...SUPPORT_COLLATERALS])
|
|
6334
|
+
], options = { usePythPullModel: true }) => {
|
|
6378
6335
|
const usePythPullModel = builder.params.usePythPullModel ?? options.usePythPullModel;
|
|
6379
|
-
|
|
6380
|
-
|
|
6336
|
+
const flattenedRules = [
|
|
6337
|
+
...new Set(
|
|
6338
|
+
Object.values(xOracleList).flatMap(({ primary, secondary }) => [
|
|
6339
|
+
...primary,
|
|
6340
|
+
...secondary
|
|
6341
|
+
])
|
|
6342
|
+
)
|
|
6381
6343
|
];
|
|
6382
|
-
|
|
6383
|
-
if (usePythPullModel && rules.includes("pyth")) {
|
|
6344
|
+
if (flattenedRules.includes("pyth") && usePythPullModel) {
|
|
6384
6345
|
const pythClient = new SuiPythClient(
|
|
6385
6346
|
builder.suiKit.client(),
|
|
6386
6347
|
builder.address.get("core.oracles.pyth.state"),
|
|
@@ -6410,7 +6371,12 @@ var updateOracles = async (builder, txBlock, assetCoinNames, options = { usePyth
|
|
|
6410
6371
|
}
|
|
6411
6372
|
const updateAssetCoinNames = [...new Set(assetCoinNames)];
|
|
6412
6373
|
for (const assetCoinName of updateAssetCoinNames) {
|
|
6413
|
-
await updateOracle(
|
|
6374
|
+
await updateOracle(
|
|
6375
|
+
builder,
|
|
6376
|
+
txBlock,
|
|
6377
|
+
assetCoinName,
|
|
6378
|
+
xOracleList[assetCoinName]
|
|
6379
|
+
);
|
|
6414
6380
|
}
|
|
6415
6381
|
};
|
|
6416
6382
|
var updateOracle = async (builder, txBlock, assetCoinName, rules) => {
|
|
@@ -6440,37 +6406,42 @@ var updatePrice = (txBlock, rules, xOraclePackageId, xOracleId, pythPackageId, p
|
|
|
6440
6406
|
xOracleId,
|
|
6441
6407
|
coinType
|
|
6442
6408
|
);
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6409
|
+
Object.entries(rules).forEach(([type, rule]) => {
|
|
6410
|
+
if (rule.includes("pyth")) {
|
|
6411
|
+
updatePythPrice(
|
|
6412
|
+
type,
|
|
6413
|
+
txBlock,
|
|
6414
|
+
pythPackageId,
|
|
6415
|
+
request,
|
|
6416
|
+
pythStateId,
|
|
6417
|
+
pythFeedObjectId,
|
|
6418
|
+
pythRegistryId,
|
|
6419
|
+
coinType
|
|
6420
|
+
);
|
|
6421
|
+
}
|
|
6422
|
+
if (rule.includes("supra")) {
|
|
6423
|
+
updateSupraPrice(
|
|
6424
|
+
type,
|
|
6425
|
+
txBlock,
|
|
6426
|
+
supraPackageId,
|
|
6427
|
+
request,
|
|
6428
|
+
supraHolderId,
|
|
6429
|
+
supraRegistryId,
|
|
6430
|
+
coinType
|
|
6431
|
+
);
|
|
6432
|
+
}
|
|
6433
|
+
if (rule.includes("switchboard")) {
|
|
6434
|
+
updateSwitchboardPrice(
|
|
6435
|
+
type,
|
|
6436
|
+
txBlock,
|
|
6437
|
+
switchboardPackageId,
|
|
6438
|
+
request,
|
|
6439
|
+
switchboardAggregatorId,
|
|
6440
|
+
switchboardRegistryId,
|
|
6441
|
+
coinType
|
|
6442
|
+
);
|
|
6443
|
+
}
|
|
6444
|
+
});
|
|
6474
6445
|
confirmPriceUpdateRequest(
|
|
6475
6446
|
txBlock,
|
|
6476
6447
|
xOraclePackageId,
|
|
@@ -6494,7 +6465,7 @@ var confirmPriceUpdateRequest = (txBlock, packageId, xOracleId, request, coinTyp
|
|
|
6494
6465
|
xOracleId,
|
|
6495
6466
|
request,
|
|
6496
6467
|
txBlock.sharedObjectRef({
|
|
6497
|
-
objectId:
|
|
6468
|
+
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6498
6469
|
mutable: false,
|
|
6499
6470
|
initialSharedVersion: "1"
|
|
6500
6471
|
})
|
|
@@ -6503,50 +6474,50 @@ var confirmPriceUpdateRequest = (txBlock, packageId, xOracleId, request, coinTyp
|
|
|
6503
6474
|
);
|
|
6504
6475
|
return txBlock;
|
|
6505
6476
|
};
|
|
6506
|
-
var updateSupraPrice = (txBlock, packageId, request, holderId, registryId, coinType) => {
|
|
6477
|
+
var updateSupraPrice = (type, txBlock, packageId, request, holderId, registryId, coinType) => {
|
|
6507
6478
|
txBlock.moveCall(
|
|
6508
|
-
`${packageId}::rule::
|
|
6479
|
+
`${packageId}::rule::set_price_as_${type}`,
|
|
6509
6480
|
[
|
|
6510
6481
|
request,
|
|
6511
6482
|
holderId,
|
|
6512
6483
|
registryId,
|
|
6513
6484
|
txBlock.sharedObjectRef({
|
|
6514
|
-
objectId:
|
|
6515
|
-
|
|
6516
|
-
|
|
6485
|
+
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6486
|
+
initialSharedVersion: "1",
|
|
6487
|
+
mutable: false
|
|
6517
6488
|
})
|
|
6518
6489
|
],
|
|
6519
6490
|
[coinType]
|
|
6520
6491
|
);
|
|
6521
6492
|
};
|
|
6522
|
-
var updateSwitchboardPrice = (txBlock, packageId, request, aggregatorId, registryId, coinType) => {
|
|
6493
|
+
var updateSwitchboardPrice = (type, txBlock, packageId, request, aggregatorId, registryId, coinType) => {
|
|
6523
6494
|
txBlock.moveCall(
|
|
6524
|
-
`${packageId}::rule::
|
|
6495
|
+
`${packageId}::rule::set_price_as_${type}`,
|
|
6525
6496
|
[
|
|
6526
6497
|
request,
|
|
6527
6498
|
aggregatorId,
|
|
6528
6499
|
registryId,
|
|
6529
6500
|
txBlock.sharedObjectRef({
|
|
6530
|
-
objectId:
|
|
6531
|
-
|
|
6532
|
-
|
|
6501
|
+
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6502
|
+
initialSharedVersion: "1",
|
|
6503
|
+
mutable: false
|
|
6533
6504
|
})
|
|
6534
6505
|
],
|
|
6535
6506
|
[coinType]
|
|
6536
6507
|
);
|
|
6537
6508
|
};
|
|
6538
|
-
var updatePythPrice = (txBlock, packageId, request, stateId, feedObjectId, registryId, coinType) => {
|
|
6509
|
+
var updatePythPrice = (type, txBlock, packageId, request, stateId, feedObjectId, registryId, coinType) => {
|
|
6539
6510
|
txBlock.moveCall(
|
|
6540
|
-
`${packageId}::rule::
|
|
6511
|
+
`${packageId}::rule::set_price_as_${type}`,
|
|
6541
6512
|
[
|
|
6542
6513
|
request,
|
|
6543
6514
|
stateId,
|
|
6544
6515
|
feedObjectId,
|
|
6545
6516
|
registryId,
|
|
6546
6517
|
txBlock.sharedObjectRef({
|
|
6547
|
-
objectId:
|
|
6548
|
-
|
|
6549
|
-
|
|
6518
|
+
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6519
|
+
initialSharedVersion: "1",
|
|
6520
|
+
mutable: false
|
|
6550
6521
|
})
|
|
6551
6522
|
],
|
|
6552
6523
|
[coinType]
|
|
@@ -6583,6 +6554,11 @@ var generateCoreNormalMethod = ({
|
|
|
6583
6554
|
};
|
|
6584
6555
|
const referralPkgId = builder.address.get("referral.id");
|
|
6585
6556
|
const referralWitnessType = `${referralPkgId}::scallop_referral_program::REFERRAL_WITNESS`;
|
|
6557
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
6558
|
+
objectId: SUI_CLOCK_OBJECT_ID4,
|
|
6559
|
+
mutable: false,
|
|
6560
|
+
initialSharedVersion: "1"
|
|
6561
|
+
});
|
|
6586
6562
|
return {
|
|
6587
6563
|
openObligation: () => {
|
|
6588
6564
|
const [obligation, obligationKey, obligationHotPotato] = builder.moveCall(
|
|
@@ -6628,11 +6604,7 @@ var generateCoreNormalMethod = ({
|
|
|
6628
6604
|
coreIds.coinDecimalsRegistry,
|
|
6629
6605
|
txBlock.pure.u64(amount),
|
|
6630
6606
|
coreIds.xOracle,
|
|
6631
|
-
|
|
6632
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6633
|
-
mutable: false,
|
|
6634
|
-
initialSharedVersion: "1"
|
|
6635
|
-
})
|
|
6607
|
+
clockObjectRef
|
|
6636
6608
|
],
|
|
6637
6609
|
[coinType]
|
|
6638
6610
|
);
|
|
@@ -6642,16 +6614,7 @@ var generateCoreNormalMethod = ({
|
|
|
6642
6614
|
return builder.moveCall(
|
|
6643
6615
|
txBlock,
|
|
6644
6616
|
`${coreIds.protocolPkg}::mint::mint`,
|
|
6645
|
-
[
|
|
6646
|
-
coreIds.version,
|
|
6647
|
-
coreIds.market,
|
|
6648
|
-
coin,
|
|
6649
|
-
txBlock.sharedObjectRef({
|
|
6650
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6651
|
-
mutable: false,
|
|
6652
|
-
initialSharedVersion: "1"
|
|
6653
|
-
})
|
|
6654
|
-
],
|
|
6617
|
+
[coreIds.version, coreIds.market, coin, clockObjectRef],
|
|
6655
6618
|
[coinType]
|
|
6656
6619
|
);
|
|
6657
6620
|
},
|
|
@@ -6660,16 +6623,7 @@ var generateCoreNormalMethod = ({
|
|
|
6660
6623
|
return builder.moveCall(
|
|
6661
6624
|
txBlock,
|
|
6662
6625
|
`${coreIds.protocolPkg}::mint::mint_entry`,
|
|
6663
|
-
[
|
|
6664
|
-
coreIds.version,
|
|
6665
|
-
coreIds.market,
|
|
6666
|
-
coin,
|
|
6667
|
-
txBlock.sharedObjectRef({
|
|
6668
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6669
|
-
mutable: false,
|
|
6670
|
-
initialSharedVersion: "1"
|
|
6671
|
-
})
|
|
6672
|
-
],
|
|
6626
|
+
[coreIds.version, coreIds.market, coin, clockObjectRef],
|
|
6673
6627
|
[coinType]
|
|
6674
6628
|
);
|
|
6675
6629
|
},
|
|
@@ -6678,16 +6632,7 @@ var generateCoreNormalMethod = ({
|
|
|
6678
6632
|
return builder.moveCall(
|
|
6679
6633
|
txBlock,
|
|
6680
6634
|
`${coreIds.protocolPkg}::redeem::redeem`,
|
|
6681
|
-
[
|
|
6682
|
-
coreIds.version,
|
|
6683
|
-
coreIds.market,
|
|
6684
|
-
marketCoin,
|
|
6685
|
-
txBlock.sharedObjectRef({
|
|
6686
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6687
|
-
mutable: false,
|
|
6688
|
-
initialSharedVersion: "1"
|
|
6689
|
-
})
|
|
6690
|
-
],
|
|
6635
|
+
[coreIds.version, coreIds.market, marketCoin, clockObjectRef],
|
|
6691
6636
|
[coinType]
|
|
6692
6637
|
);
|
|
6693
6638
|
},
|
|
@@ -6696,16 +6641,7 @@ var generateCoreNormalMethod = ({
|
|
|
6696
6641
|
return builder.moveCall(
|
|
6697
6642
|
txBlock,
|
|
6698
6643
|
`${coreIds.protocolPkg}::redeem::redeem_entry`,
|
|
6699
|
-
[
|
|
6700
|
-
coreIds.version,
|
|
6701
|
-
coreIds.market,
|
|
6702
|
-
marketCoin,
|
|
6703
|
-
txBlock.sharedObjectRef({
|
|
6704
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6705
|
-
mutable: false,
|
|
6706
|
-
initialSharedVersion: "1"
|
|
6707
|
-
})
|
|
6708
|
-
],
|
|
6644
|
+
[coreIds.version, coreIds.market, marketCoin, clockObjectRef],
|
|
6709
6645
|
[coinType]
|
|
6710
6646
|
);
|
|
6711
6647
|
},
|
|
@@ -6722,11 +6658,7 @@ var generateCoreNormalMethod = ({
|
|
|
6722
6658
|
coreIds.coinDecimalsRegistry,
|
|
6723
6659
|
amount,
|
|
6724
6660
|
coreIds.xOracle,
|
|
6725
|
-
|
|
6726
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6727
|
-
mutable: false,
|
|
6728
|
-
initialSharedVersion: "1"
|
|
6729
|
-
})
|
|
6661
|
+
clockObjectRef
|
|
6730
6662
|
],
|
|
6731
6663
|
[coinType]
|
|
6732
6664
|
);
|
|
@@ -6745,11 +6677,7 @@ var generateCoreNormalMethod = ({
|
|
|
6745
6677
|
borrowReferral,
|
|
6746
6678
|
typeof amount === "number" ? txBlock.pure.u64(amount) : amount,
|
|
6747
6679
|
coreIds.xOracle,
|
|
6748
|
-
|
|
6749
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6750
|
-
mutable: false,
|
|
6751
|
-
initialSharedVersion: "1"
|
|
6752
|
-
})
|
|
6680
|
+
clockObjectRef
|
|
6753
6681
|
],
|
|
6754
6682
|
[coinType, referralWitnessType]
|
|
6755
6683
|
);
|
|
@@ -6767,11 +6695,7 @@ var generateCoreNormalMethod = ({
|
|
|
6767
6695
|
coreIds.coinDecimalsRegistry,
|
|
6768
6696
|
txBlock.pure.u64(amount),
|
|
6769
6697
|
coreIds.xOracle,
|
|
6770
|
-
|
|
6771
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6772
|
-
mutable: false,
|
|
6773
|
-
initialSharedVersion: "1"
|
|
6774
|
-
})
|
|
6698
|
+
clockObjectRef
|
|
6775
6699
|
],
|
|
6776
6700
|
[coinType]
|
|
6777
6701
|
);
|
|
@@ -6781,17 +6705,7 @@ var generateCoreNormalMethod = ({
|
|
|
6781
6705
|
builder.moveCall(
|
|
6782
6706
|
txBlock,
|
|
6783
6707
|
`${coreIds.protocolPkg}::repay::repay`,
|
|
6784
|
-
[
|
|
6785
|
-
coreIds.version,
|
|
6786
|
-
obligation,
|
|
6787
|
-
coreIds.market,
|
|
6788
|
-
coin,
|
|
6789
|
-
txBlock.sharedObjectRef({
|
|
6790
|
-
objectId: SUI_CLOCK_OBJECT_ID3,
|
|
6791
|
-
mutable: false,
|
|
6792
|
-
initialSharedVersion: "1"
|
|
6793
|
-
})
|
|
6794
|
-
],
|
|
6708
|
+
[coreIds.version, obligation, coreIds.market, coin, clockObjectRef],
|
|
6795
6709
|
[coinType]
|
|
6796
6710
|
);
|
|
6797
6711
|
},
|
|
@@ -6936,7 +6850,7 @@ var generateCoreQuickMethod = ({
|
|
|
6936
6850
|
) ?? [];
|
|
6937
6851
|
const updateCoinNames = [...obligationCoinNames, poolCoinName];
|
|
6938
6852
|
await updateOracles(builder, txBlock, updateCoinNames);
|
|
6939
|
-
return
|
|
6853
|
+
return txBlock.borrow(
|
|
6940
6854
|
obligationInfo.obligationId,
|
|
6941
6855
|
obligationInfo.obligationKey,
|
|
6942
6856
|
amount,
|
|
@@ -7027,7 +6941,7 @@ var newCoreTxBlock = (builder, initTxBlock) => {
|
|
|
7027
6941
|
|
|
7028
6942
|
// src/builders/spoolBuilder.ts
|
|
7029
6943
|
import { Transaction as Transaction2 } from "@mysten/sui/transactions";
|
|
7030
|
-
import { SUI_CLOCK_OBJECT_ID as
|
|
6944
|
+
import { SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID5 } from "@mysten/sui/utils";
|
|
7031
6945
|
import { SuiTxBlock as SuiKitTxBlock2 } from "@scallop-io/sui-kit";
|
|
7032
6946
|
var requireStakeAccountIds = async (...params) => {
|
|
7033
6947
|
const [builder, txBlock, stakeMarketCoinName, stakeAccountId] = params;
|
|
@@ -7074,6 +6988,11 @@ var generateSpoolNormalMethod = ({
|
|
|
7074
6988
|
const spoolIds = {
|
|
7075
6989
|
spoolPkg: builder.address.get("spool.id")
|
|
7076
6990
|
};
|
|
6991
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
6992
|
+
objectId: SUI_CLOCK_OBJECT_ID5,
|
|
6993
|
+
mutable: false,
|
|
6994
|
+
initialSharedVersion: "1"
|
|
6995
|
+
});
|
|
7077
6996
|
return {
|
|
7078
6997
|
createStakeAccount: (stakeMarketCoinName) => {
|
|
7079
6998
|
const marketCoinType = builder.utils.parseMarketCoinType(stakeMarketCoinName);
|
|
@@ -7083,14 +7002,7 @@ var generateSpoolNormalMethod = ({
|
|
|
7083
7002
|
return builder.moveCall(
|
|
7084
7003
|
txBlock,
|
|
7085
7004
|
`${spoolIds.spoolPkg}::user::new_spool_account`,
|
|
7086
|
-
[
|
|
7087
|
-
stakePoolId,
|
|
7088
|
-
txBlock.sharedObjectRef({
|
|
7089
|
-
objectId: SUI_CLOCK_OBJECT_ID4,
|
|
7090
|
-
mutable: false,
|
|
7091
|
-
initialSharedVersion: "1"
|
|
7092
|
-
})
|
|
7093
|
-
],
|
|
7005
|
+
[stakePoolId, clockObjectRef],
|
|
7094
7006
|
[marketCoinType]
|
|
7095
7007
|
);
|
|
7096
7008
|
},
|
|
@@ -7102,16 +7014,7 @@ var generateSpoolNormalMethod = ({
|
|
|
7102
7014
|
builder.moveCall(
|
|
7103
7015
|
txBlock,
|
|
7104
7016
|
`${spoolIds.spoolPkg}::user::stake`,
|
|
7105
|
-
[
|
|
7106
|
-
stakePoolId,
|
|
7107
|
-
stakeAccount,
|
|
7108
|
-
coin,
|
|
7109
|
-
txBlock.sharedObjectRef({
|
|
7110
|
-
objectId: SUI_CLOCK_OBJECT_ID4,
|
|
7111
|
-
mutable: false,
|
|
7112
|
-
initialSharedVersion: "1"
|
|
7113
|
-
})
|
|
7114
|
-
],
|
|
7017
|
+
[stakePoolId, stakeAccount, coin, clockObjectRef],
|
|
7115
7018
|
[marketCoinType]
|
|
7116
7019
|
);
|
|
7117
7020
|
},
|
|
@@ -7123,16 +7026,7 @@ var generateSpoolNormalMethod = ({
|
|
|
7123
7026
|
return builder.moveCall(
|
|
7124
7027
|
txBlock,
|
|
7125
7028
|
`${spoolIds.spoolPkg}::user::unstake`,
|
|
7126
|
-
[
|
|
7127
|
-
stakePoolId,
|
|
7128
|
-
stakeAccount,
|
|
7129
|
-
amount,
|
|
7130
|
-
txBlock.sharedObjectRef({
|
|
7131
|
-
objectId: SUI_CLOCK_OBJECT_ID4,
|
|
7132
|
-
mutable: false,
|
|
7133
|
-
initialSharedVersion: "1"
|
|
7134
|
-
})
|
|
7135
|
-
],
|
|
7029
|
+
[stakePoolId, stakeAccount, amount, clockObjectRef],
|
|
7136
7030
|
[marketCoinType]
|
|
7137
7031
|
);
|
|
7138
7032
|
},
|
|
@@ -7149,16 +7043,7 @@ var generateSpoolNormalMethod = ({
|
|
|
7149
7043
|
return builder.moveCall(
|
|
7150
7044
|
txBlock,
|
|
7151
7045
|
`${spoolIds.spoolPkg}::user::redeem_rewards`,
|
|
7152
|
-
[
|
|
7153
|
-
stakePoolId,
|
|
7154
|
-
rewardPoolId,
|
|
7155
|
-
stakeAccount,
|
|
7156
|
-
txBlock.sharedObjectRef({
|
|
7157
|
-
objectId: SUI_CLOCK_OBJECT_ID4,
|
|
7158
|
-
mutable: false,
|
|
7159
|
-
initialSharedVersion: "1"
|
|
7160
|
-
})
|
|
7161
|
-
],
|
|
7046
|
+
[stakePoolId, rewardPoolId, stakeAccount, clockObjectRef],
|
|
7162
7047
|
[marketCoinType, rewardCoinType]
|
|
7163
7048
|
);
|
|
7164
7049
|
}
|
|
@@ -7295,7 +7180,7 @@ var newSpoolTxBlock = (builder, initTxBlock) => {
|
|
|
7295
7180
|
import { Transaction as Transaction3 } from "@mysten/sui/transactions";
|
|
7296
7181
|
import {
|
|
7297
7182
|
SuiTxBlock as SuiKitTxBlock3,
|
|
7298
|
-
SUI_CLOCK_OBJECT_ID as
|
|
7183
|
+
SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID6
|
|
7299
7184
|
} from "@scallop-io/sui-kit";
|
|
7300
7185
|
var requireObligationInfo2 = async (...params) => {
|
|
7301
7186
|
const [builder, txBlock, obligationId, obligationKey] = params;
|
|
@@ -7336,6 +7221,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7336
7221
|
treasury: builder.address.get("vesca.treasury"),
|
|
7337
7222
|
config: builder.address.get("vesca.config")
|
|
7338
7223
|
};
|
|
7224
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
7225
|
+
objectId: SUI_CLOCK_OBJECT_ID6,
|
|
7226
|
+
mutable: false,
|
|
7227
|
+
initialSharedVersion: "1"
|
|
7228
|
+
});
|
|
7339
7229
|
return {
|
|
7340
7230
|
stakeObligation: (obligationId, obligationKey) => {
|
|
7341
7231
|
builder.moveCall(
|
|
@@ -7348,11 +7238,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7348
7238
|
obligationKey,
|
|
7349
7239
|
obligationId,
|
|
7350
7240
|
borrowIncentiveIds.obligationAccessStore,
|
|
7351
|
-
|
|
7352
|
-
objectId: SUI_CLOCK_OBJECT_ID5,
|
|
7353
|
-
mutable: false,
|
|
7354
|
-
initialSharedVersion: "1"
|
|
7355
|
-
})
|
|
7241
|
+
clockObjectRef
|
|
7356
7242
|
]
|
|
7357
7243
|
);
|
|
7358
7244
|
},
|
|
@@ -7371,11 +7257,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7371
7257
|
veScaIds.treasury,
|
|
7372
7258
|
veScaIds.table,
|
|
7373
7259
|
veScaKey,
|
|
7374
|
-
|
|
7375
|
-
objectId: SUI_CLOCK_OBJECT_ID5,
|
|
7376
|
-
mutable: false,
|
|
7377
|
-
initialSharedVersion: "1"
|
|
7378
|
-
})
|
|
7260
|
+
clockObjectRef
|
|
7379
7261
|
],
|
|
7380
7262
|
[]
|
|
7381
7263
|
);
|
|
@@ -7390,11 +7272,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7390
7272
|
borrowIncentiveIds.incentiveAccounts,
|
|
7391
7273
|
obligationKey,
|
|
7392
7274
|
obligationId,
|
|
7393
|
-
|
|
7394
|
-
objectId: SUI_CLOCK_OBJECT_ID5,
|
|
7395
|
-
mutable: false,
|
|
7396
|
-
initialSharedVersion: "1"
|
|
7397
|
-
})
|
|
7275
|
+
clockObjectRef
|
|
7398
7276
|
]
|
|
7399
7277
|
);
|
|
7400
7278
|
},
|
|
@@ -7409,11 +7287,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7409
7287
|
borrowIncentiveIds.incentiveAccounts,
|
|
7410
7288
|
obligationKey,
|
|
7411
7289
|
obligationId,
|
|
7412
|
-
|
|
7413
|
-
objectId: SUI_CLOCK_OBJECT_ID5,
|
|
7414
|
-
mutable: false,
|
|
7415
|
-
initialSharedVersion: "1"
|
|
7416
|
-
})
|
|
7290
|
+
clockObjectRef
|
|
7417
7291
|
],
|
|
7418
7292
|
[rewardType]
|
|
7419
7293
|
);
|
|
@@ -7428,11 +7302,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7428
7302
|
borrowIncentiveIds.incentiveAccounts,
|
|
7429
7303
|
obligation,
|
|
7430
7304
|
veScaKey,
|
|
7431
|
-
|
|
7432
|
-
objectId: SUI_CLOCK_OBJECT_ID5,
|
|
7433
|
-
mutable: false,
|
|
7434
|
-
initialSharedVersion: "1"
|
|
7435
|
-
})
|
|
7305
|
+
clockObjectRef
|
|
7436
7306
|
]
|
|
7437
7307
|
);
|
|
7438
7308
|
}
|
|
@@ -7546,7 +7416,7 @@ var newBorrowIncentiveTxBlock = (builder, initTxBlock) => {
|
|
|
7546
7416
|
|
|
7547
7417
|
// src/builders/vescaBuilder.ts
|
|
7548
7418
|
import {
|
|
7549
|
-
SUI_CLOCK_OBJECT_ID as
|
|
7419
|
+
SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID7,
|
|
7550
7420
|
Transaction as Transaction4,
|
|
7551
7421
|
SuiTxBlock as SuiKitTxBlock4
|
|
7552
7422
|
} from "@scallop-io/sui-kit";
|
|
@@ -7576,6 +7446,11 @@ var generateNormalVeScaMethod = ({
|
|
|
7576
7446
|
treasury: builder.address.get("vesca.treasury"),
|
|
7577
7447
|
config: builder.address.get("vesca.config")
|
|
7578
7448
|
};
|
|
7449
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
7450
|
+
objectId: SUI_CLOCK_OBJECT_ID7,
|
|
7451
|
+
mutable: false,
|
|
7452
|
+
initialSharedVersion: "1"
|
|
7453
|
+
});
|
|
7579
7454
|
return {
|
|
7580
7455
|
lockSca: (scaCoin, unlockAtInSecondTimestamp) => {
|
|
7581
7456
|
return builder.moveCall(
|
|
@@ -7587,11 +7462,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7587
7462
|
veScaIds.treasury,
|
|
7588
7463
|
scaCoin,
|
|
7589
7464
|
unlockAtInSecondTimestamp,
|
|
7590
|
-
|
|
7591
|
-
objectId: SUI_CLOCK_OBJECT_ID6,
|
|
7592
|
-
mutable: false,
|
|
7593
|
-
initialSharedVersion: "1"
|
|
7594
|
-
})
|
|
7465
|
+
clockObjectRef
|
|
7595
7466
|
],
|
|
7596
7467
|
[]
|
|
7597
7468
|
);
|
|
@@ -7606,11 +7477,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7606
7477
|
veScaIds.table,
|
|
7607
7478
|
veScaIds.treasury,
|
|
7608
7479
|
newUnlockAtInSecondTimestamp,
|
|
7609
|
-
|
|
7610
|
-
objectId: SUI_CLOCK_OBJECT_ID6,
|
|
7611
|
-
mutable: false,
|
|
7612
|
-
initialSharedVersion: "1"
|
|
7613
|
-
})
|
|
7480
|
+
clockObjectRef
|
|
7614
7481
|
],
|
|
7615
7482
|
[]
|
|
7616
7483
|
);
|
|
@@ -7625,11 +7492,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7625
7492
|
veScaIds.table,
|
|
7626
7493
|
veScaIds.treasury,
|
|
7627
7494
|
scaCoin,
|
|
7628
|
-
|
|
7629
|
-
objectId: SUI_CLOCK_OBJECT_ID6,
|
|
7630
|
-
mutable: false,
|
|
7631
|
-
initialSharedVersion: "1"
|
|
7632
|
-
})
|
|
7495
|
+
clockObjectRef
|
|
7633
7496
|
],
|
|
7634
7497
|
[]
|
|
7635
7498
|
);
|
|
@@ -7645,11 +7508,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7645
7508
|
veScaIds.treasury,
|
|
7646
7509
|
scaCoin,
|
|
7647
7510
|
newUnlockAtInSecondTimestamp,
|
|
7648
|
-
|
|
7649
|
-
objectId: SUI_CLOCK_OBJECT_ID6,
|
|
7650
|
-
mutable: false,
|
|
7651
|
-
initialSharedVersion: "1"
|
|
7652
|
-
})
|
|
7511
|
+
clockObjectRef
|
|
7653
7512
|
],
|
|
7654
7513
|
[]
|
|
7655
7514
|
);
|
|
@@ -7663,11 +7522,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7663
7522
|
veScaKey,
|
|
7664
7523
|
veScaIds.table,
|
|
7665
7524
|
veScaIds.treasury,
|
|
7666
|
-
|
|
7667
|
-
objectId: SUI_CLOCK_OBJECT_ID6,
|
|
7668
|
-
mutable: false,
|
|
7669
|
-
initialSharedVersion: "1"
|
|
7670
|
-
})
|
|
7525
|
+
clockObjectRef
|
|
7671
7526
|
],
|
|
7672
7527
|
[]
|
|
7673
7528
|
);
|
|
@@ -7812,7 +7667,7 @@ var generateQuickVeScaMethod = ({
|
|
|
7812
7667
|
const veSca = await requireVeSca(builder, txBlock, veScaKey);
|
|
7813
7668
|
checkVesca(veSca?.unlockAt);
|
|
7814
7669
|
if (veSca) {
|
|
7815
|
-
const sca =
|
|
7670
|
+
const sca = txBlock.redeemSca(veSca.keyId);
|
|
7816
7671
|
if (transferSca) {
|
|
7817
7672
|
txBlock.transferObjects([sca], sender);
|
|
7818
7673
|
return;
|
|
@@ -7852,7 +7707,7 @@ var newVeScaTxBlock = (builder, initTxBlock) => {
|
|
|
7852
7707
|
|
|
7853
7708
|
// src/builders/referralBuilder.ts
|
|
7854
7709
|
import {
|
|
7855
|
-
SUI_CLOCK_OBJECT_ID as
|
|
7710
|
+
SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID8,
|
|
7856
7711
|
SuiTxBlock as SuiKitTxBlock5,
|
|
7857
7712
|
Transaction as Transaction5
|
|
7858
7713
|
} from "@scallop-io/sui-kit";
|
|
@@ -7871,6 +7726,11 @@ var generateReferralNormalMethod = ({
|
|
|
7871
7726
|
version: builder.address.get("referral.version")
|
|
7872
7727
|
};
|
|
7873
7728
|
const veScaTable = builder.address.get("vesca.table");
|
|
7729
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
7730
|
+
objectId: SUI_CLOCK_OBJECT_ID8,
|
|
7731
|
+
mutable: false,
|
|
7732
|
+
initialSharedVersion: "1"
|
|
7733
|
+
});
|
|
7874
7734
|
return {
|
|
7875
7735
|
bindToReferral: (veScaKeyId) => {
|
|
7876
7736
|
builder.moveCall(
|
|
@@ -7880,11 +7740,7 @@ var generateReferralNormalMethod = ({
|
|
|
7880
7740
|
referralIds.referralBindings,
|
|
7881
7741
|
txBlock.pure.id(veScaKeyId),
|
|
7882
7742
|
veScaTable,
|
|
7883
|
-
|
|
7884
|
-
objectId: SUI_CLOCK_OBJECT_ID7,
|
|
7885
|
-
mutable: false,
|
|
7886
|
-
initialSharedVersion: "1"
|
|
7887
|
-
})
|
|
7743
|
+
clockObjectRef
|
|
7888
7744
|
],
|
|
7889
7745
|
[]
|
|
7890
7746
|
);
|
|
@@ -7900,11 +7756,7 @@ var generateReferralNormalMethod = ({
|
|
|
7900
7756
|
referralIds.referralBindings,
|
|
7901
7757
|
referralIds.authorizedWitnessList,
|
|
7902
7758
|
referralIds.referralTiers,
|
|
7903
|
-
|
|
7904
|
-
objectId: SUI_CLOCK_OBJECT_ID7,
|
|
7905
|
-
mutable: false,
|
|
7906
|
-
initialSharedVersion: "1"
|
|
7907
|
-
})
|
|
7759
|
+
clockObjectRef
|
|
7908
7760
|
],
|
|
7909
7761
|
[coinType]
|
|
7910
7762
|
);
|
|
@@ -7918,11 +7770,7 @@ var generateReferralNormalMethod = ({
|
|
|
7918
7770
|
referralIds.version,
|
|
7919
7771
|
ticket,
|
|
7920
7772
|
referralIds.referralRevenuePool,
|
|
7921
|
-
|
|
7922
|
-
objectId: SUI_CLOCK_OBJECT_ID7,
|
|
7923
|
-
mutable: false,
|
|
7924
|
-
initialSharedVersion: "1"
|
|
7925
|
-
})
|
|
7773
|
+
clockObjectRef
|
|
7926
7774
|
],
|
|
7927
7775
|
[coinType]
|
|
7928
7776
|
);
|
|
@@ -7936,11 +7784,7 @@ var generateReferralNormalMethod = ({
|
|
|
7936
7784
|
referralIds.version,
|
|
7937
7785
|
referralIds.referralRevenuePool,
|
|
7938
7786
|
veScaKey,
|
|
7939
|
-
|
|
7940
|
-
objectId: SUI_CLOCK_OBJECT_ID7,
|
|
7941
|
-
mutable: false,
|
|
7942
|
-
initialSharedVersion: "1"
|
|
7943
|
-
})
|
|
7787
|
+
clockObjectRef
|
|
7944
7788
|
],
|
|
7945
7789
|
[coinType]
|
|
7946
7790
|
);
|
|
@@ -8381,6 +8225,16 @@ var ScallopIndexer = class {
|
|
|
8381
8225
|
async getCoinPrice(poolCoinName) {
|
|
8382
8226
|
return (await this.getMarketPool(poolCoinName))?.coinPrice ?? 0;
|
|
8383
8227
|
}
|
|
8228
|
+
async getCoinPrices() {
|
|
8229
|
+
const marketPools = await this.getMarketPools();
|
|
8230
|
+
return Object.entries(marketPools).reduce(
|
|
8231
|
+
(prev, [coinName, market]) => {
|
|
8232
|
+
prev[coinName] = market.coinPrice;
|
|
8233
|
+
return prev;
|
|
8234
|
+
},
|
|
8235
|
+
{}
|
|
8236
|
+
);
|
|
8237
|
+
}
|
|
8384
8238
|
};
|
|
8385
8239
|
|
|
8386
8240
|
// src/models/scallopQuery.ts
|
|
@@ -8539,8 +8393,8 @@ var ScallopQuery = class {
|
|
|
8539
8393
|
* @param obligationId - The obligation id.
|
|
8540
8394
|
* @return Obligation data.
|
|
8541
8395
|
*/
|
|
8542
|
-
async queryObligation(obligationId) {
|
|
8543
|
-
return queryObligation(this, obligationId);
|
|
8396
|
+
async queryObligation(obligationId, args) {
|
|
8397
|
+
return queryObligation(this, obligationId, args?.version, args?.market);
|
|
8544
8398
|
}
|
|
8545
8399
|
/**
|
|
8546
8400
|
* Get all asset coin amounts.
|
|
@@ -8958,19 +8812,31 @@ var ScallopQuery = class {
|
|
|
8958
8812
|
async getCoinPriceByIndexer(poolName) {
|
|
8959
8813
|
return this.indexer.getCoinPrice(poolName);
|
|
8960
8814
|
}
|
|
8815
|
+
/**
|
|
8816
|
+
* Get all supported pool price from indexer
|
|
8817
|
+
* @returns prices data
|
|
8818
|
+
*/
|
|
8819
|
+
async getCoinPricesByIndexer() {
|
|
8820
|
+
return this.indexer.getCoinPrices();
|
|
8821
|
+
}
|
|
8961
8822
|
/**
|
|
8962
8823
|
* Get all coin prices, including sCoin
|
|
8963
8824
|
* @returns prices data
|
|
8964
8825
|
*/
|
|
8965
8826
|
async getAllCoinPrices(args) {
|
|
8966
|
-
return getAllCoinPrices(
|
|
8827
|
+
return getAllCoinPrices(
|
|
8828
|
+
this,
|
|
8829
|
+
args?.marketPools,
|
|
8830
|
+
args?.coinPrices,
|
|
8831
|
+
args?.indexer
|
|
8832
|
+
);
|
|
8967
8833
|
}
|
|
8968
8834
|
/**
|
|
8969
8835
|
* Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
|
|
8970
8836
|
* @returns
|
|
8971
8837
|
*/
|
|
8972
|
-
async getPoolAddresses(
|
|
8973
|
-
return getAllAddresses(this,
|
|
8838
|
+
async getPoolAddresses(poolNames) {
|
|
8839
|
+
return getAllAddresses(this, poolNames);
|
|
8974
8840
|
}
|
|
8975
8841
|
/**
|
|
8976
8842
|
* Get user portfolio
|
|
@@ -8982,6 +8848,33 @@ var ScallopQuery = class {
|
|
|
8982
8848
|
args?.indexer ?? false
|
|
8983
8849
|
);
|
|
8984
8850
|
}
|
|
8851
|
+
/**
|
|
8852
|
+
* Get both primary and secondary price update policy objects
|
|
8853
|
+
* @returns price update policies
|
|
8854
|
+
*/
|
|
8855
|
+
async getPriceUpdatePolicies() {
|
|
8856
|
+
return await getPriceUpdatePolicies(this.address);
|
|
8857
|
+
}
|
|
8858
|
+
/**
|
|
8859
|
+
* Return the supported primary and secondary oracles for all supported pool assets
|
|
8860
|
+
* @returns
|
|
8861
|
+
*/
|
|
8862
|
+
async getAssetOracles() {
|
|
8863
|
+
const [primary, secondary] = await Promise.all([
|
|
8864
|
+
getAssetOracles(this.utils, "primary"),
|
|
8865
|
+
getAssetOracles(this.utils, "secondary")
|
|
8866
|
+
]);
|
|
8867
|
+
return SUPPORT_POOLS.reduce(
|
|
8868
|
+
(acc, pool) => {
|
|
8869
|
+
acc[pool] = {
|
|
8870
|
+
primary: primary[pool] ?? [],
|
|
8871
|
+
secondary: secondary[pool] ?? []
|
|
8872
|
+
};
|
|
8873
|
+
return acc;
|
|
8874
|
+
},
|
|
8875
|
+
{}
|
|
8876
|
+
);
|
|
8877
|
+
}
|
|
8985
8878
|
};
|
|
8986
8879
|
|
|
8987
8880
|
// src/models/scallopBuilder.ts
|
|
@@ -9993,6 +9886,7 @@ export {
|
|
|
9993
9886
|
stakeMarketCoins,
|
|
9994
9887
|
suiBridgeCoins,
|
|
9995
9888
|
voloCoinIds,
|
|
9996
|
-
wormholeCoinIds
|
|
9889
|
+
wormholeCoinIds,
|
|
9890
|
+
xOracleList
|
|
9997
9891
|
};
|
|
9998
9892
|
//# sourceMappingURL=index.mjs.map
|