@scallop-io/sui-scallop-sdk 1.4.7 → 1.4.9
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 +6 -6
- package/dist/constants/enum.d.ts +2 -2
- package/dist/constants/poolAddress.d.ts +1 -1
- package/dist/index.js +135 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +135 -70
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopQuery.d.ts +55 -41
- package/dist/models/scallopUtils.d.ts +2 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +2 -0
- package/dist/queries/coreQuery.d.ts +1 -0
- package/dist/queries/poolAddressesQuery.d.ts +2 -2
- package/dist/queries/portfolioQuery.d.ts +46 -39
- package/dist/queries/priceQuery.d.ts +2 -0
- package/dist/queries/sCoinQuery.d.ts +1 -1
- package/package.json +1 -1
- package/src/constants/coinGecko.ts +1 -0
- package/src/constants/common.ts +4 -1
- package/src/constants/enum.ts +38 -20
- package/src/constants/poolAddress.ts +47 -18
- package/src/constants/pyth.ts +1 -0
- package/src/constants/testAddress.ts +3 -0
- package/src/models/scallop.ts +1 -0
- package/src/models/scallopCache.ts +1 -1
- package/src/models/scallopQuery.ts +8 -1
- package/src/queries/poolAddressesQuery.ts +7 -6
- package/src/queries/portfolioQuery.ts +54 -29
|
@@ -89,6 +89,7 @@ export declare class ScallopQuery {
|
|
|
89
89
|
}): Promise<{
|
|
90
90
|
usdc?: import("../types").MarketCollateral | undefined;
|
|
91
91
|
sbeth?: import("../types").MarketCollateral | undefined;
|
|
92
|
+
sbusdt?: import("../types").MarketCollateral | undefined;
|
|
92
93
|
weth?: import("../types").MarketCollateral | undefined;
|
|
93
94
|
wbtc?: import("../types").MarketCollateral | undefined;
|
|
94
95
|
wusdc?: import("../types").MarketCollateral | undefined;
|
|
@@ -300,6 +301,7 @@ export declare class ScallopQuery {
|
|
|
300
301
|
}): Promise<{
|
|
301
302
|
usdc?: import("../types").BorrowIncentivePool | undefined;
|
|
302
303
|
sbeth?: import("../types").BorrowIncentivePool | undefined;
|
|
304
|
+
sbusdt?: import("../types").BorrowIncentivePool | undefined;
|
|
303
305
|
weth?: import("../types").BorrowIncentivePool | undefined;
|
|
304
306
|
wbtc?: import("../types").BorrowIncentivePool | undefined;
|
|
305
307
|
wusdc?: import("../types").BorrowIncentivePool | undefined;
|
|
@@ -326,6 +328,7 @@ export declare class ScallopQuery {
|
|
|
326
328
|
getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: SupportBorrowIncentiveCoins[]): Promise<{
|
|
327
329
|
usdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
328
330
|
sbeth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
331
|
+
sbusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
329
332
|
weth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
330
333
|
wbtc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
331
334
|
wusdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
@@ -353,9 +356,11 @@ export declare class ScallopQuery {
|
|
|
353
356
|
getLendings(poolCoinNames?: SupportPoolCoins[], ownerAddress?: string, args?: {
|
|
354
357
|
indexer?: boolean;
|
|
355
358
|
marketPools?: MarketPools;
|
|
359
|
+
coinPrices?: CoinPrices;
|
|
356
360
|
}): Promise<{
|
|
357
361
|
usdc?: import("../types").Lending | undefined;
|
|
358
362
|
sbeth?: import("../types").Lending | undefined;
|
|
363
|
+
sbusdt?: import("../types").Lending | undefined;
|
|
359
364
|
weth?: import("../types").Lending | undefined;
|
|
360
365
|
wbtc?: import("../types").Lending | undefined;
|
|
361
366
|
wusdc?: import("../types").Lending | undefined;
|
|
@@ -399,6 +404,7 @@ export declare class ScallopQuery {
|
|
|
399
404
|
collaterals: MarketCollaterals;
|
|
400
405
|
pools: MarketPools;
|
|
401
406
|
};
|
|
407
|
+
coinPrices?: CoinPrices;
|
|
402
408
|
}): Promise<{
|
|
403
409
|
[x: string]: import("../types").ObligationAccount | undefined;
|
|
404
410
|
}>;
|
|
@@ -485,7 +491,7 @@ export declare class ScallopQuery {
|
|
|
485
491
|
* @param ownerAddress - The owner address.
|
|
486
492
|
* @return All market sCoin amounts.
|
|
487
493
|
*/
|
|
488
|
-
getSCoinAmounts(sCoinNames?: SupportSCoin[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<"susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd", number>>>;
|
|
494
|
+
getSCoinAmounts(sCoinNames?: SupportSCoin[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<"susdc" | "ssbeth" | "ssbusdt" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd", number>>>;
|
|
489
495
|
/**
|
|
490
496
|
* Get sCoin amount.
|
|
491
497
|
*
|
|
@@ -500,7 +506,7 @@ export declare class ScallopQuery {
|
|
|
500
506
|
* @returns
|
|
501
507
|
*/
|
|
502
508
|
getSCoinSwapRate(fromSCoin: SupportSCoin, toSCoin: SupportSCoin): Promise<number>;
|
|
503
|
-
getFlashLoanFees(assetCoinNames?: SupportAssetCoins[]): Promise<Record<"usdc" | "sbeth" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd", number>>;
|
|
509
|
+
getFlashLoanFees(assetCoinNames?: SupportAssetCoins[]): Promise<Record<"usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd", number>>;
|
|
504
510
|
/**
|
|
505
511
|
* Get supply limit of lending pool
|
|
506
512
|
*/
|
|
@@ -533,6 +539,7 @@ export declare class ScallopQuery {
|
|
|
533
539
|
}): Promise<{
|
|
534
540
|
susdc?: number | undefined;
|
|
535
541
|
ssbeth?: number | undefined;
|
|
542
|
+
ssbusdt?: number | undefined;
|
|
536
543
|
sweth?: number | undefined;
|
|
537
544
|
swbtc?: number | undefined;
|
|
538
545
|
swusdc?: number | undefined;
|
|
@@ -549,6 +556,7 @@ export declare class ScallopQuery {
|
|
|
549
556
|
sfdusd?: number | undefined;
|
|
550
557
|
usdc?: number | undefined;
|
|
551
558
|
sbeth?: number | undefined;
|
|
559
|
+
sbusdt?: number | undefined;
|
|
552
560
|
weth?: number | undefined;
|
|
553
561
|
wbtc?: number | undefined;
|
|
554
562
|
wusdc?: number | undefined;
|
|
@@ -570,7 +578,7 @@ export declare class ScallopQuery {
|
|
|
570
578
|
* Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
|
|
571
579
|
* @returns
|
|
572
580
|
*/
|
|
573
|
-
getPoolAddresses(): Promise<import("../types").OptionalKeys<Record<"usdc" | "sbeth" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd", {
|
|
581
|
+
getPoolAddresses(): Promise<import("../types").OptionalKeys<Record<"usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd", {
|
|
574
582
|
lendingPoolAddress?: string;
|
|
575
583
|
collateralPoolAddress?: string;
|
|
576
584
|
borrowDynamic?: string;
|
|
@@ -584,7 +592,7 @@ export declare class ScallopQuery {
|
|
|
584
592
|
supplyLimitKey?: string;
|
|
585
593
|
borrowLimitKey?: string;
|
|
586
594
|
isolatedAssetKey?: string;
|
|
587
|
-
|
|
595
|
+
coinMetadataId?: string;
|
|
588
596
|
borrowIncentivePoolId?: string;
|
|
589
597
|
coinType?: string;
|
|
590
598
|
}>>>;
|
|
@@ -595,54 +603,60 @@ export declare class ScallopQuery {
|
|
|
595
603
|
walletAddress?: string;
|
|
596
604
|
indexer?: boolean;
|
|
597
605
|
}): Promise<{
|
|
606
|
+
totalLockedScaValue: number;
|
|
598
607
|
lendings: {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
608
|
+
suppliedCoin: number;
|
|
609
|
+
suppliedValue: number;
|
|
610
|
+
stakedCoin: number;
|
|
611
|
+
coinName: "usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd";
|
|
612
|
+
symbol: string;
|
|
613
|
+
coinType: string;
|
|
614
|
+
coinPrice: number;
|
|
615
|
+
coinDecimals: number;
|
|
616
|
+
supplyApr: number;
|
|
617
|
+
supplyApy: number;
|
|
618
|
+
incentiveApr: number;
|
|
619
|
+
}[];
|
|
620
|
+
borrowings: {
|
|
621
|
+
obligationId: string;
|
|
622
|
+
totalDebtsInUsd: number;
|
|
623
|
+
totalCollateralInUsd: number;
|
|
624
|
+
riskLevel: number;
|
|
625
|
+
availableCollateralInUsd: number;
|
|
626
|
+
totalUnhealthyCollateralInUsd: number;
|
|
627
|
+
borrowedPools: {
|
|
628
|
+
coinName: "usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd";
|
|
605
629
|
symbol: string;
|
|
630
|
+
coinDecimals: number;
|
|
606
631
|
coinType: string;
|
|
607
632
|
coinPrice: number;
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
borrowings: {
|
|
615
|
-
obligations: {
|
|
616
|
-
obligationId: string;
|
|
617
|
-
totalDebtsInUsd: number;
|
|
618
|
-
totalCollateralInUsd: number;
|
|
619
|
-
riskLevel: number;
|
|
620
|
-
availableCollateralInUsd: number;
|
|
621
|
-
totalUnhealthyCollateralInUsd: number;
|
|
622
|
-
borrowedPools: {
|
|
623
|
-
coinName: "usdc" | "sbeth" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd";
|
|
633
|
+
borrowedCoin: number;
|
|
634
|
+
borrowedValueInUsd: number;
|
|
635
|
+
borrowApr: number | undefined;
|
|
636
|
+
borrowApy: number | undefined;
|
|
637
|
+
incentiveInfos: {
|
|
638
|
+
coinName: "usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "susdc" | "ssbeth" | "ssbusdt" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd";
|
|
624
639
|
symbol: string;
|
|
625
|
-
coinDecimals: number;
|
|
626
640
|
coinType: string;
|
|
627
|
-
|
|
628
|
-
borrowedCoin: number;
|
|
629
|
-
borrowedValueInUsd: number;
|
|
630
|
-
borrowApr: number | undefined;
|
|
631
|
-
borrowApy: number | undefined;
|
|
632
|
-
incentiveInfos: {
|
|
633
|
-
coinName: "usdc" | "sbeth" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd";
|
|
634
|
-
symbol: string;
|
|
635
|
-
coinType: string;
|
|
636
|
-
incentiveApr: number;
|
|
637
|
-
}[];
|
|
641
|
+
incentiveApr: number;
|
|
638
642
|
}[];
|
|
639
643
|
}[];
|
|
640
|
-
|
|
641
|
-
totalCollateralValue: number;
|
|
642
|
-
};
|
|
644
|
+
}[];
|
|
643
645
|
pendingRewards: {
|
|
644
646
|
lendings: any;
|
|
645
647
|
borrowIncentives: any;
|
|
646
648
|
};
|
|
649
|
+
veScas: {
|
|
650
|
+
veScaKey: string;
|
|
651
|
+
coinPrice: number;
|
|
652
|
+
lockedScaInCoin: number;
|
|
653
|
+
lockedScaInUsd: number;
|
|
654
|
+
currentVeScaBalance: number;
|
|
655
|
+
remainingLockPeriodInDays: number;
|
|
656
|
+
unlockAt: number;
|
|
657
|
+
}[];
|
|
658
|
+
totalDebtValue: number;
|
|
659
|
+
totalCollateralValue: number;
|
|
660
|
+
totalSupplyValue: number;
|
|
647
661
|
}>;
|
|
648
662
|
}
|
|
@@ -65,7 +65,7 @@ export declare class ScallopUtils {
|
|
|
65
65
|
* if no `scallop_...` is encountered, return coinName
|
|
66
66
|
* @return sCoin name
|
|
67
67
|
*/
|
|
68
|
-
parseSCoinTypeNameToMarketCoinName(coinName: string): "susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd";
|
|
68
|
+
parseSCoinTypeNameToMarketCoinName(coinName: string): "susdc" | "ssbeth" | "ssbusdt" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd";
|
|
69
69
|
/**
|
|
70
70
|
* Convert sCoin name into sCoin type
|
|
71
71
|
* @param sCoinName
|
|
@@ -77,7 +77,7 @@ export declare class ScallopUtils {
|
|
|
77
77
|
* @param sCoinType
|
|
78
78
|
* @returns sCoin name
|
|
79
79
|
*/
|
|
80
|
-
parseSCoinNameFromType(sCoinType: string): "susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd";
|
|
80
|
+
parseSCoinNameFromType(sCoinType: string): "susdc" | "ssbeth" | "ssbusdt" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd";
|
|
81
81
|
/**
|
|
82
82
|
* Convert sCoin name into its underlying coin type
|
|
83
83
|
* @param sCoinName
|
|
@@ -18,6 +18,7 @@ export declare const queryBorrowIncentivePools: (address: ScallopAddress) => Pro
|
|
|
18
18
|
export declare const getBorrowIncentivePools: (query: ScallopQuery, borrowIncentiveCoinNames?: SupportBorrowIncentiveCoins[], indexer?: boolean, marketPools?: MarketPools, coinPrices?: CoinPrices) => Promise<{
|
|
19
19
|
usdc?: BorrowIncentivePool | undefined;
|
|
20
20
|
sbeth?: BorrowIncentivePool | undefined;
|
|
21
|
+
sbusdt?: BorrowIncentivePool | undefined;
|
|
21
22
|
weth?: BorrowIncentivePool | undefined;
|
|
22
23
|
wbtc?: BorrowIncentivePool | undefined;
|
|
23
24
|
wusdc?: BorrowIncentivePool | undefined;
|
|
@@ -46,6 +47,7 @@ export declare const queryBorrowIncentiveAccounts: ({ utils, }: {
|
|
|
46
47
|
}, obligationId: string | SuiObjectRef, borrowIncentiveCoinNames?: SupportBorrowIncentiveCoins[]) => Promise<{
|
|
47
48
|
usdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
48
49
|
sbeth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
50
|
+
sbusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
49
51
|
weth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
50
52
|
wbtc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
51
53
|
wusdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
|
|
@@ -68,6 +68,7 @@ export declare const getMarketPool: (query: ScallopQuery, poolCoinName: SupportP
|
|
|
68
68
|
export declare const getMarketCollaterals: (query: ScallopQuery, collateralCoinNames?: SupportCollateralCoins[], indexer?: boolean) => Promise<{
|
|
69
69
|
usdc?: MarketCollateral | undefined;
|
|
70
70
|
sbeth?: MarketCollateral | undefined;
|
|
71
|
+
sbusdt?: MarketCollateral | undefined;
|
|
71
72
|
weth?: MarketCollateral | undefined;
|
|
72
73
|
wbtc?: MarketCollateral | undefined;
|
|
73
74
|
wusdc?: MarketCollateral | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScallopQuery } from 'src/models';
|
|
2
2
|
import { OptionalKeys } from 'src/types';
|
|
3
|
-
export declare const getAllAddresses: (query: ScallopQuery) => Promise<OptionalKeys<Record<"usdc" | "sbeth" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd", {
|
|
3
|
+
export declare const getAllAddresses: (query: ScallopQuery) => Promise<OptionalKeys<Record<"usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd", {
|
|
4
4
|
lendingPoolAddress?: string;
|
|
5
5
|
collateralPoolAddress?: string;
|
|
6
6
|
borrowDynamic?: string;
|
|
@@ -14,7 +14,7 @@ export declare const getAllAddresses: (query: ScallopQuery) => Promise<OptionalK
|
|
|
14
14
|
supplyLimitKey?: string;
|
|
15
15
|
borrowLimitKey?: string;
|
|
16
16
|
isolatedAssetKey?: string;
|
|
17
|
-
|
|
17
|
+
coinMetadataId?: string;
|
|
18
18
|
borrowIncentivePoolId?: string;
|
|
19
19
|
coinType?: string;
|
|
20
20
|
}>>>;
|
|
@@ -10,9 +10,10 @@ import { SuiObjectRef } from '@mysten/sui/client';
|
|
|
10
10
|
* @param indexer - Whether to use indexer.
|
|
11
11
|
* @return User lending infomation for specific pools.
|
|
12
12
|
*/
|
|
13
|
-
export declare const getLendings: (query: ScallopQuery, poolCoinNames?: SupportPoolCoins[], ownerAddress?: string, marketPools?: MarketPools, indexer?: boolean) => Promise<{
|
|
13
|
+
export declare const getLendings: (query: ScallopQuery, poolCoinNames?: SupportPoolCoins[], ownerAddress?: string, marketPools?: MarketPools, coinPrices?: CoinPrices, indexer?: boolean) => Promise<{
|
|
14
14
|
usdc?: Lending | undefined;
|
|
15
15
|
sbeth?: Lending | undefined;
|
|
16
|
+
sbusdt?: Lending | undefined;
|
|
16
17
|
weth?: Lending | undefined;
|
|
17
18
|
wbtc?: Lending | undefined;
|
|
18
19
|
wusdc?: Lending | undefined;
|
|
@@ -58,7 +59,7 @@ export declare const getLending: (query: ScallopQuery, poolCoinName: SupportPool
|
|
|
58
59
|
export declare const getObligationAccounts: (query: ScallopQuery, ownerAddress?: string, market?: {
|
|
59
60
|
pools: MarketPools;
|
|
60
61
|
collaterals: MarketCollaterals;
|
|
61
|
-
}, indexer?: boolean) => Promise<{
|
|
62
|
+
}, coinPrices?: CoinPrices, indexer?: boolean) => Promise<{
|
|
62
63
|
[x: string]: ObligationAccount | undefined;
|
|
63
64
|
}>;
|
|
64
65
|
/**
|
|
@@ -82,53 +83,59 @@ export declare const getTotalValueLocked: (query: ScallopQuery, indexer?: boolea
|
|
|
82
83
|
* Get user portfolio by wallet address
|
|
83
84
|
*/
|
|
84
85
|
export declare const getUserPortfolio: (query: ScallopQuery, walletAddress: string, indexer?: boolean) => Promise<{
|
|
86
|
+
totalLockedScaValue: number;
|
|
85
87
|
lendings: {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
suppliedCoin: number;
|
|
89
|
+
suppliedValue: number;
|
|
90
|
+
stakedCoin: number;
|
|
91
|
+
coinName: "usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd";
|
|
92
|
+
symbol: string;
|
|
93
|
+
coinType: string;
|
|
94
|
+
coinPrice: number;
|
|
95
|
+
coinDecimals: number;
|
|
96
|
+
supplyApr: number;
|
|
97
|
+
supplyApy: number;
|
|
98
|
+
incentiveApr: number;
|
|
99
|
+
}[];
|
|
100
|
+
borrowings: {
|
|
101
|
+
obligationId: string;
|
|
102
|
+
totalDebtsInUsd: number;
|
|
103
|
+
totalCollateralInUsd: number;
|
|
104
|
+
riskLevel: number;
|
|
105
|
+
availableCollateralInUsd: number;
|
|
106
|
+
totalUnhealthyCollateralInUsd: number;
|
|
107
|
+
borrowedPools: {
|
|
108
|
+
coinName: "usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd";
|
|
92
109
|
symbol: string;
|
|
110
|
+
coinDecimals: number;
|
|
93
111
|
coinType: string;
|
|
94
112
|
coinPrice: number;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
borrowings: {
|
|
102
|
-
obligations: {
|
|
103
|
-
obligationId: string;
|
|
104
|
-
totalDebtsInUsd: number;
|
|
105
|
-
totalCollateralInUsd: number;
|
|
106
|
-
riskLevel: number;
|
|
107
|
-
availableCollateralInUsd: number;
|
|
108
|
-
totalUnhealthyCollateralInUsd: number;
|
|
109
|
-
borrowedPools: {
|
|
110
|
-
coinName: "usdc" | "sbeth" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd";
|
|
113
|
+
borrowedCoin: number;
|
|
114
|
+
borrowedValueInUsd: number;
|
|
115
|
+
borrowApr: number | undefined;
|
|
116
|
+
borrowApy: number | undefined;
|
|
117
|
+
incentiveInfos: {
|
|
118
|
+
coinName: "usdc" | "sbeth" | "sbusdt" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "susdc" | "ssbeth" | "ssbusdt" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd";
|
|
111
119
|
symbol: string;
|
|
112
|
-
coinDecimals: number;
|
|
113
120
|
coinType: string;
|
|
114
|
-
|
|
115
|
-
borrowedCoin: number;
|
|
116
|
-
borrowedValueInUsd: number;
|
|
117
|
-
borrowApr: number | undefined;
|
|
118
|
-
borrowApy: number | undefined;
|
|
119
|
-
incentiveInfos: {
|
|
120
|
-
coinName: "usdc" | "sbeth" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd";
|
|
121
|
-
symbol: string;
|
|
122
|
-
coinType: string;
|
|
123
|
-
incentiveApr: number;
|
|
124
|
-
}[];
|
|
121
|
+
incentiveApr: number;
|
|
125
122
|
}[];
|
|
126
123
|
}[];
|
|
127
|
-
|
|
128
|
-
totalCollateralValue: number;
|
|
129
|
-
};
|
|
124
|
+
}[];
|
|
130
125
|
pendingRewards: {
|
|
131
126
|
lendings: any;
|
|
132
127
|
borrowIncentives: any;
|
|
133
128
|
};
|
|
129
|
+
veScas: {
|
|
130
|
+
veScaKey: string;
|
|
131
|
+
coinPrice: number;
|
|
132
|
+
lockedScaInCoin: number;
|
|
133
|
+
lockedScaInUsd: number;
|
|
134
|
+
currentVeScaBalance: number;
|
|
135
|
+
remainingLockPeriodInDays: number;
|
|
136
|
+
unlockAt: number;
|
|
137
|
+
}[];
|
|
138
|
+
totalDebtValue: number;
|
|
139
|
+
totalCollateralValue: number;
|
|
140
|
+
totalSupplyValue: number;
|
|
134
141
|
}>;
|
|
@@ -17,6 +17,7 @@ export declare const getPythPrices: ({ address, }: {
|
|
|
17
17
|
export declare const getAllCoinPrices: (query: ScallopQuery, marketPools?: MarketPools, coinPrices?: CoinPrices) => Promise<{
|
|
18
18
|
susdc?: number | undefined;
|
|
19
19
|
ssbeth?: number | undefined;
|
|
20
|
+
ssbusdt?: number | undefined;
|
|
20
21
|
sweth?: number | undefined;
|
|
21
22
|
swbtc?: number | undefined;
|
|
22
23
|
swusdc?: number | undefined;
|
|
@@ -33,6 +34,7 @@ export declare const getAllCoinPrices: (query: ScallopQuery, marketPools?: Marke
|
|
|
33
34
|
sfdusd?: number | undefined;
|
|
34
35
|
usdc?: number | undefined;
|
|
35
36
|
sbeth?: number | undefined;
|
|
37
|
+
sbusdt?: number | undefined;
|
|
36
38
|
weth?: number | undefined;
|
|
37
39
|
wbtc?: number | undefined;
|
|
38
40
|
wusdc?: number | undefined;
|
|
@@ -19,7 +19,7 @@ export declare const getSCoinTotalSupply: ({ utils, }: {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const getSCoinAmounts: ({ utils, }: {
|
|
21
21
|
utils: ScallopUtils;
|
|
22
|
-
}, sCoinNames?: SupportSCoin[], ownerAddress?: string) => Promise<OptionalKeys<Record<"susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd", number>>>;
|
|
22
|
+
}, sCoinNames?: SupportSCoin[], ownerAddress?: string) => Promise<OptionalKeys<Record<"susdc" | "ssbeth" | "ssbusdt" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd", number>>>;
|
|
23
23
|
/**
|
|
24
24
|
* Query owned sCoin amount.
|
|
25
25
|
*
|
package/package.json
CHANGED
package/src/constants/common.ts
CHANGED
|
@@ -32,6 +32,7 @@ export const OLD_BORROW_INCENTIVE_PROTOCOL_ID =
|
|
|
32
32
|
export const SUPPORT_POOLS = [
|
|
33
33
|
'usdc', // native USDC
|
|
34
34
|
'sbeth', // sui bridge ETH
|
|
35
|
+
'sbusdt', // sui bridge USDT
|
|
35
36
|
'weth',
|
|
36
37
|
'wbtc',
|
|
37
38
|
'wusdc',
|
|
@@ -52,6 +53,7 @@ export const SUPPORT_POOLS = [
|
|
|
52
53
|
export const SUPPORT_COLLATERALS = [
|
|
53
54
|
'usdc', // native USDC
|
|
54
55
|
'sbeth', // sui bridge ETH
|
|
56
|
+
'sbusdt', // sui bridge USDT
|
|
55
57
|
'weth',
|
|
56
58
|
'wbtc',
|
|
57
59
|
'wusdc',
|
|
@@ -82,6 +84,7 @@ export const SUPPORT_SPOOLS = [
|
|
|
82
84
|
export const SUPPORT_SCOIN = [
|
|
83
85
|
'susdc',
|
|
84
86
|
'ssbeth',
|
|
87
|
+
'ssbusdt',
|
|
85
88
|
'ssui',
|
|
86
89
|
'swusdc',
|
|
87
90
|
'swusdt',
|
|
@@ -98,7 +101,7 @@ export const SUPPORT_SCOIN = [
|
|
|
98
101
|
'sfdusd',
|
|
99
102
|
] as const;
|
|
100
103
|
|
|
101
|
-
export const SUPPORT_SUI_BRIDGE = ['sbeth'] as const;
|
|
104
|
+
export const SUPPORT_SUI_BRIDGE = ['sbeth', 'sbusdt'] as const;
|
|
102
105
|
export const SUPPORT_WORMHOLE = [
|
|
103
106
|
'wusdc',
|
|
104
107
|
'wusdt',
|
package/src/constants/enum.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { IS_VE_SCA_TEST } from './common';
|
|
|
4
4
|
export const coinDecimals: types.SupportCoinDecimals = {
|
|
5
5
|
usdc: 6,
|
|
6
6
|
sbeth: 8,
|
|
7
|
+
sbusdt: 6,
|
|
7
8
|
weth: 8,
|
|
8
9
|
wbtc: 8,
|
|
9
10
|
wusdc: 6,
|
|
@@ -22,6 +23,7 @@ export const coinDecimals: types.SupportCoinDecimals = {
|
|
|
22
23
|
susdc: 6,
|
|
23
24
|
sweth: 8,
|
|
24
25
|
ssbeth: 8,
|
|
26
|
+
ssbusdt: 6,
|
|
25
27
|
swbtc: 8,
|
|
26
28
|
swusdc: 6,
|
|
27
29
|
swusdt: 6,
|
|
@@ -41,6 +43,7 @@ export const coinDecimals: types.SupportCoinDecimals = {
|
|
|
41
43
|
export const assetCoins: types.AssetCoins = {
|
|
42
44
|
usdc: 'usdc',
|
|
43
45
|
sbeth: 'sbeth',
|
|
46
|
+
sbusdt: 'sbusdt',
|
|
44
47
|
weth: 'weth',
|
|
45
48
|
wbtc: 'wbtc',
|
|
46
49
|
wusdc: 'wusdc',
|
|
@@ -61,6 +64,7 @@ export const assetCoins: types.AssetCoins = {
|
|
|
61
64
|
export const marketCoins: types.MarketCoins = {
|
|
62
65
|
susdc: 'susdc',
|
|
63
66
|
ssbeth: 'ssbeth',
|
|
67
|
+
ssbusdt: 'ssbusdt',
|
|
64
68
|
sweth: 'sweth',
|
|
65
69
|
swbtc: 'swbtc',
|
|
66
70
|
swusdc: 'swusdc',
|
|
@@ -81,6 +85,7 @@ export const marketCoins: types.MarketCoins = {
|
|
|
81
85
|
export const sCoins: types.SCoins = {
|
|
82
86
|
susdc: 'susdc',
|
|
83
87
|
ssbeth: 'ssbeth',
|
|
88
|
+
ssbusdt: 'ssbusdt',
|
|
84
89
|
sweth: 'sweth',
|
|
85
90
|
swusdc: 'swusdc',
|
|
86
91
|
swusdt: 'swusdt',
|
|
@@ -123,29 +128,35 @@ export const spoolRewardCoins: types.StakeRewardCoins = {
|
|
|
123
128
|
|
|
124
129
|
export const suiBridgeCoins: types.SuiBridgeCoins = {
|
|
125
130
|
sbeth: 'sbeth',
|
|
131
|
+
sbusdt: 'sbusdt',
|
|
126
132
|
};
|
|
127
133
|
|
|
128
134
|
export const coinIds: types.AssetCoinIds = {
|
|
129
|
-
usdc: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7',
|
|
130
135
|
sui: '0x0000000000000000000000000000000000000000000000000000000000000002',
|
|
131
|
-
|
|
136
|
+
cetus: '0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b',
|
|
137
|
+
sca: IS_VE_SCA_TEST
|
|
138
|
+
? '0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524'
|
|
139
|
+
: '0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6',
|
|
140
|
+
// Wormhole assets
|
|
132
141
|
weth: '0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5',
|
|
133
142
|
wbtc: '0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881',
|
|
134
|
-
wusdc: '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf',
|
|
135
|
-
wusdt: '0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c',
|
|
136
143
|
wapt: '0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37',
|
|
137
144
|
wsol: '0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8',
|
|
138
|
-
|
|
145
|
+
// Sui LST
|
|
139
146
|
afsui: '0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc',
|
|
140
147
|
hasui: '0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d',
|
|
141
148
|
vsui: '0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55',
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
149
|
+
// stable coins
|
|
150
|
+
usdc: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7',
|
|
151
|
+
wusdc: '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf',
|
|
152
|
+
wusdt: '0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c',
|
|
145
153
|
fdusd: '0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a',
|
|
146
154
|
// isolated assets
|
|
147
155
|
deep: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270',
|
|
148
156
|
fud: '0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1',
|
|
157
|
+
// Sui bridge assets
|
|
158
|
+
sbeth: '0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29',
|
|
159
|
+
sbusdt: '0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068',
|
|
149
160
|
};
|
|
150
161
|
|
|
151
162
|
export const wormholeCoinIds: types.WormholeCoinIds = {
|
|
@@ -163,35 +174,42 @@ export const voloCoinIds: types.VoloCoinIds = {
|
|
|
163
174
|
|
|
164
175
|
// PROD VERSION
|
|
165
176
|
export const sCoinIds: types.SCoinIds = {
|
|
166
|
-
susdc:
|
|
167
|
-
'0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
|
|
168
|
-
ssbeth:
|
|
169
|
-
'0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH',
|
|
170
177
|
ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI',
|
|
171
|
-
swusdc:
|
|
172
|
-
'0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
173
|
-
swusdt:
|
|
174
|
-
'0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
175
178
|
ssca: '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA',
|
|
176
179
|
scetus:
|
|
177
180
|
'0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS',
|
|
181
|
+
// Wormhole assets
|
|
178
182
|
sweth:
|
|
179
183
|
'0x67540ceb850d418679e69f1fb6b2093d6df78a2a699ffc733f7646096d552e9b::scallop_wormhole_eth::SCALLOP_WORMHOLE_ETH',
|
|
184
|
+
swsol:
|
|
185
|
+
'0x1392650f2eca9e3f6ffae3ff89e42a3590d7102b80e2b430f674730bc30d3259::scallop_wormhole_sol::SCALLOP_WORMHOLE_SOL',
|
|
186
|
+
swbtc:
|
|
187
|
+
'0x2cf76a9cf5d3337961d1154283234f94da2dcff18544dfe5cbdef65f319591b5::scallop_wormhole_btc::SCALLOP_WORMHOLE_BTC',
|
|
188
|
+
// Sui LST
|
|
180
189
|
safsui:
|
|
181
190
|
'0x00671b1fa2a124f5be8bdae8b91ee711462c5d9e31bda232e70fd9607b523c88::scallop_af_sui::SCALLOP_AF_SUI',
|
|
182
191
|
shasui:
|
|
183
192
|
'0x9a2376943f7d22f88087c259c5889925f332ca4347e669dc37d54c2bf651af3c::scallop_ha_sui::SCALLOP_HA_SUI',
|
|
184
193
|
svsui:
|
|
185
194
|
'0xe1a1cc6bcf0001a015eab84bcc6713393ce20535f55b8b6f35c142e057a25fbe::scallop_v_sui::SCALLOP_V_SUI',
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
195
|
+
// stable coins
|
|
196
|
+
susdc:
|
|
197
|
+
'0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
|
|
198
|
+
swusdc:
|
|
199
|
+
'0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
200
|
+
swusdt:
|
|
201
|
+
'0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
190
202
|
sfdusd:
|
|
191
203
|
'0x6711551c1e7652a270d9fbf0eee25d99594c157cde3cb5fbb49035eb59b1b001::scallop_fdusd::SCALLOP_FDUSD',
|
|
204
|
+
// isolated assets
|
|
192
205
|
sdeep:
|
|
193
206
|
'0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP',
|
|
194
207
|
sfud: '0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD',
|
|
208
|
+
// Sui bridge assets
|
|
209
|
+
ssbeth:
|
|
210
|
+
'0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH',
|
|
211
|
+
ssbusdt:
|
|
212
|
+
'0xb1d7df34829d1513b73ba17cb7ad90c88d1e104bb65ab8f62f13e0cc103783d3::scallop_sb_usdt::SCALLOP_SB_USDT',
|
|
195
213
|
} as const;
|
|
196
214
|
|
|
197
215
|
export const sCoinTypeToName = Object.entries(sCoinIds).reduce(
|