@scallop-io/sui-scallop-sdk 1.4.20 → 1.4.22-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.
@@ -12,6 +12,9 @@ export const POOL_ADDRESSES: OptionalKeys<
12
12
  interestModel: string;
13
13
  borrowFeeKey: string;
14
14
  coinMetadataId: string;
15
+ decimals: number;
16
+ pythFeed: string;
17
+ pythFeedObjectId: string;
15
18
  // optional keys
16
19
  collateralPoolAddress?: string; // not all pool has collateral
17
20
  riskModel?: string;
@@ -26,47 +29,9 @@ export const POOL_ADDRESSES: OptionalKeys<
26
29
  spool?: string;
27
30
  spoolReward?: string;
28
31
  spoolName?: string;
29
- decimals: number;
30
32
  }
31
33
  >
32
34
  > = {
33
- usdc: {
34
- coinName: 'usdc',
35
- symbol: 'USDC',
36
- lendingPoolAddress:
37
- '0xd3be98bf540f7603eeb550c0c0a19dbfc78822f25158b5fa84ebd9609def415f',
38
- collateralPoolAddress:
39
- '0x8f0d529ba179c5b3d508213003eab813aaae31f78226099639b9a69d1aec17af',
40
- borrowDynamic:
41
- '0x77837ecd4f26fac9a410fff594f2c0bd3288904a15492ca77cb8a52684dbb866',
42
- interestModel:
43
- '0xaae3f179d63009380cbdcb9acb12907afc9c3cb79cc3460be296a9c6d28f3ff3',
44
- riskModel:
45
- '0x198b24db213bfeb8b3c80ae63dde92e32fd24984d25da8233ff777b851edd574',
46
- borrowFeeKey:
47
- '0xd37c5316cfe0a5967d14264fa6b423f880518b294a1ee6581ccbb49ccc401fb8',
48
- supplyLimitKey:
49
- '0x4be9ae54ac4d320f4f9c14cae78cb85c8e0e67791dd9bdba6d2db20614a28a24',
50
- borrowLimitKey:
51
- '0x6b01093cba95b835181f00e3a2c31ed8dfc8d64fe3db0fb80933a09f66e1ccf1',
52
- spool: '0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918',
53
- spoolReward:
54
- '0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166',
55
- sCoinTreasury:
56
- '0xbe6b63021f3d82e0e7e977cdd718ed7c019cf2eba374b7b546220402452f938e',
57
- sCoinType:
58
- '0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
59
- sCoinName: 'susdc',
60
- sCoinSymbol: 'sUSDC',
61
- coinMetadataId:
62
- '0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6',
63
- coinType:
64
- '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
65
- sCoinMetadataId:
66
- '0x763a21eba338e00bc684aaad80491c89eea5f247b59c47df45b17610c9ad58f2',
67
- spoolName: 'susdc',
68
- decimals: 6,
69
- },
70
35
  sbeth: {
71
36
  coinName: 'sbeth',
72
37
  symbol: 'sbETH',
@@ -99,6 +64,10 @@ export const POOL_ADDRESSES: OptionalKeys<
99
64
  sCoinMetadataId:
100
65
  '0xdfdd14d53ed8c7ace7cac8a0eecdfa4c2345e15d9efcbd4e1828f81a107cbe2d',
101
66
  decimals: 8,
67
+ pythFeed:
68
+ 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
69
+ pythFeedObjectId:
70
+ '0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab',
102
71
  },
103
72
  sbusdt: {
104
73
  coinName: 'sbusdt',
@@ -132,6 +101,51 @@ export const POOL_ADDRESSES: OptionalKeys<
132
101
  sCoinMetadataId:
133
102
  '0x1ce77b036043c8fdcc5cd050ed06433ae60296b194c2abf7ade8b7b7c8386d36',
134
103
  decimals: 6,
104
+ pythFeed:
105
+ '2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b',
106
+ pythFeedObjectId:
107
+ '0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572',
108
+ },
109
+ usdc: {
110
+ coinName: 'usdc',
111
+ symbol: 'USDC',
112
+ lendingPoolAddress:
113
+ '0xd3be98bf540f7603eeb550c0c0a19dbfc78822f25158b5fa84ebd9609def415f',
114
+ collateralPoolAddress:
115
+ '0x8f0d529ba179c5b3d508213003eab813aaae31f78226099639b9a69d1aec17af',
116
+ borrowDynamic:
117
+ '0x77837ecd4f26fac9a410fff594f2c0bd3288904a15492ca77cb8a52684dbb866',
118
+ interestModel:
119
+ '0xaae3f179d63009380cbdcb9acb12907afc9c3cb79cc3460be296a9c6d28f3ff3',
120
+ riskModel:
121
+ '0x198b24db213bfeb8b3c80ae63dde92e32fd24984d25da8233ff777b851edd574',
122
+ borrowFeeKey:
123
+ '0xd37c5316cfe0a5967d14264fa6b423f880518b294a1ee6581ccbb49ccc401fb8',
124
+ supplyLimitKey:
125
+ '0x4be9ae54ac4d320f4f9c14cae78cb85c8e0e67791dd9bdba6d2db20614a28a24',
126
+ borrowLimitKey:
127
+ '0x6b01093cba95b835181f00e3a2c31ed8dfc8d64fe3db0fb80933a09f66e1ccf1',
128
+ spool: '0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918',
129
+ spoolReward:
130
+ '0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166',
131
+ sCoinTreasury:
132
+ '0xbe6b63021f3d82e0e7e977cdd718ed7c019cf2eba374b7b546220402452f938e',
133
+ sCoinType:
134
+ '0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
135
+ sCoinName: 'susdc',
136
+ sCoinSymbol: 'sUSDC',
137
+ coinMetadataId:
138
+ '0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6',
139
+ coinType:
140
+ '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
141
+ sCoinMetadataId:
142
+ '0x763a21eba338e00bc684aaad80491c89eea5f247b59c47df45b17610c9ad58f2',
143
+ spoolName: 'susdc',
144
+ decimals: 6,
145
+ pythFeed:
146
+ 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
147
+ pythFeedObjectId:
148
+ '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',
135
149
  },
136
150
  weth: {
137
151
  coinName: 'weth',
@@ -169,6 +183,10 @@ export const POOL_ADDRESSES: OptionalKeys<
169
183
  '0x077d0fd835b559e5b4bb52641f7627ddbf8b200f9b2cf4e28b3514da2a32a4dd',
170
184
  spoolName: 'sweth',
171
185
  decimals: 8,
186
+ pythFeed:
187
+ 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
188
+ pythFeedObjectId:
189
+ '0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab',
172
190
  },
173
191
  wbtc: {
174
192
  coinName: 'wbtc',
@@ -202,6 +220,10 @@ export const POOL_ADDRESSES: OptionalKeys<
202
220
  sCoinMetadataId:
203
221
  '0x1ba5904dae41699683da767c7a97785a55c51ec1253498c8fe1980169a96523d',
204
222
  decimals: 8,
223
+ pythFeed:
224
+ 'e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
225
+ pythFeedObjectId:
226
+ '0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2',
205
227
  },
206
228
  wusdc: {
207
229
  coinName: 'wusdc',
@@ -239,6 +261,10 @@ export const POOL_ADDRESSES: OptionalKeys<
239
261
  '0xdc0595d068621d630f3c7c364dd257f7e3f8079e00c31c8d18755a033c15ae93',
240
262
  spoolName: 'swusdc',
241
263
  decimals: 6,
264
+ pythFeed:
265
+ 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
266
+ pythFeedObjectId:
267
+ '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',
242
268
  },
243
269
  wusdt: {
244
270
  coinName: 'wusdt',
@@ -276,6 +302,10 @@ export const POOL_ADDRESSES: OptionalKeys<
276
302
  '0x171d0f1ca99d5fefb8b2e40b89899bacdc5417a783906ae119b9cb1c113d59ae',
277
303
  spoolName: 'swusdt',
278
304
  decimals: 6,
305
+ pythFeed:
306
+ '2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b',
307
+ pythFeedObjectId:
308
+ '0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572',
279
309
  },
280
310
  sui: {
281
311
  coinName: 'sui',
@@ -313,6 +343,10 @@ export const POOL_ADDRESSES: OptionalKeys<
313
343
  '0xac724644f481f4870ecdc29b9549aa8ea5180f10827c0d97b493f9f65a91455d',
314
344
  spoolName: 'ssui',
315
345
  decimals: 9,
346
+ pythFeed:
347
+ '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
348
+ pythFeedObjectId:
349
+ '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',
316
350
  },
317
351
  wapt: {
318
352
  coinName: 'wapt',
@@ -334,6 +368,10 @@ export const POOL_ADDRESSES: OptionalKeys<
334
368
  coinType:
335
369
  '0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN',
336
370
  decimals: 8,
371
+ pythFeed:
372
+ '03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5',
373
+ pythFeedObjectId:
374
+ '0x7c5b7837c44a69b469325463ac0673ac1aa8435ff44ddb4191c9ae380463647f',
337
375
  },
338
376
  wsol: {
339
377
  coinName: 'wsol',
@@ -367,6 +405,10 @@ export const POOL_ADDRESSES: OptionalKeys<
367
405
  sCoinMetadataId:
368
406
  '0xee202d2013fc09453d695c640088ee08f14afc8f1ae26284b4ebbc4712ff1ba5',
369
407
  decimals: 8,
408
+ pythFeed:
409
+ 'ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
410
+ pythFeedObjectId:
411
+ '0x9d0d275efbd37d8a8855f6f2c761fa5983293dd8ce202ee5196626de8fcd4469',
370
412
  },
371
413
  cetus: {
372
414
  coinName: 'cetus',
@@ -404,6 +446,10 @@ export const POOL_ADDRESSES: OptionalKeys<
404
446
  '0xf022d041455a038d762a091f7a9e9521211f20501bcf8b6913ef5493a023218f',
405
447
  spoolName: 'scetus',
406
448
  decimals: 9,
449
+ pythFeed:
450
+ 'e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef',
451
+ pythFeedObjectId:
452
+ '0x24c0247fb22457a719efac7f670cdc79be321b521460bd6bd2ccfa9f80713b14',
407
453
  },
408
454
  afsui: {
409
455
  coinName: 'afsui',
@@ -441,6 +487,10 @@ export const POOL_ADDRESSES: OptionalKeys<
441
487
  '0xfd81c4d1b4d9d1b8c522e91121d22e94759386b29eafe1cc3888ca0ebe369b9e',
442
488
  spoolName: 'safsui',
443
489
  decimals: 9,
490
+ pythFeed:
491
+ '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
492
+ pythFeedObjectId:
493
+ '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',
444
494
  },
445
495
  hasui: {
446
496
  coinName: 'hasui',
@@ -478,6 +528,10 @@ export const POOL_ADDRESSES: OptionalKeys<
478
528
  '0x0a2a4a25aac50ac79210d710f93cb22db58bc6ee22f213364dda9a709cab2189',
479
529
  spoolName: 'shasui',
480
530
  decimals: 9,
531
+ pythFeed:
532
+ '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
533
+ pythFeedObjectId:
534
+ '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',
481
535
  },
482
536
  vsui: {
483
537
  coinName: 'vsui',
@@ -515,6 +569,10 @@ export const POOL_ADDRESSES: OptionalKeys<
515
569
  '0xa96cc21ddfb6486be4a96cda0c58734e4ddea2a8c04984f9e6121d8fae997ddf',
516
570
  spoolName: 'svsui',
517
571
  decimals: 9,
572
+ pythFeed:
573
+ '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
574
+ pythFeedObjectId:
575
+ '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',
518
576
  },
519
577
  sca: {
520
578
  coinName: 'sca',
@@ -548,6 +606,10 @@ export const POOL_ADDRESSES: OptionalKeys<
548
606
  sCoinMetadataId:
549
607
  '0x27e3877491b308dfac46fb3d9f7dfa6a1e8b7dc3c374e92ecda7976055746964',
550
608
  decimals: 9,
609
+ pythFeed:
610
+ '7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc',
611
+ pythFeedObjectId:
612
+ '0xf6de1d3279a269a597d813cbaca59aa906543ab9a8c64e84a4722f1a20863985',
551
613
  },
552
614
  fud: {
553
615
  coinName: 'fud',
@@ -579,37 +641,43 @@ export const POOL_ADDRESSES: OptionalKeys<
579
641
  sCoinMetadataId:
580
642
  '0x4e03390de36b8c84e0a8297d3d0d08a8a34bed93787e37fcb26bfc26df33226c',
581
643
  decimals: 5,
644
+ pythFeed:
645
+ '6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75',
646
+ pythFeedObjectId:
647
+ '0x4531c3ed0d22f21f5fce882905372006c9aafa30f01db03b789e95a6c50de7b2',
582
648
  },
583
- fdusd: {
584
- coinName: 'fdusd',
585
- symbol: 'FDUSD',
649
+ blub: {
650
+ coinName: 'blub',
651
+ symbol: 'BLUB',
586
652
  lendingPoolAddress:
587
- '0x4f46051a01f05c3ad9aecf29a771aad5c884e1a1888e08d7709085e3a095bc9c',
588
- collateralPoolAddress:
589
- '0x4f6647a9afcfdb62bb9b27e4d1cb7bd7130aca1b4f13fa7164453c869c1681ae',
653
+ '0x4dede1d8eda98647c3fc9838e94a890b73ca37a20764087eb78ba0473edea1a5',
590
654
  borrowDynamic:
591
- '0x4ddcf19b6290a8b048ecb314b14ef7f52c1c5b9ddc9259a2a242cd91d681a085',
655
+ '0xb2e9df6917ff3cb93fc4361102504c2d225913b3860458ef40f83b370601bec2',
592
656
  interestModel:
593
- '0xb57a33706b29d2d253c74c1c0869e6e20da99036338d2b0b7235ab41621ee9dd',
594
- riskModel:
595
- '0xd65fb21758dc1e6184940a1a27efb13228d7cf5e19f6dcca06cc2d996af4a6b9',
657
+ '0xec07bfcf93df52d1c0dabecc88b1ee66445a2fda6b98378c19d8e029022f2012',
596
658
  borrowFeeKey:
597
- '0xafe673a27747b063fa918d2dfe47794e44af553737ac562c2a63186539a07f45',
659
+ '0x59b820845932c1f151793b1c6e605ad993535784ccfaa83e709207d6aed3ab99',
598
660
  supplyLimitKey:
599
- '0x730e0785ba056a7a95f4a6959371a598d7fe782e81c40785c79982ced4cf4e35',
661
+ '0xc25e930484a10498a53562cfb87da47280e842564d455f25e5b80a913002d5a0',
662
+ borrowLimitKey:
663
+ '0xaf4560140b2c6906befd546cc556f7c459964e7c31e20a6e1ab992bbc6d12b7f',
664
+ isolatedAssetKey:
665
+ '0x30a8f1dbf9dc05dae26c25fac6dfa80fa2d886e05e61cefc697b94959dd75007',
600
666
  sCoinTreasury:
601
- '0xdad9bc6293e694f67a5274ea51b596e0bdabfafc585ae6d7e82888e65f1a03e0',
667
+ '0x87d34361dfd0e2accc946684d10b176484f348892f6cc51a829418040c4700e1',
602
668
  sCoinType:
603
- '0x6711551c1e7652a270d9fbf0eee25d99594c157cde3cb5fbb49035eb59b1b001::scallop_fdusd::SCALLOP_FDUSD',
604
- sCoinName: 'sfdusd',
605
- sCoinSymbol: 'sFDUSD',
669
+ '0xe72f65446eabfad2103037af2d49d24599106fb44bf4c046c1e7e9acf6844dd0::scallop_blub::SCALLOP_BLUB',
606
670
  coinMetadataId:
607
- '0xdebee5265a67c186ed87fe93303d33dfe1de53e3b4fd7d9329c2852860acd3e7',
671
+ '0xac32b519790cae96c3317457d903d61d04f1bc8f7710096d80fcba72c7a53703',
608
672
  coinType:
609
- '0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD',
673
+ '0xfa7ac3951fdca92c5200d468d31a365eb03b2be9936fde615e69f0c1274ad3a0::BLUB::BLUB',
610
674
  sCoinMetadataId:
611
- '0xb1529a3b5e5831d19a722493eec19785f613945d3dc984602d44a418f990d73f',
612
- decimals: 6,
675
+ '0xfa11263cb39de80b9e224d7e0391866a7e779d3d62451de82a91ba601bfb1ce3',
676
+ decimals: 2,
677
+ pythFeed:
678
+ '5fc11ffe4975b624be495be038da30e30bee2004d8ae6282b5364577ef4ca92c',
679
+ pythFeedObjectId:
680
+ '0x246658c3324f2477568c78cca622518fbc6969a004b841d81409d24a7ec39b18',
613
681
  },
614
682
  deep: {
615
683
  coinName: 'deep',
@@ -641,5 +709,44 @@ export const POOL_ADDRESSES: OptionalKeys<
641
709
  sCoinMetadataId:
642
710
  '0x2443014594a500a9119e11c6c6a86e865834f496c4614280ce8cace33c0b072e',
643
711
  decimals: 6,
712
+ pythFeed:
713
+ '29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',
714
+ pythFeedObjectId:
715
+ '0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed',
716
+ },
717
+ fdusd: {
718
+ coinName: 'fdusd',
719
+ symbol: 'FDUSD',
720
+ lendingPoolAddress:
721
+ '0x4f46051a01f05c3ad9aecf29a771aad5c884e1a1888e08d7709085e3a095bc9c',
722
+ collateralPoolAddress:
723
+ '0x4f6647a9afcfdb62bb9b27e4d1cb7bd7130aca1b4f13fa7164453c869c1681ae',
724
+ borrowDynamic:
725
+ '0x4ddcf19b6290a8b048ecb314b14ef7f52c1c5b9ddc9259a2a242cd91d681a085',
726
+ interestModel:
727
+ '0xb57a33706b29d2d253c74c1c0869e6e20da99036338d2b0b7235ab41621ee9dd',
728
+ riskModel:
729
+ '0xd65fb21758dc1e6184940a1a27efb13228d7cf5e19f6dcca06cc2d996af4a6b9',
730
+ borrowFeeKey:
731
+ '0xafe673a27747b063fa918d2dfe47794e44af553737ac562c2a63186539a07f45',
732
+ supplyLimitKey:
733
+ '0x730e0785ba056a7a95f4a6959371a598d7fe782e81c40785c79982ced4cf4e35',
734
+ sCoinTreasury:
735
+ '0xdad9bc6293e694f67a5274ea51b596e0bdabfafc585ae6d7e82888e65f1a03e0',
736
+ sCoinType:
737
+ '0x6711551c1e7652a270d9fbf0eee25d99594c157cde3cb5fbb49035eb59b1b001::scallop_fdusd::SCALLOP_FDUSD',
738
+ sCoinName: 'sfdusd',
739
+ sCoinSymbol: 'sFDUSD',
740
+ coinMetadataId:
741
+ '0xdebee5265a67c186ed87fe93303d33dfe1de53e3b4fd7d9329c2852860acd3e7',
742
+ coinType:
743
+ '0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD',
744
+ sCoinMetadataId:
745
+ '0xb1529a3b5e5831d19a722493eec19785f613945d3dc984602d44a418f990d73f',
746
+ decimals: 6,
747
+ pythFeed:
748
+ '0xccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979',
749
+ pythFeedObjectId:
750
+ '0x5f6583b2b0fe1ecf94aaffeaab8a838794693960cea48c0da282d5f4a24be027',
644
751
  },
645
752
  };
@@ -26,4 +26,5 @@ export const PYTH_FEED_IDS: Record<SupportPoolCoins, string> = {
26
26
  fdusd: '0xccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979',
27
27
  deep: '29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',
28
28
  fud: '6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75',
29
+ blub: '5fc11ffe4975b624be495be038da30e30bee2004d8ae6282b5364577ef4ca92c',
29
30
  };
@@ -269,4 +269,15 @@ export class ScallopIndexer {
269
269
  public async getCoinPrice(poolCoinName: SupportPoolCoins): Promise<number> {
270
270
  return (await this.getMarketPool(poolCoinName))?.coinPrice ?? 0;
271
271
  }
272
+
273
+ public async getCoinPrices(): Promise<Record<string, number>> {
274
+ const marketPools = await this.getMarketPools();
275
+ return Object.entries(marketPools).reduce(
276
+ (prev, [coinName, market]) => {
277
+ prev[coinName] = market.coinPrice;
278
+ return prev;
279
+ },
280
+ {} as Record<string, number>
281
+ );
282
+ }
272
283
  }
@@ -851,6 +851,14 @@ export class ScallopQuery {
851
851
  return this.indexer.getCoinPrice(poolName);
852
852
  }
853
853
 
854
+ /**
855
+ * Get all supported pool price from indexer
856
+ * @returns prices data
857
+ */
858
+ public async getCoinPricesByIndexer() {
859
+ return this.indexer.getCoinPrices();
860
+ }
861
+
854
862
  /**
855
863
  * Get all coin prices, including sCoin
856
864
  * @returns prices data
@@ -858,8 +866,14 @@ export class ScallopQuery {
858
866
  public async getAllCoinPrices(args?: {
859
867
  marketPools?: MarketPools;
860
868
  coinPrices?: CoinPrices;
869
+ indexer?: boolean;
861
870
  }) {
862
- return getAllCoinPrices(this, args?.marketPools, args?.coinPrices);
871
+ return getAllCoinPrices(
872
+ this,
873
+ args?.marketPools,
874
+ args?.coinPrices,
875
+ args?.indexer
876
+ );
863
877
  }
864
878
 
865
879
  /**
@@ -170,6 +170,9 @@ export class ScallopUtils {
170
170
  }
171
171
  if (coinName === 'sui')
172
172
  return normalizeStructTag(`${coinPackageId}::sui::SUI`);
173
+ if (coinName === 'blub')
174
+ return normalizeStructTag(`${coinPackageId}::BLUB::BLUB`);
175
+
173
176
  const wormHolePackageIds = [
174
177
  this.address.get('core.coins.wusdc.id') ?? wormholeCoinIds.wusdc,
175
178
  this.address.get('core.coins.wusdt.id') ?? wormholeCoinIds.wusdt,
@@ -1,4 +1,4 @@
1
- import { SUPPORT_POOLS } from 'src/constants';
1
+ import { PYTH_FEED_IDS, SUPPORT_POOLS } from 'src/constants';
2
2
  import { ScallopQuery } from 'src/models';
3
3
  import { OptionalKeys, SupportPoolCoins } from 'src/types';
4
4
 
@@ -30,6 +30,8 @@ export const getAllAddresses = async (query: ScallopQuery) => {
30
30
  sCoinMetadataId?: string;
31
31
  spoolName?: string;
32
32
  decimals: number;
33
+ pythFeed?: string;
34
+ pythFeedObjectId?: string;
33
35
  }
34
36
  >
35
37
  > = {};
@@ -49,6 +51,7 @@ export const getAllAddresses = async (query: ScallopQuery) => {
49
51
  },
50
52
  [] as [SupportPoolCoins, string][]
51
53
  );
54
+
52
55
  const balanceSheetParentId =
53
56
  fields.vault.fields.balance_sheets.fields.table.fields.id.id;
54
57
 
@@ -121,8 +124,10 @@ export const getAllAddresses = async (query: ScallopQuery) => {
121
124
  // @ts-ignore
122
125
  `spool.pools.s${coinName}.rewardPoolId`
123
126
  );
124
- // @ts-ignore
125
- const sCoinType = query.address.get(`scoin.coins.s${coinName}.coinType`);
127
+ const sCoinType = query.address.get(
128
+ // @ts-ignore
129
+ `scoin.coins.s${coinName}.coinType`
130
+ );
126
131
  const sCoinName = sCoinType
127
132
  ? query.utils.parseSCoinName(coinName)
128
133
  : undefined;
@@ -141,6 +146,11 @@ export const getAllAddresses = async (query: ScallopQuery) => {
141
146
  `scoin.coins.s${coinName}.metaData`
142
147
  );
143
148
 
149
+ const pythFeed = PYTH_FEED_IDS[coinName];
150
+ const pythFeedObjectId = query.address.get(
151
+ //@ts-ignore
152
+ `core.coins.${coinName}.oracle.pyth.feedObject`
153
+ );
144
154
  const decimals = query.utils.getCoinDecimal(coinName);
145
155
  const spoolName = spool ? `s${coinName}` : undefined;
146
156
  results[coinName as SupportPoolCoins] = {
@@ -166,6 +176,8 @@ export const getAllAddresses = async (query: ScallopQuery) => {
166
176
  sCoinMetadataId,
167
177
  spoolName,
168
178
  decimals,
179
+ pythFeed,
180
+ pythFeedObjectId,
169
181
  };
170
182
 
171
183
  await new Promise((resolve) => setTimeout(resolve, 500));
@@ -133,16 +133,23 @@ export const getPythPrices = async (
133
133
  export const getAllCoinPrices = async (
134
134
  query: ScallopQuery,
135
135
  marketPools?: MarketPools,
136
- coinPrices?: CoinPrices
136
+ coinPrices?: CoinPrices,
137
+ indexer: boolean = false
137
138
  ) => {
138
- coinPrices = coinPrices ?? (await query.utils.getCoinPrices());
139
+ coinPrices =
140
+ coinPrices ??
141
+ (indexer
142
+ ? await query.getCoinPricesByIndexer()
143
+ : await query.utils.getCoinPrices());
144
+
139
145
  marketPools =
140
146
  marketPools ??
141
- (await query.getMarketPools(undefined, { coinPrices })).pools;
147
+ (await query.getMarketPools(undefined, { coinPrices, indexer })).pools;
142
148
 
143
149
  if (!marketPools) {
144
150
  throw new Error(`Failed to fetch market pool for getAllCoinPrices`);
145
151
  }
152
+
146
153
  const sCoinPrices: OptionalKeys<Record<SupportSCoin, number>> = {};
147
154
  SUPPORT_SCOIN.forEach((sCoinName) => {
148
155
  const coinName = query.utils.parseCoinName(sCoinName);