@defisaver/positions-sdk 0.0.78 → 0.0.80
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/README.md +63 -63
- package/cjs/markets/aave/marketAssets.js +1 -1
- package/esm/markets/aave/marketAssets.js +1 -1
- package/package.json +41 -41
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +562 -562
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +219 -219
- package/src/compoundV3/index.ts +273 -273
- package/src/config/contracts.js +848 -848
- package/src/constants/index.ts +5 -5
- package/src/contracts.ts +128 -128
- package/src/curveUsd/index.ts +229 -229
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +134 -134
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +181 -181
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/index.ts +7 -7
- package/src/helpers/llamaLendHelpers/index.ts +45 -45
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +56 -56
- package/src/helpers/sparkHelpers/index.ts +106 -106
- package/src/index.ts +46 -46
- package/src/liquity/index.ts +116 -116
- package/src/llamaLend/index.ts +268 -268
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +80 -80
- package/src/markets/aave/marketAssets.ts +25 -25
- package/src/markets/compound/index.ts +142 -142
- package/src/markets/compound/marketsAssets.ts +50 -50
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/index.ts +5 -5
- package/src/markets/llamaLend/contractAddresses.ts +95 -95
- package/src/markets/llamaLend/index.ts +150 -150
- package/src/markets/morphoBlue/index.ts +462 -462
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +75 -75
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +619 -619
- package/src/morphoBlue/index.ts +162 -162
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +21 -21
- package/src/services/utils.ts +51 -51
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +422 -422
- package/src/staking/staking.ts +198 -198
- package/src/types/aave.ts +256 -256
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +128 -128
- package/src/types/curveUsd.ts +118 -118
- package/src/types/index.ts +8 -8
- package/src/types/liquity.ts +30 -30
- package/src/types/llamaLend.ts +143 -143
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +129 -129
- package/src/types/spark.ts +106 -106
- package/yarn-error.log +64 -0
package/src/types/morphoBlue.ts
CHANGED
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
import { MMUsedAssets, NetworkNumber } from './common';
|
|
2
|
-
|
|
3
|
-
export enum MorphoBlueVersions {
|
|
4
|
-
// MAINNET
|
|
5
|
-
MorphoBlueWstEthUSDC = 'morphobluewstethusdc', // wstETH/USDC
|
|
6
|
-
MorphoBlueSDAIUSDC = 'morphobluesdaiusdc', // sDAI/USDC
|
|
7
|
-
MorphoBlueWBTCUSDC = 'morphobluewbtcusdc', // WBTC/USDC
|
|
8
|
-
MorphoBlueEthUSDC = 'morphoblueethusdc', // ETH/USDC
|
|
9
|
-
MorphoBlueWBTCUSDT = 'morphobluewbtcusdt', // WBTC/USDT
|
|
10
|
-
MorphoBlueWstEthUSDT = 'morphobluewstethusdt', // wstETH/USDT
|
|
11
|
-
MorphoBlueWstEthUSDA_Exchange_Rate = 'morphobluewstethusda_exchange_rate', // wstETH/USDA
|
|
12
|
-
MorphoBlueWstEthPYUSD = 'morphobluwstethpyusd', // wstETH/PYUSD
|
|
13
|
-
MorphoBlueWeEthEth = 'morphoblueweetheth', // weETH/ETH
|
|
14
|
-
MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
|
|
15
|
-
MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
|
|
16
|
-
MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
|
|
17
|
-
MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
|
|
18
|
-
MorphoBlueSDAIEth = 'morphobluesdaieth', // sDAI/ETH
|
|
19
|
-
MorphoBlueEzEthEth = 'morphoblueezetheth', // ezETH/ETH
|
|
20
|
-
// wstETH/WETH
|
|
21
|
-
MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
|
|
22
|
-
MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
|
|
23
|
-
MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
|
|
24
|
-
// sUSDe/DAI
|
|
25
|
-
MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
|
|
26
|
-
MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
|
|
27
|
-
MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
|
|
28
|
-
MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
|
|
29
|
-
// USDe/DAI
|
|
30
|
-
MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
|
|
31
|
-
MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
|
|
32
|
-
MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
|
|
33
|
-
MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
|
|
34
|
-
|
|
35
|
-
// BASE
|
|
36
|
-
MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export enum MorphoBlueOracleType {
|
|
40
|
-
MARKET_RATE = 'Market rate',
|
|
41
|
-
LIDO_RATE = 'Lido rate',
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface MorphoBlueMarketData {
|
|
45
|
-
chainIds: NetworkNumber[],
|
|
46
|
-
label: string,
|
|
47
|
-
shortLabel: string,
|
|
48
|
-
url: string,
|
|
49
|
-
value: MorphoBlueVersions,
|
|
50
|
-
loanToken: string,
|
|
51
|
-
collateralToken: string,
|
|
52
|
-
oracle: string,
|
|
53
|
-
oracleType: MorphoBlueOracleType,
|
|
54
|
-
irm: string,
|
|
55
|
-
lltv: number | string,
|
|
56
|
-
marketId: string,
|
|
57
|
-
// icon: Function,
|
|
58
|
-
protocolName: string,
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface MorphoBlueAssetData {
|
|
62
|
-
symbol: string,
|
|
63
|
-
address: string,
|
|
64
|
-
price: string,
|
|
65
|
-
supplyRate: string,
|
|
66
|
-
borrowRate: string,
|
|
67
|
-
incentiveSupplyApy?: string,
|
|
68
|
-
incentiveSupplyToken?: string,
|
|
69
|
-
totalSupply?: string,
|
|
70
|
-
totalBorrow?: string,
|
|
71
|
-
canBeSupplied?: boolean,
|
|
72
|
-
canBeBorrowed?: boolean,
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
|
|
76
|
-
|
|
77
|
-
export interface MorphoBlueMarketInfo {
|
|
78
|
-
id: string,
|
|
79
|
-
fee: string,
|
|
80
|
-
loanToken: string,
|
|
81
|
-
collateralToken: string,
|
|
82
|
-
utillization: string,
|
|
83
|
-
oracle: string,
|
|
84
|
-
oracleType: MorphoBlueOracleType,
|
|
85
|
-
lltv: string,
|
|
86
|
-
minRatio: string,
|
|
87
|
-
assetsData: MorphoBlueAssetsData,
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface MorphoBlueAggregatedPositionData {
|
|
91
|
-
suppliedUsd: string,
|
|
92
|
-
suppliedCollateralUsd: string,
|
|
93
|
-
borrowedUsd: string,
|
|
94
|
-
borrowLimitUsd: string,
|
|
95
|
-
liquidationLimitUsd: string,
|
|
96
|
-
leftToBorrowUsd: string,
|
|
97
|
-
leftToBorrow: string,
|
|
98
|
-
netApy: string,
|
|
99
|
-
incentiveUsd: string,
|
|
100
|
-
totalInterestUsd: string,
|
|
101
|
-
ltv: string,
|
|
102
|
-
ratio: string,
|
|
103
|
-
leveragedType: string,
|
|
104
|
-
leveragedAsset?: string,
|
|
105
|
-
leveragedLsdAssetRatio?: string,
|
|
106
|
-
liquidationPrice?: string,
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export interface MorphoBluePositionData {
|
|
110
|
-
usedAssets: MMUsedAssets,
|
|
111
|
-
suppliedUsd: string,
|
|
112
|
-
suppliedCollateralUsd: string,
|
|
113
|
-
borrowedUsd: string,
|
|
114
|
-
borrowLimitUsd: string,
|
|
115
|
-
liquidationLimitUsd: string,
|
|
116
|
-
leftToBorrowUsd: string,
|
|
117
|
-
leftToBorrow: string,
|
|
118
|
-
netApy: string,
|
|
119
|
-
incentiveUsd: string,
|
|
120
|
-
totalInterestUsd: string,
|
|
121
|
-
ltv: string,
|
|
122
|
-
ratio: string,
|
|
123
|
-
leveragedType: string,
|
|
124
|
-
leveragedAsset?: string,
|
|
125
|
-
leveragedLsdAssetRatio?: string,
|
|
126
|
-
liquidationPrice?: string,
|
|
127
|
-
supplyShares: string,
|
|
128
|
-
borrowShares: string,
|
|
129
|
-
}
|
|
1
|
+
import { MMUsedAssets, NetworkNumber } from './common';
|
|
2
|
+
|
|
3
|
+
export enum MorphoBlueVersions {
|
|
4
|
+
// MAINNET
|
|
5
|
+
MorphoBlueWstEthUSDC = 'morphobluewstethusdc', // wstETH/USDC
|
|
6
|
+
MorphoBlueSDAIUSDC = 'morphobluesdaiusdc', // sDAI/USDC
|
|
7
|
+
MorphoBlueWBTCUSDC = 'morphobluewbtcusdc', // WBTC/USDC
|
|
8
|
+
MorphoBlueEthUSDC = 'morphoblueethusdc', // ETH/USDC
|
|
9
|
+
MorphoBlueWBTCUSDT = 'morphobluewbtcusdt', // WBTC/USDT
|
|
10
|
+
MorphoBlueWstEthUSDT = 'morphobluewstethusdt', // wstETH/USDT
|
|
11
|
+
MorphoBlueWstEthUSDA_Exchange_Rate = 'morphobluewstethusda_exchange_rate', // wstETH/USDA
|
|
12
|
+
MorphoBlueWstEthPYUSD = 'morphobluwstethpyusd', // wstETH/PYUSD
|
|
13
|
+
MorphoBlueWeEthEth = 'morphoblueweetheth', // weETH/ETH
|
|
14
|
+
MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
|
|
15
|
+
MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
|
|
16
|
+
MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
|
|
17
|
+
MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
|
|
18
|
+
MorphoBlueSDAIEth = 'morphobluesdaieth', // sDAI/ETH
|
|
19
|
+
MorphoBlueEzEthEth = 'morphoblueezetheth', // ezETH/ETH
|
|
20
|
+
// wstETH/WETH
|
|
21
|
+
MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
|
|
22
|
+
MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
|
|
23
|
+
MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
|
|
24
|
+
// sUSDe/DAI
|
|
25
|
+
MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
|
|
26
|
+
MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
|
|
27
|
+
MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
|
|
28
|
+
MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
|
|
29
|
+
// USDe/DAI
|
|
30
|
+
MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
|
|
31
|
+
MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
|
|
32
|
+
MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
|
|
33
|
+
MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
|
|
34
|
+
|
|
35
|
+
// BASE
|
|
36
|
+
MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export enum MorphoBlueOracleType {
|
|
40
|
+
MARKET_RATE = 'Market rate',
|
|
41
|
+
LIDO_RATE = 'Lido rate',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface MorphoBlueMarketData {
|
|
45
|
+
chainIds: NetworkNumber[],
|
|
46
|
+
label: string,
|
|
47
|
+
shortLabel: string,
|
|
48
|
+
url: string,
|
|
49
|
+
value: MorphoBlueVersions,
|
|
50
|
+
loanToken: string,
|
|
51
|
+
collateralToken: string,
|
|
52
|
+
oracle: string,
|
|
53
|
+
oracleType: MorphoBlueOracleType,
|
|
54
|
+
irm: string,
|
|
55
|
+
lltv: number | string,
|
|
56
|
+
marketId: string,
|
|
57
|
+
// icon: Function,
|
|
58
|
+
protocolName: string,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface MorphoBlueAssetData {
|
|
62
|
+
symbol: string,
|
|
63
|
+
address: string,
|
|
64
|
+
price: string,
|
|
65
|
+
supplyRate: string,
|
|
66
|
+
borrowRate: string,
|
|
67
|
+
incentiveSupplyApy?: string,
|
|
68
|
+
incentiveSupplyToken?: string,
|
|
69
|
+
totalSupply?: string,
|
|
70
|
+
totalBorrow?: string,
|
|
71
|
+
canBeSupplied?: boolean,
|
|
72
|
+
canBeBorrowed?: boolean,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
|
|
76
|
+
|
|
77
|
+
export interface MorphoBlueMarketInfo {
|
|
78
|
+
id: string,
|
|
79
|
+
fee: string,
|
|
80
|
+
loanToken: string,
|
|
81
|
+
collateralToken: string,
|
|
82
|
+
utillization: string,
|
|
83
|
+
oracle: string,
|
|
84
|
+
oracleType: MorphoBlueOracleType,
|
|
85
|
+
lltv: string,
|
|
86
|
+
minRatio: string,
|
|
87
|
+
assetsData: MorphoBlueAssetsData,
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface MorphoBlueAggregatedPositionData {
|
|
91
|
+
suppliedUsd: string,
|
|
92
|
+
suppliedCollateralUsd: string,
|
|
93
|
+
borrowedUsd: string,
|
|
94
|
+
borrowLimitUsd: string,
|
|
95
|
+
liquidationLimitUsd: string,
|
|
96
|
+
leftToBorrowUsd: string,
|
|
97
|
+
leftToBorrow: string,
|
|
98
|
+
netApy: string,
|
|
99
|
+
incentiveUsd: string,
|
|
100
|
+
totalInterestUsd: string,
|
|
101
|
+
ltv: string,
|
|
102
|
+
ratio: string,
|
|
103
|
+
leveragedType: string,
|
|
104
|
+
leveragedAsset?: string,
|
|
105
|
+
leveragedLsdAssetRatio?: string,
|
|
106
|
+
liquidationPrice?: string,
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface MorphoBluePositionData {
|
|
110
|
+
usedAssets: MMUsedAssets,
|
|
111
|
+
suppliedUsd: string,
|
|
112
|
+
suppliedCollateralUsd: string,
|
|
113
|
+
borrowedUsd: string,
|
|
114
|
+
borrowLimitUsd: string,
|
|
115
|
+
liquidationLimitUsd: string,
|
|
116
|
+
leftToBorrowUsd: string,
|
|
117
|
+
leftToBorrow: string,
|
|
118
|
+
netApy: string,
|
|
119
|
+
incentiveUsd: string,
|
|
120
|
+
totalInterestUsd: string,
|
|
121
|
+
ltv: string,
|
|
122
|
+
ratio: string,
|
|
123
|
+
leveragedType: string,
|
|
124
|
+
leveragedAsset?: string,
|
|
125
|
+
leveragedLsdAssetRatio?: string,
|
|
126
|
+
liquidationPrice?: string,
|
|
127
|
+
supplyShares: string,
|
|
128
|
+
borrowShares: string,
|
|
129
|
+
}
|
package/src/types/spark.ts
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import { EModeCategoryData, EModeCategoryDataMapping } from './aave';
|
|
2
|
-
import {
|
|
3
|
-
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
4
|
-
} from './common';
|
|
5
|
-
|
|
6
|
-
export enum SparkVersions {
|
|
7
|
-
SparkV1 = 'v1default',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface SparkMarketData {
|
|
11
|
-
chainIds: NetworkNumber[],
|
|
12
|
-
label: string,
|
|
13
|
-
shortLabel: string,
|
|
14
|
-
url: string,
|
|
15
|
-
value: SparkVersions,
|
|
16
|
-
assets: readonly string[],
|
|
17
|
-
provider: '' | 'SparkPoolAddressesProvider',
|
|
18
|
-
providerAddress: string,
|
|
19
|
-
lendingPool: 'SparkLendingPool',
|
|
20
|
-
lendingPoolAddress: string,
|
|
21
|
-
protocolData: '' | 'SparkProtocolDataProvider',
|
|
22
|
-
protocolDataAddress: string
|
|
23
|
-
subVersionLabel?: string
|
|
24
|
-
// icon: Function,
|
|
25
|
-
protocolName: string,
|
|
26
|
-
disabled?: boolean,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface SparkAssetData extends MMAssetData {
|
|
30
|
-
totalBorrowVar: string,
|
|
31
|
-
sortIndex?: number,
|
|
32
|
-
usageAsCollateralEnabled: boolean,
|
|
33
|
-
isIsolated: boolean,
|
|
34
|
-
eModeCategory: number,
|
|
35
|
-
eModeCategoryData: EModeCategoryData,
|
|
36
|
-
liquidationRatio: string,
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface SparkAssetsData {
|
|
40
|
-
[token: string]: SparkAssetData,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type SparkMarketsData = { assetsData: SparkAssetsData };
|
|
44
|
-
|
|
45
|
-
export interface SparkUsedAsset extends MMUsedAsset {
|
|
46
|
-
stableBorrowRate: string,
|
|
47
|
-
borrowedStable: string,
|
|
48
|
-
borrowedVariable: string,
|
|
49
|
-
borrowedUsdStable: string,
|
|
50
|
-
borrowedUsdVariable: string,
|
|
51
|
-
stableLimit: string,
|
|
52
|
-
variableLimit: string,
|
|
53
|
-
limit: string,
|
|
54
|
-
eModeCategory: number,
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface SparkUsedAssets {
|
|
58
|
-
[token: string]: SparkUsedAsset,
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface SparkHelperCommon {
|
|
62
|
-
usedAssets: SparkUsedAssets,
|
|
63
|
-
eModeCategory: number,
|
|
64
|
-
eModeCategories?: object,
|
|
65
|
-
assetsData: SparkAssetsData,
|
|
66
|
-
selectedMarket?: SparkMarketData,
|
|
67
|
-
network?: NetworkNumber,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface SparkAggregatedPositionData {
|
|
71
|
-
suppliedUsd: string,
|
|
72
|
-
suppliedCollateralUsd: string,
|
|
73
|
-
borrowedUsd: string,
|
|
74
|
-
borrowLimitUsd: string,
|
|
75
|
-
liquidationLimitUsd: string,
|
|
76
|
-
leftToBorrowUsd: string,
|
|
77
|
-
ratio: string,
|
|
78
|
-
collRatio: string,
|
|
79
|
-
netApy: string,
|
|
80
|
-
incentiveUsd: string,
|
|
81
|
-
totalInterestUsd: string,
|
|
82
|
-
liqRatio: string,
|
|
83
|
-
liqPercent: string,
|
|
84
|
-
leveragedType: string,
|
|
85
|
-
leveragedAsset?: string,
|
|
86
|
-
leveragedLsdAssetRatio?: string,
|
|
87
|
-
liquidationPrice?: string,
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface SparkPositionData extends MMPositionData {
|
|
91
|
-
ratio: string,
|
|
92
|
-
minRatio: string,
|
|
93
|
-
collRatio: string,
|
|
94
|
-
borrowedUsd: string,
|
|
95
|
-
borrowLimitUsd: string,
|
|
96
|
-
suppliedCollateralUsd: string,
|
|
97
|
-
incentiveUsd: string,
|
|
98
|
-
totalInterestUsd: string,
|
|
99
|
-
isSubscribedToAutomation?: boolean,
|
|
100
|
-
automationResubscribeRequired?: boolean,
|
|
101
|
-
totalSupplied: string,
|
|
102
|
-
usedAssets: SparkUsedAssets,
|
|
103
|
-
eModeCategory: number,
|
|
104
|
-
isInIsolationMode: boolean,
|
|
105
|
-
isInSiloedMode: boolean,
|
|
106
|
-
eModeCategories: { [key: number]: EModeCategoryDataMapping },
|
|
1
|
+
import { EModeCategoryData, EModeCategoryDataMapping } from './aave';
|
|
2
|
+
import {
|
|
3
|
+
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
4
|
+
} from './common';
|
|
5
|
+
|
|
6
|
+
export enum SparkVersions {
|
|
7
|
+
SparkV1 = 'v1default',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SparkMarketData {
|
|
11
|
+
chainIds: NetworkNumber[],
|
|
12
|
+
label: string,
|
|
13
|
+
shortLabel: string,
|
|
14
|
+
url: string,
|
|
15
|
+
value: SparkVersions,
|
|
16
|
+
assets: readonly string[],
|
|
17
|
+
provider: '' | 'SparkPoolAddressesProvider',
|
|
18
|
+
providerAddress: string,
|
|
19
|
+
lendingPool: 'SparkLendingPool',
|
|
20
|
+
lendingPoolAddress: string,
|
|
21
|
+
protocolData: '' | 'SparkProtocolDataProvider',
|
|
22
|
+
protocolDataAddress: string
|
|
23
|
+
subVersionLabel?: string
|
|
24
|
+
// icon: Function,
|
|
25
|
+
protocolName: string,
|
|
26
|
+
disabled?: boolean,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SparkAssetData extends MMAssetData {
|
|
30
|
+
totalBorrowVar: string,
|
|
31
|
+
sortIndex?: number,
|
|
32
|
+
usageAsCollateralEnabled: boolean,
|
|
33
|
+
isIsolated: boolean,
|
|
34
|
+
eModeCategory: number,
|
|
35
|
+
eModeCategoryData: EModeCategoryData,
|
|
36
|
+
liquidationRatio: string,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface SparkAssetsData {
|
|
40
|
+
[token: string]: SparkAssetData,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type SparkMarketsData = { assetsData: SparkAssetsData };
|
|
44
|
+
|
|
45
|
+
export interface SparkUsedAsset extends MMUsedAsset {
|
|
46
|
+
stableBorrowRate: string,
|
|
47
|
+
borrowedStable: string,
|
|
48
|
+
borrowedVariable: string,
|
|
49
|
+
borrowedUsdStable: string,
|
|
50
|
+
borrowedUsdVariable: string,
|
|
51
|
+
stableLimit: string,
|
|
52
|
+
variableLimit: string,
|
|
53
|
+
limit: string,
|
|
54
|
+
eModeCategory: number,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface SparkUsedAssets {
|
|
58
|
+
[token: string]: SparkUsedAsset,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface SparkHelperCommon {
|
|
62
|
+
usedAssets: SparkUsedAssets,
|
|
63
|
+
eModeCategory: number,
|
|
64
|
+
eModeCategories?: object,
|
|
65
|
+
assetsData: SparkAssetsData,
|
|
66
|
+
selectedMarket?: SparkMarketData,
|
|
67
|
+
network?: NetworkNumber,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface SparkAggregatedPositionData {
|
|
71
|
+
suppliedUsd: string,
|
|
72
|
+
suppliedCollateralUsd: string,
|
|
73
|
+
borrowedUsd: string,
|
|
74
|
+
borrowLimitUsd: string,
|
|
75
|
+
liquidationLimitUsd: string,
|
|
76
|
+
leftToBorrowUsd: string,
|
|
77
|
+
ratio: string,
|
|
78
|
+
collRatio: string,
|
|
79
|
+
netApy: string,
|
|
80
|
+
incentiveUsd: string,
|
|
81
|
+
totalInterestUsd: string,
|
|
82
|
+
liqRatio: string,
|
|
83
|
+
liqPercent: string,
|
|
84
|
+
leveragedType: string,
|
|
85
|
+
leveragedAsset?: string,
|
|
86
|
+
leveragedLsdAssetRatio?: string,
|
|
87
|
+
liquidationPrice?: string,
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface SparkPositionData extends MMPositionData {
|
|
91
|
+
ratio: string,
|
|
92
|
+
minRatio: string,
|
|
93
|
+
collRatio: string,
|
|
94
|
+
borrowedUsd: string,
|
|
95
|
+
borrowLimitUsd: string,
|
|
96
|
+
suppliedCollateralUsd: string,
|
|
97
|
+
incentiveUsd: string,
|
|
98
|
+
totalInterestUsd: string,
|
|
99
|
+
isSubscribedToAutomation?: boolean,
|
|
100
|
+
automationResubscribeRequired?: boolean,
|
|
101
|
+
totalSupplied: string,
|
|
102
|
+
usedAssets: SparkUsedAssets,
|
|
103
|
+
eModeCategory: number,
|
|
104
|
+
isInIsolationMode: boolean,
|
|
105
|
+
isInSiloedMode: boolean,
|
|
106
|
+
eModeCategories: { [key: number]: EModeCategoryDataMapping },
|
|
107
107
|
}
|
package/yarn-error.log
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Arguments:
|
|
2
|
+
/Users/stefan/.nvm/versions/node/v14.19.0/bin/node /usr/local/Cellar/yarn/1.22.19/libexec/bin/yarn.js
|
|
3
|
+
|
|
4
|
+
PATH:
|
|
5
|
+
/Users/stefan/.nvm/versions/node/v14.19.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/go/bin:/Users/stefan/WebstormProjects/defisaver-positions-sdk/node_modules/.bin:/usr/local/go
|
|
6
|
+
|
|
7
|
+
Yarn version:
|
|
8
|
+
1.22.19
|
|
9
|
+
|
|
10
|
+
Node version:
|
|
11
|
+
14.19.0
|
|
12
|
+
|
|
13
|
+
Platform:
|
|
14
|
+
darwin x64
|
|
15
|
+
|
|
16
|
+
Trace:
|
|
17
|
+
Error: incorrect data check
|
|
18
|
+
at Zlib.zlibOnError [as onerror] (zlib.js:187:17)
|
|
19
|
+
|
|
20
|
+
npm manifest:
|
|
21
|
+
{
|
|
22
|
+
"name": "defisaver-positions-sdk",
|
|
23
|
+
"version": "0.0.1",
|
|
24
|
+
"description": "",
|
|
25
|
+
"main": "./cjs/index.js",
|
|
26
|
+
"module": "./esm/src/index.js",
|
|
27
|
+
"types": "./esm/src/index.d.ts",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build:esm": "rm -rf esm && tsc -p tsconfig.json",
|
|
30
|
+
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
31
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
32
|
+
"dev": "tsc -p tsconfig.cjs.json --watch",
|
|
33
|
+
"lint": "eslint src/ --fix",
|
|
34
|
+
"generate-contracts": "node scripts/generateContracts.js",
|
|
35
|
+
"test": "mocha tests/*",
|
|
36
|
+
"build-test": "npm run build && mocha tests/*"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [],
|
|
39
|
+
"author": "",
|
|
40
|
+
"license": "ISC",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@defisaver/tokens": "^1.4.56",
|
|
43
|
+
"decimal.js": "^10.4.3"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@defisaver/eslint-config": "^1.0.1",
|
|
47
|
+
"chai": "^4.3.8",
|
|
48
|
+
"dotenv": "^16.3.1",
|
|
49
|
+
"eslint": "^8.49.0",
|
|
50
|
+
"mocha": "^10.2.0",
|
|
51
|
+
"typechain": "^8.3.1",
|
|
52
|
+
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
53
|
+
"typescript": "^5.2.2"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"web3": "^1.10.2"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
yarn manifest:
|
|
61
|
+
No manifest
|
|
62
|
+
|
|
63
|
+
Lockfile:
|
|
64
|
+
No lockfile
|