@defisaver/positions-sdk 0.0.182 → 0.0.183-dev-allocator

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.
Files changed (85) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +69 -69
  4. package/cjs/aaveV3/index.js +3 -3
  5. package/cjs/config/contracts.d.ts +3 -0
  6. package/cjs/config/contracts.js +3 -0
  7. package/cjs/helpers/aaveHelpers/index.js +0 -1
  8. package/cjs/helpers/morphoBlueHelpers/index.d.ts +5 -0
  9. package/cjs/helpers/morphoBlueHelpers/index.js +127 -1
  10. package/cjs/staking/staking.d.ts +2 -3
  11. package/cjs/staking/staking.js +2 -2
  12. package/cjs/types/morphoBlue.d.ts +25 -0
  13. package/esm/aaveV3/index.js +4 -4
  14. package/esm/config/contracts.d.ts +3 -0
  15. package/esm/config/contracts.js +3 -0
  16. package/esm/helpers/aaveHelpers/index.js +0 -1
  17. package/esm/helpers/morphoBlueHelpers/index.d.ts +5 -0
  18. package/esm/helpers/morphoBlueHelpers/index.js +124 -0
  19. package/esm/staking/staking.d.ts +2 -3
  20. package/esm/staking/staking.js +2 -2
  21. package/esm/types/morphoBlue.d.ts +25 -0
  22. package/package.json +49 -49
  23. package/src/aaveV2/index.ts +227 -227
  24. package/src/aaveV3/index.ts +624 -628
  25. package/src/assets/index.ts +60 -60
  26. package/src/chickenBonds/index.ts +123 -123
  27. package/src/compoundV2/index.ts +220 -220
  28. package/src/compoundV3/index.ts +282 -282
  29. package/src/config/contracts.js +1043 -1040
  30. package/src/constants/index.ts +6 -6
  31. package/src/contracts.ts +130 -130
  32. package/src/curveUsd/index.ts +229 -229
  33. package/src/eulerV2/index.ts +303 -303
  34. package/src/exchange/index.ts +17 -17
  35. package/src/helpers/aaveHelpers/index.ts +198 -199
  36. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  37. package/src/helpers/compoundHelpers/index.ts +246 -246
  38. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  39. package/src/helpers/eulerHelpers/index.ts +232 -232
  40. package/src/helpers/index.ts +8 -8
  41. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  42. package/src/helpers/makerHelpers/index.ts +94 -94
  43. package/src/helpers/morphoBlueHelpers/index.ts +256 -115
  44. package/src/helpers/sparkHelpers/index.ts +150 -150
  45. package/src/index.ts +48 -48
  46. package/src/liquity/index.ts +116 -116
  47. package/src/llamaLend/index.ts +275 -275
  48. package/src/maker/index.ts +117 -117
  49. package/src/markets/aave/index.ts +152 -152
  50. package/src/markets/aave/marketAssets.ts +46 -46
  51. package/src/markets/compound/index.ts +173 -173
  52. package/src/markets/compound/marketsAssets.ts +64 -64
  53. package/src/markets/curveUsd/index.ts +69 -69
  54. package/src/markets/euler/index.ts +26 -26
  55. package/src/markets/index.ts +23 -23
  56. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  57. package/src/markets/llamaLend/index.ts +235 -235
  58. package/src/markets/morphoBlue/index.ts +809 -809
  59. package/src/markets/spark/index.ts +29 -29
  60. package/src/markets/spark/marketAssets.ts +10 -10
  61. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  62. package/src/morphoAaveV2/index.ts +256 -256
  63. package/src/morphoAaveV3/index.ts +630 -630
  64. package/src/morphoBlue/index.ts +171 -171
  65. package/src/multicall/index.ts +22 -22
  66. package/src/services/dsrService.ts +15 -15
  67. package/src/services/priceService.ts +21 -21
  68. package/src/services/utils.ts +56 -56
  69. package/src/setup.ts +8 -8
  70. package/src/spark/index.ts +461 -461
  71. package/src/staking/staking.ts +220 -222
  72. package/src/types/aave.ts +270 -270
  73. package/src/types/chickenBonds.ts +45 -45
  74. package/src/types/common.ts +84 -84
  75. package/src/types/compound.ts +129 -129
  76. package/src/types/curveUsd.ts +118 -118
  77. package/src/types/euler.ts +171 -171
  78. package/src/types/index.ts +9 -9
  79. package/src/types/liquity.ts +30 -30
  80. package/src/types/llamaLend.ts +155 -155
  81. package/src/types/maker.ts +50 -50
  82. package/src/types/morphoBlue.ts +177 -154
  83. package/src/types/spark.ts +131 -131
  84. package/.vscode/launch.json +0 -17
  85. package/.vscode/settings.json +0 -37
@@ -1,154 +1,177 @@
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
- MorphoBlueREthEth_945 = 'morphoblueretheth_945', // rETH/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
- MorphoBlueMKRUSDC = 'morphobluemkrusdc', // MKR/USDC
20
- MorphoBlueTBTCUSDC = 'morphobluetbtcusdc', // tBTC/USDC
21
- MorphoBlueCbBTCEth_915 = 'morphobluecbbtceth', // cbBTC/Eth
22
- MorphoBlueCbBTCUSDC_860 = 'morphobluecbbtcusdc', // cbBTC/USDC
23
- MorphoBlueSUSDeUSDC_915 = 'morphobluesusdeusdc_915', // sUSDe/USDC
24
- // ezETH/ETH
25
- MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
26
- MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
27
- // weETH/ETH
28
- MorphoBlueWeEthEth_860 = 'morphoblueweetheth_860',
29
- MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
30
- // wstETH/WETH
31
- MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
32
- MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
33
- MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
34
- // sUSDe/DAI
35
- MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
36
- MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
37
- MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
38
- MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
39
- // USDe/DAI
40
- MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
41
- MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
42
- MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
43
- MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
44
-
45
- // BASE
46
- MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
47
- MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
48
- MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
49
- MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
50
- MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
51
- MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
52
- MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
53
- MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
54
- MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
55
- MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
56
- MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
57
- MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
58
- MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
59
- MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
60
- }
61
-
62
- export enum MorphoBlueOracleType {
63
- MARKET_RATE = 'Market rate',
64
- LIDO_RATE = 'Lido rate',
65
- ETHENA_RATE = 'Ethena rate',
66
- CONTRACT_RATE = 'Contract rate',
67
- }
68
-
69
- export interface MorphoBlueMarketData {
70
- chainIds: NetworkNumber[],
71
- label: string,
72
- shortLabel: string,
73
- url: string,
74
- value: MorphoBlueVersions,
75
- loanToken: string,
76
- collateralToken: string,
77
- oracle: string,
78
- oracleType: MorphoBlueOracleType,
79
- irm: string,
80
- lltv: number | string,
81
- marketId: string,
82
- // icon: Function,
83
- protocolName: string,
84
- }
85
-
86
- export interface MorphoBlueAssetData {
87
- symbol: string,
88
- address: string,
89
- price: string,
90
- supplyRate: string,
91
- borrowRate: string,
92
- incentiveSupplyApy?: string,
93
- incentiveSupplyToken?: string,
94
- totalSupply?: string,
95
- totalBorrow?: string,
96
- canBeSupplied?: boolean,
97
- canBeBorrowed?: boolean,
98
- }
99
-
100
- export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
101
-
102
- export interface MorphoBlueMarketInfo {
103
- id: string,
104
- fee: string,
105
- loanToken: string,
106
- collateralToken: string,
107
- utillization: string,
108
- oracle: string,
109
- oracleType: MorphoBlueOracleType,
110
- lltv: string,
111
- minRatio: string,
112
- assetsData: MorphoBlueAssetsData,
113
- }
114
-
115
- export interface MorphoBlueAggregatedPositionData {
116
- suppliedUsd: string,
117
- suppliedCollateralUsd: string,
118
- borrowedUsd: string,
119
- borrowLimitUsd: string,
120
- liquidationLimitUsd: string,
121
- leftToBorrowUsd: string,
122
- leftToBorrow: string,
123
- netApy: string,
124
- incentiveUsd: string,
125
- totalInterestUsd: string,
126
- ltv: string,
127
- ratio: string,
128
- leveragedType: string,
129
- leveragedAsset?: string,
130
- leveragedLsdAssetRatio?: string,
131
- liquidationPrice?: string,
132
- }
133
-
134
- export interface MorphoBluePositionData {
135
- usedAssets: MMUsedAssets,
136
- suppliedUsd: string,
137
- suppliedCollateralUsd: string,
138
- borrowedUsd: string,
139
- borrowLimitUsd: string,
140
- liquidationLimitUsd: string,
141
- leftToBorrowUsd: string,
142
- leftToBorrow: string,
143
- netApy: string,
144
- incentiveUsd: string,
145
- totalInterestUsd: string,
146
- ltv: string,
147
- ratio: string,
148
- leveragedType: string,
149
- leveragedAsset?: string,
150
- leveragedLsdAssetRatio?: string,
151
- liquidationPrice?: string,
152
- supplyShares: string,
153
- borrowShares: string,
154
- }
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
+ MorphoBlueREthEth_945 = 'morphoblueretheth_945', // rETH/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
+ MorphoBlueMKRUSDC = 'morphobluemkrusdc', // MKR/USDC
20
+ MorphoBlueTBTCUSDC = 'morphobluetbtcusdc', // tBTC/USDC
21
+ MorphoBlueCbBTCEth_915 = 'morphobluecbbtceth', // cbBTC/Eth
22
+ MorphoBlueCbBTCUSDC_860 = 'morphobluecbbtcusdc', // cbBTC/USDC
23
+ MorphoBlueSUSDeUSDC_915 = 'morphobluesusdeusdc_915', // sUSDe/USDC
24
+ // ezETH/ETH
25
+ MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
26
+ MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
27
+ // weETH/ETH
28
+ MorphoBlueWeEthEth_860 = 'morphoblueweetheth_860',
29
+ MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
30
+ // wstETH/WETH
31
+ MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
32
+ MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
33
+ MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
34
+ // sUSDe/DAI
35
+ MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
36
+ MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
37
+ MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
38
+ MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
39
+ // USDe/DAI
40
+ MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
41
+ MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
42
+ MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
43
+ MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
44
+
45
+ // BASE
46
+ MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
47
+ MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
48
+ MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
49
+ MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
50
+ MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
51
+ MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
52
+ MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
53
+ MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
54
+ MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
55
+ MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
56
+ MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
57
+ MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
58
+ MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
59
+ MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
60
+ }
61
+
62
+ export enum MorphoBlueOracleType {
63
+ MARKET_RATE = 'Market rate',
64
+ LIDO_RATE = 'Lido rate',
65
+ ETHENA_RATE = 'Ethena rate',
66
+ CONTRACT_RATE = 'Contract rate',
67
+ }
68
+
69
+ export interface MorphoBlueMarketData {
70
+ chainIds: NetworkNumber[],
71
+ label: string,
72
+ shortLabel: string,
73
+ url: string,
74
+ value: MorphoBlueVersions,
75
+ loanToken: string,
76
+ collateralToken: string,
77
+ oracle: string,
78
+ oracleType: MorphoBlueOracleType,
79
+ irm: string,
80
+ lltv: number | string,
81
+ marketId: string,
82
+ // icon: Function,
83
+ protocolName: string,
84
+ }
85
+
86
+ export interface MorphoBlueAssetData {
87
+ symbol: string,
88
+ address: string,
89
+ price: string,
90
+ supplyRate: string,
91
+ borrowRate: string,
92
+ incentiveSupplyApy?: string,
93
+ incentiveSupplyToken?: string,
94
+ totalSupply?: string,
95
+ totalBorrow?: string,
96
+ canBeSupplied?: boolean,
97
+ canBeBorrowed?: boolean,
98
+ }
99
+
100
+ export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
101
+
102
+ export interface MorphoBlueMarketInfo {
103
+ id: string,
104
+ fee: string,
105
+ loanToken: string,
106
+ collateralToken: string,
107
+ utillization: string,
108
+ oracle: string,
109
+ oracleType: MorphoBlueOracleType,
110
+ lltv: string,
111
+ minRatio: string,
112
+ assetsData: MorphoBlueAssetsData,
113
+ }
114
+
115
+ export interface MorphoBlueAggregatedPositionData {
116
+ suppliedUsd: string,
117
+ suppliedCollateralUsd: string,
118
+ borrowedUsd: string,
119
+ borrowLimitUsd: string,
120
+ liquidationLimitUsd: string,
121
+ leftToBorrowUsd: string,
122
+ leftToBorrow: string,
123
+ netApy: string,
124
+ incentiveUsd: string,
125
+ totalInterestUsd: string,
126
+ ltv: string,
127
+ ratio: string,
128
+ leveragedType: string,
129
+ leveragedAsset?: string,
130
+ leveragedLsdAssetRatio?: string,
131
+ liquidationPrice?: string,
132
+ }
133
+
134
+ export interface MorphoBluePositionData {
135
+ usedAssets: MMUsedAssets,
136
+ suppliedUsd: string,
137
+ suppliedCollateralUsd: string,
138
+ borrowedUsd: string,
139
+ borrowLimitUsd: string,
140
+ liquidationLimitUsd: string,
141
+ leftToBorrowUsd: string,
142
+ leftToBorrow: string,
143
+ netApy: string,
144
+ incentiveUsd: string,
145
+ totalInterestUsd: string,
146
+ ltv: string,
147
+ ratio: string,
148
+ leveragedType: string,
149
+ leveragedAsset?: string,
150
+ leveragedLsdAssetRatio?: string,
151
+ liquidationPrice?: string,
152
+ supplyShares: string,
153
+ borrowShares: string,
154
+ }
155
+
156
+ export interface MorphoBlueVault {
157
+ address: string,
158
+ }
159
+
160
+ export interface MorphoBlueAllocationMarket {
161
+ loanAsset: { address: string },
162
+ collateralAsset: { address: string },
163
+ oracle: { address: string },
164
+ irmAddress: string,
165
+ lltv: string,
166
+ }
167
+
168
+ export interface MorphoBluePublicAllocatorItem {
169
+ vault: MorphoBlueVault,
170
+ assets: string,
171
+ allocationMarket: MorphoBlueAllocationMarket,
172
+ }
173
+
174
+ export interface MorphoBlueRealloactionMarketData {
175
+ reallocatableLiquidityAssets: string,
176
+ publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
177
+ }
@@ -1,131 +1,131 @@
1
- import {
2
- MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
3
- } from './common';
4
- import { IncentiveData } from './aave';
5
-
6
- export enum SparkVersions {
7
- SparkV1 = 'v1default',
8
- }
9
-
10
- export interface SparkEModeCategoryData {
11
- label: string,
12
- liquidationBonus: string,
13
- liquidationRatio: string,
14
- collateralFactor: string,
15
- priceSource: string,
16
- }
17
-
18
- export interface SparkEModeCategoryDataMapping {
19
- enteringTerms: boolean[],
20
- canEnterCategory: boolean,
21
- id: number,
22
- data: SparkEModeCategoryData,
23
- assets: string[],
24
- enabledData: {
25
- ratio: string,
26
- liqRatio: string,
27
- liqPercent: string,
28
- collRatio: string,
29
- }
30
- }
31
-
32
- export interface SparkMarketData {
33
- chainIds: NetworkNumber[],
34
- label: string,
35
- shortLabel: string,
36
- url: string,
37
- value: SparkVersions,
38
- assets: readonly string[],
39
- provider: '' | 'SparkPoolAddressesProvider',
40
- providerAddress: string,
41
- lendingPool: 'SparkLendingPool',
42
- lendingPoolAddress: string,
43
- protocolData: '' | 'SparkProtocolDataProvider',
44
- protocolDataAddress: string
45
- subVersionLabel?: string
46
- // icon: Function,
47
- protocolName: string,
48
- disabled?: boolean,
49
- }
50
-
51
- export interface SparkAssetData extends MMAssetData {
52
- totalBorrowVar: string,
53
- sortIndex?: number,
54
- usageAsCollateralEnabled: boolean,
55
- isIsolated: boolean,
56
- eModeCategory: number,
57
- eModeCategoryData: SparkEModeCategoryData,
58
- liquidationRatio: string,
59
- supplyIncentives?: IncentiveData[];
60
- borrowIncentives?: IncentiveData[];
61
- }
62
-
63
- export interface SparkAssetsData {
64
- [token: string]: SparkAssetData,
65
- }
66
-
67
- export type SparkMarketsData = { assetsData: SparkAssetsData };
68
-
69
- export interface SparkUsedAsset extends MMUsedAsset {
70
- stableBorrowRate: string,
71
- borrowedStable: string,
72
- borrowedVariable: string,
73
- borrowedUsdStable: string,
74
- borrowedUsdVariable: string,
75
- stableLimit: string,
76
- variableLimit: string,
77
- limit: string,
78
- eModeCategory: number,
79
- }
80
-
81
- export interface SparkUsedAssets {
82
- [token: string]: SparkUsedAsset,
83
- }
84
-
85
- export interface SparkHelperCommon {
86
- usedAssets: SparkUsedAssets,
87
- eModeCategory: number,
88
- eModeCategories?: object,
89
- assetsData: SparkAssetsData,
90
- selectedMarket?: SparkMarketData,
91
- network?: NetworkNumber,
92
- }
93
-
94
- export interface SparkAggregatedPositionData {
95
- suppliedUsd: string,
96
- suppliedCollateralUsd: string,
97
- borrowedUsd: string,
98
- borrowLimitUsd: string,
99
- liquidationLimitUsd: string,
100
- leftToBorrowUsd: string,
101
- ratio: string,
102
- collRatio: string,
103
- netApy: string,
104
- incentiveUsd: string,
105
- totalInterestUsd: string,
106
- liqRatio: string,
107
- liqPercent: string,
108
- leveragedType: string,
109
- leveragedAsset?: string,
110
- leveragedLsdAssetRatio?: string,
111
- liquidationPrice?: string,
112
- }
113
-
114
- export interface SparkPositionData extends MMPositionData {
115
- ratio: string,
116
- minRatio: string,
117
- collRatio: string,
118
- borrowedUsd: string,
119
- borrowLimitUsd: string,
120
- suppliedCollateralUsd: string,
121
- incentiveUsd: string,
122
- totalInterestUsd: string,
123
- isSubscribedToAutomation?: boolean,
124
- automationResubscribeRequired?: boolean,
125
- totalSupplied: string,
126
- usedAssets: SparkUsedAssets,
127
- eModeCategory: number,
128
- isInIsolationMode: boolean,
129
- isInSiloedMode: boolean,
130
- eModeCategories: { [key: number]: SparkEModeCategoryDataMapping },
131
- }
1
+ import {
2
+ MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
3
+ } from './common';
4
+ import { IncentiveData } from './aave';
5
+
6
+ export enum SparkVersions {
7
+ SparkV1 = 'v1default',
8
+ }
9
+
10
+ export interface SparkEModeCategoryData {
11
+ label: string,
12
+ liquidationBonus: string,
13
+ liquidationRatio: string,
14
+ collateralFactor: string,
15
+ priceSource: string,
16
+ }
17
+
18
+ export interface SparkEModeCategoryDataMapping {
19
+ enteringTerms: boolean[],
20
+ canEnterCategory: boolean,
21
+ id: number,
22
+ data: SparkEModeCategoryData,
23
+ assets: string[],
24
+ enabledData: {
25
+ ratio: string,
26
+ liqRatio: string,
27
+ liqPercent: string,
28
+ collRatio: string,
29
+ }
30
+ }
31
+
32
+ export interface SparkMarketData {
33
+ chainIds: NetworkNumber[],
34
+ label: string,
35
+ shortLabel: string,
36
+ url: string,
37
+ value: SparkVersions,
38
+ assets: readonly string[],
39
+ provider: '' | 'SparkPoolAddressesProvider',
40
+ providerAddress: string,
41
+ lendingPool: 'SparkLendingPool',
42
+ lendingPoolAddress: string,
43
+ protocolData: '' | 'SparkProtocolDataProvider',
44
+ protocolDataAddress: string
45
+ subVersionLabel?: string
46
+ // icon: Function,
47
+ protocolName: string,
48
+ disabled?: boolean,
49
+ }
50
+
51
+ export interface SparkAssetData extends MMAssetData {
52
+ totalBorrowVar: string,
53
+ sortIndex?: number,
54
+ usageAsCollateralEnabled: boolean,
55
+ isIsolated: boolean,
56
+ eModeCategory: number,
57
+ eModeCategoryData: SparkEModeCategoryData,
58
+ liquidationRatio: string,
59
+ supplyIncentives?: IncentiveData[];
60
+ borrowIncentives?: IncentiveData[];
61
+ }
62
+
63
+ export interface SparkAssetsData {
64
+ [token: string]: SparkAssetData,
65
+ }
66
+
67
+ export type SparkMarketsData = { assetsData: SparkAssetsData };
68
+
69
+ export interface SparkUsedAsset extends MMUsedAsset {
70
+ stableBorrowRate: string,
71
+ borrowedStable: string,
72
+ borrowedVariable: string,
73
+ borrowedUsdStable: string,
74
+ borrowedUsdVariable: string,
75
+ stableLimit: string,
76
+ variableLimit: string,
77
+ limit: string,
78
+ eModeCategory: number,
79
+ }
80
+
81
+ export interface SparkUsedAssets {
82
+ [token: string]: SparkUsedAsset,
83
+ }
84
+
85
+ export interface SparkHelperCommon {
86
+ usedAssets: SparkUsedAssets,
87
+ eModeCategory: number,
88
+ eModeCategories?: object,
89
+ assetsData: SparkAssetsData,
90
+ selectedMarket?: SparkMarketData,
91
+ network?: NetworkNumber,
92
+ }
93
+
94
+ export interface SparkAggregatedPositionData {
95
+ suppliedUsd: string,
96
+ suppliedCollateralUsd: string,
97
+ borrowedUsd: string,
98
+ borrowLimitUsd: string,
99
+ liquidationLimitUsd: string,
100
+ leftToBorrowUsd: string,
101
+ ratio: string,
102
+ collRatio: string,
103
+ netApy: string,
104
+ incentiveUsd: string,
105
+ totalInterestUsd: string,
106
+ liqRatio: string,
107
+ liqPercent: string,
108
+ leveragedType: string,
109
+ leveragedAsset?: string,
110
+ leveragedLsdAssetRatio?: string,
111
+ liquidationPrice?: string,
112
+ }
113
+
114
+ export interface SparkPositionData extends MMPositionData {
115
+ ratio: string,
116
+ minRatio: string,
117
+ collRatio: string,
118
+ borrowedUsd: string,
119
+ borrowLimitUsd: string,
120
+ suppliedCollateralUsd: string,
121
+ incentiveUsd: string,
122
+ totalInterestUsd: string,
123
+ isSubscribedToAutomation?: boolean,
124
+ automationResubscribeRequired?: boolean,
125
+ totalSupplied: string,
126
+ usedAssets: SparkUsedAssets,
127
+ eModeCategory: number,
128
+ isInIsolationMode: boolean,
129
+ isInSiloedMode: boolean,
130
+ eModeCategories: { [key: number]: SparkEModeCategoryDataMapping },
131
+ }
@@ -1,17 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "name": "Attach by Process ID",
9
- "processId": "${command:PickProcess}",
10
- "request": "attach",
11
- "skipFiles": [
12
- "<node_internals>/**"
13
- ],
14
- "type": "node"
15
- }
16
- ]
17
- }
@@ -1,37 +0,0 @@
1
- {
2
- "workbench.colorCustomizations": {
3
- "activityBar.activeBackground": "#f2255a",
4
- "activityBar.background": "#f2255a",
5
- "activityBar.foreground": "#e7e7e7",
6
- "activityBar.inactiveForeground": "#e7e7e799",
7
- "activityBarBadge.background": "#40d30d",
8
- "activityBarBadge.foreground": "#15202b",
9
- "commandCenter.border": "#e7e7e799",
10
- "sash.hoverBorder": "#f2255a",
11
- "statusBar.background": "#d70d41",
12
- "statusBar.foreground": "#e7e7e7",
13
- "statusBarItem.hoverBackground": "#f2255a",
14
- "statusBarItem.remoteBackground": "#d70d41",
15
- "statusBarItem.remoteForeground": "#e7e7e7",
16
- "titleBar.activeBackground": "#d70d41",
17
- "titleBar.activeForeground": "#e7e7e7",
18
- "titleBar.inactiveBackground": "#d70d4199",
19
- "titleBar.inactiveForeground": "#e7e7e799"
20
- },
21
- "peacock.color": "#d70d41",
22
- "editor.defaultFormatter": "dbaeumer.vscode-eslint",
23
- "eslint.format.enable": true,
24
-
25
- "[javascript]": {
26
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
27
- },
28
- "[typescript]": {
29
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
30
- },
31
- "[vue]": {
32
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
33
- },
34
- "[typescriptreact]": {
35
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
36
- }
37
- }