@defisaver/positions-sdk 2.0.10 → 2.0.11-dev-linea-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.
Files changed (108) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +64 -64
  4. package/cjs/aaveV3/index.js +1 -1
  5. package/cjs/config/contracts.d.ts +194 -33
  6. package/cjs/config/contracts.js +18 -1
  7. package/cjs/contracts.d.ts +1283 -293
  8. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  9. package/cjs/markets/aave/index.js +1 -1
  10. package/cjs/markets/aave/marketAssets.d.ts +4 -0
  11. package/cjs/markets/aave/marketAssets.js +6 -2
  12. package/cjs/markets/compound/index.js +11 -0
  13. package/cjs/markets/compound/marketsAssets.d.ts +7 -0
  14. package/cjs/markets/compound/marketsAssets.js +7 -0
  15. package/cjs/markets/spark/marketAssets.d.ts +1 -0
  16. package/cjs/markets/spark/marketAssets.js +1 -0
  17. package/cjs/portfolio/index.js +2 -2
  18. package/cjs/services/utils.js +1 -1
  19. package/cjs/services/viem.d.ts +46 -0
  20. package/cjs/services/viem.js +2 -0
  21. package/cjs/staking/staking.js +3 -1
  22. package/cjs/types/common.d.ts +2 -1
  23. package/cjs/types/common.js +1 -0
  24. package/esm/aaveV3/index.js +1 -1
  25. package/esm/config/contracts.d.ts +194 -33
  26. package/esm/config/contracts.js +18 -1
  27. package/esm/contracts.d.ts +1283 -293
  28. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  29. package/esm/markets/aave/index.js +1 -1
  30. package/esm/markets/aave/marketAssets.d.ts +4 -0
  31. package/esm/markets/aave/marketAssets.js +5 -1
  32. package/esm/markets/compound/index.js +11 -0
  33. package/esm/markets/compound/marketsAssets.d.ts +7 -0
  34. package/esm/markets/compound/marketsAssets.js +7 -0
  35. package/esm/markets/spark/marketAssets.d.ts +1 -0
  36. package/esm/markets/spark/marketAssets.js +1 -0
  37. package/esm/portfolio/index.js +2 -2
  38. package/esm/services/utils.js +1 -1
  39. package/esm/services/viem.d.ts +46 -0
  40. package/esm/services/viem.js +3 -1
  41. package/esm/staking/staking.js +3 -1
  42. package/esm/types/common.d.ts +2 -1
  43. package/esm/types/common.js +1 -0
  44. package/package.json +47 -47
  45. package/src/aaveV2/index.ts +236 -236
  46. package/src/aaveV3/index.ts +488 -489
  47. package/src/compoundV2/index.ts +240 -240
  48. package/src/compoundV3/index.ts +270 -270
  49. package/src/config/contracts.ts +1107 -1090
  50. package/src/constants/index.ts +6 -6
  51. package/src/contracts.ts +107 -107
  52. package/src/curveUsd/index.ts +250 -250
  53. package/src/eulerV2/index.ts +314 -314
  54. package/src/exchange/index.ts +25 -25
  55. package/src/fluid/index.ts +1568 -1568
  56. package/src/helpers/aaveHelpers/index.ts +170 -170
  57. package/src/helpers/compoundHelpers/index.ts +261 -261
  58. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  59. package/src/helpers/eulerHelpers/index.ts +259 -259
  60. package/src/helpers/fluidHelpers/index.ts +324 -324
  61. package/src/helpers/index.ts +10 -10
  62. package/src/helpers/liquityV2Helpers/index.ts +80 -80
  63. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  64. package/src/helpers/makerHelpers/index.ts +52 -52
  65. package/src/helpers/morphoBlueHelpers/index.ts +390 -390
  66. package/src/helpers/sparkHelpers/index.ts +155 -155
  67. package/src/index.ts +45 -45
  68. package/src/liquity/index.ts +104 -104
  69. package/src/liquityV2/index.ts +408 -408
  70. package/src/llamaLend/index.ts +296 -296
  71. package/src/maker/index.ts +223 -223
  72. package/src/markets/aave/index.ts +116 -116
  73. package/src/markets/aave/marketAssets.ts +49 -44
  74. package/src/markets/compound/index.ts +227 -216
  75. package/src/markets/compound/marketsAssets.ts +90 -83
  76. package/src/markets/curveUsd/index.ts +69 -69
  77. package/src/markets/euler/index.ts +26 -26
  78. package/src/markets/fluid/index.ts +2456 -2456
  79. package/src/markets/index.ts +25 -25
  80. package/src/markets/liquityV2/index.ts +102 -102
  81. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  82. package/src/markets/llamaLend/index.ts +235 -235
  83. package/src/markets/morphoBlue/index.ts +895 -895
  84. package/src/markets/spark/index.ts +29 -29
  85. package/src/markets/spark/marketAssets.ts +11 -10
  86. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  87. package/src/morphoBlue/index.ts +222 -222
  88. package/src/portfolio/index.ts +285 -285
  89. package/src/services/priceService.ts +159 -159
  90. package/src/services/utils.ts +63 -63
  91. package/src/services/viem.ts +32 -30
  92. package/src/setup.ts +8 -8
  93. package/src/spark/index.ts +456 -456
  94. package/src/staking/staking.ts +193 -192
  95. package/src/types/aave.ts +194 -194
  96. package/src/types/common.ts +88 -87
  97. package/src/types/compound.ts +136 -136
  98. package/src/types/curveUsd.ts +121 -121
  99. package/src/types/euler.ts +174 -174
  100. package/src/types/fluid.ts +450 -450
  101. package/src/types/index.ts +11 -11
  102. package/src/types/liquity.ts +30 -30
  103. package/src/types/liquityV2.ts +126 -126
  104. package/src/types/llamaLend.ts +157 -157
  105. package/src/types/maker.ts +63 -63
  106. package/src/types/morphoBlue.ts +194 -194
  107. package/src/types/portfolio.ts +60 -60
  108. package/src/types/spark.ts +137 -137
@@ -1,64 +1,64 @@
1
- import { EthAddress, HexString } from './common';
2
-
3
- export interface IlkInfo {
4
- ilkLabel: string;
5
- currentRate: string;
6
- futureRate: string;
7
- minDebt: string;
8
- globalDebtCeiling: string;
9
- globalDebtCurrent: string;
10
- assetPrice: string;
11
- liqRatio: string;
12
- liqPercent: number;
13
- stabilityFee: number;
14
- liquidationFee: string;
15
- creatableDebt: string;
16
- }
17
-
18
- export enum CdpType {
19
- MCD = 'mcd',
20
- }
21
-
22
- export interface CdpInfo {
23
- id: number,
24
- ilk: HexString,
25
- ilkLabel: string,
26
- urn: HexString,
27
- asset: string,
28
- type: CdpType,
29
- owner: EthAddress,
30
- }
31
-
32
- export interface CdpData {
33
- owner: EthAddress,
34
- id: string,
35
- urn: EthAddress,
36
- type: CdpType,
37
- ilk: string,
38
- ilkLabel: string,
39
- asset: string,
40
- collateral: string,
41
- collateralUsd: string,
42
- futureDebt: string,
43
- debtDai: string,
44
- debtUsd: string,
45
- debtInAsset: string,
46
- debtAssetPrice: string,
47
- debtAssetMarketPrice: string,
48
- liquidationPrice: string,
49
- ratio: string,
50
- liqRatio: string,
51
- liqPercent: number,
52
- assetPrice: string,
53
- daiLabel: string,
54
- debtAsset: string,
55
- unclaimedCollateral: string,
56
- debtTooLow: boolean,
57
- minDebt: string,
58
- stabilityFee: number,
59
- creatableDebt: string,
60
- globalDebtCeiling: string,
61
- globalDebtCurrent: string,
62
- liquidationFee: string,
63
- lastUpdated: number,
1
+ import { EthAddress, HexString } from './common';
2
+
3
+ export interface IlkInfo {
4
+ ilkLabel: string;
5
+ currentRate: string;
6
+ futureRate: string;
7
+ minDebt: string;
8
+ globalDebtCeiling: string;
9
+ globalDebtCurrent: string;
10
+ assetPrice: string;
11
+ liqRatio: string;
12
+ liqPercent: number;
13
+ stabilityFee: number;
14
+ liquidationFee: string;
15
+ creatableDebt: string;
16
+ }
17
+
18
+ export enum CdpType {
19
+ MCD = 'mcd',
20
+ }
21
+
22
+ export interface CdpInfo {
23
+ id: number,
24
+ ilk: HexString,
25
+ ilkLabel: string,
26
+ urn: HexString,
27
+ asset: string,
28
+ type: CdpType,
29
+ owner: EthAddress,
30
+ }
31
+
32
+ export interface CdpData {
33
+ owner: EthAddress,
34
+ id: string,
35
+ urn: EthAddress,
36
+ type: CdpType,
37
+ ilk: string,
38
+ ilkLabel: string,
39
+ asset: string,
40
+ collateral: string,
41
+ collateralUsd: string,
42
+ futureDebt: string,
43
+ debtDai: string,
44
+ debtUsd: string,
45
+ debtInAsset: string,
46
+ debtAssetPrice: string,
47
+ debtAssetMarketPrice: string,
48
+ liquidationPrice: string,
49
+ ratio: string,
50
+ liqRatio: string,
51
+ liqPercent: number,
52
+ assetPrice: string,
53
+ daiLabel: string,
54
+ debtAsset: string,
55
+ unclaimedCollateral: string,
56
+ debtTooLow: boolean,
57
+ minDebt: string,
58
+ stabilityFee: number,
59
+ creatableDebt: string,
60
+ globalDebtCeiling: string,
61
+ globalDebtCurrent: string,
62
+ liquidationFee: string,
63
+ lastUpdated: number,
64
64
  }
@@ -1,194 +1,194 @@
1
- import { EthAddress, 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
- MorphoBlueLBTCWBTC_945 = 'morphobluelbtcwbtc_945', // LBTC/WBTC
25
- MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
26
- // ezETH/ETH
27
- MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
28
- MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
29
- // weETH/ETH
30
- MorphoBlueWeEthEth_860 = 'morphoblueweetheth_860',
31
- MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
32
- // wstETH/WETH
33
- MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
34
- MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
35
- MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
36
- // sUSDe/DAI
37
- MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
38
- MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
39
- MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
40
- MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
41
- // USDe/DAI
42
- MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
43
- MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
44
- MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
45
- MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
46
-
47
- // BASE
48
- MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
49
- MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
50
- MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
51
- MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
52
- MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
53
- MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
54
- MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
55
- MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
56
- MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
57
- MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
58
- MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
59
- MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
60
- MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
61
- MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
62
- MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
63
- MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
64
- MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
65
- }
66
-
67
- export enum MorphoBlueOracleType {
68
- MARKET_RATE = 'Market rate',
69
- LIDO_RATE = 'Lido rate',
70
- ETHENA_RATE = 'Ethena rate',
71
- CONTRACT_RATE = 'Contract rate',
72
- }
73
-
74
- export interface MorphoBlueMarketData {
75
- chainIds: NetworkNumber[],
76
- label: string,
77
- shortLabel: string,
78
- url: string,
79
- value: MorphoBlueVersions,
80
- loanToken: EthAddress,
81
- collateralToken: EthAddress,
82
- oracle: EthAddress,
83
- oracleType: MorphoBlueOracleType,
84
- irm: EthAddress,
85
- lltv: number | string,
86
- marketId: string,
87
- // icon: Function,
88
- protocolName: string,
89
- }
90
-
91
- export interface MorphoBlueAssetData {
92
- symbol: string,
93
- address: string,
94
- price: string,
95
- supplyRate: string,
96
- borrowRate: string,
97
- incentiveSupplyApy?: string,
98
- incentiveSupplyToken?: string,
99
- incentiveBorrowApy?: string,
100
- incentiveBorrowToken?: string,
101
- totalSupply?: string,
102
- totalBorrow?: string,
103
- canBeSupplied?: boolean,
104
- canBeBorrowed?: boolean,
105
- }
106
-
107
- export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
108
-
109
- export interface MorphoBlueMarketInfo {
110
- id: string,
111
- fee: string,
112
- loanToken: string,
113
- collateralToken: string,
114
- utillization: string,
115
- oracle: string,
116
- oracleType: MorphoBlueOracleType,
117
- lltv: string,
118
- minRatio: string,
119
- assetsData: MorphoBlueAssetsData,
120
- }
121
-
122
- export interface MorphoBlueAggregatedPositionData {
123
- suppliedUsd: string,
124
- suppliedCollateralUsd: string,
125
- borrowedUsd: string,
126
- borrowLimitUsd: string,
127
- liquidationLimitUsd: string,
128
- leftToBorrowUsd: string,
129
- leftToBorrow: string,
130
- netApy: string,
131
- incentiveUsd: string,
132
- totalInterestUsd: string,
133
- ltv: string,
134
- ratio: string,
135
- leveragedType: string,
136
- leveragedAsset?: string,
137
- leveragedLsdAssetRatio?: string,
138
- liquidationPrice?: string,
139
- minCollRatio?: string,
140
- collLiquidationRatio?: string,
141
- }
142
-
143
- export interface MorphoBluePositionData {
144
- usedAssets: MMUsedAssets,
145
- suppliedUsd: string,
146
- suppliedCollateralUsd: string,
147
- borrowedUsd: string,
148
- borrowLimitUsd: string,
149
- liquidationLimitUsd: string,
150
- leftToBorrowUsd: string,
151
- leftToBorrow: string,
152
- netApy: string,
153
- incentiveUsd: string,
154
- totalInterestUsd: string,
155
- ltv: string,
156
- ratio: string,
157
- leveragedType: string,
158
- leveragedAsset?: string,
159
- leveragedLsdAssetRatio?: string,
160
- liquidationPrice?: string,
161
- supplyShares: string,
162
- borrowShares: string,
163
- }
164
-
165
- export interface MorphoBlueVault {
166
- address: string,
167
- }
168
-
169
- export interface MorphoBlueAllocationMarket {
170
- loanAsset: { address: string },
171
- collateralAsset: { address: string },
172
- oracle: { address: string },
173
- irmAddress: string,
174
- lltv: string,
175
- uniqueKey: string,
176
- }
177
-
178
- export interface MorphoBluePublicAllocatorItem {
179
- vault: MorphoBlueVault,
180
- assets: string,
181
- allocationMarket: MorphoBlueAllocationMarket,
182
- }
183
-
184
- export interface MorphoBlueAllocatorMarketState {
185
- borrowAssets: string,
186
- supplyAssets: string,
187
- }
188
-
189
- export interface MorphoBlueRealloactionMarketData {
190
- reallocatableLiquidityAssets: string,
191
- targetBorrowUtilization: string,
192
- publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
193
- state: MorphoBlueAllocatorMarketState,
194
- }
1
+ import { EthAddress, 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
+ MorphoBlueLBTCWBTC_945 = 'morphobluelbtcwbtc_945', // LBTC/WBTC
25
+ MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
26
+ // ezETH/ETH
27
+ MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
28
+ MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
29
+ // weETH/ETH
30
+ MorphoBlueWeEthEth_860 = 'morphoblueweetheth_860',
31
+ MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
32
+ // wstETH/WETH
33
+ MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
34
+ MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
35
+ MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
36
+ // sUSDe/DAI
37
+ MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
38
+ MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
39
+ MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
40
+ MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
41
+ // USDe/DAI
42
+ MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
43
+ MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
44
+ MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
45
+ MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
46
+
47
+ // BASE
48
+ MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
49
+ MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
50
+ MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
51
+ MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
52
+ MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
53
+ MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
54
+ MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
55
+ MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
56
+ MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
57
+ MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
58
+ MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
59
+ MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
60
+ MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
61
+ MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
62
+ MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
63
+ MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
64
+ MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
65
+ }
66
+
67
+ export enum MorphoBlueOracleType {
68
+ MARKET_RATE = 'Market rate',
69
+ LIDO_RATE = 'Lido rate',
70
+ ETHENA_RATE = 'Ethena rate',
71
+ CONTRACT_RATE = 'Contract rate',
72
+ }
73
+
74
+ export interface MorphoBlueMarketData {
75
+ chainIds: NetworkNumber[],
76
+ label: string,
77
+ shortLabel: string,
78
+ url: string,
79
+ value: MorphoBlueVersions,
80
+ loanToken: EthAddress,
81
+ collateralToken: EthAddress,
82
+ oracle: EthAddress,
83
+ oracleType: MorphoBlueOracleType,
84
+ irm: EthAddress,
85
+ lltv: number | string,
86
+ marketId: string,
87
+ // icon: Function,
88
+ protocolName: string,
89
+ }
90
+
91
+ export interface MorphoBlueAssetData {
92
+ symbol: string,
93
+ address: string,
94
+ price: string,
95
+ supplyRate: string,
96
+ borrowRate: string,
97
+ incentiveSupplyApy?: string,
98
+ incentiveSupplyToken?: string,
99
+ incentiveBorrowApy?: string,
100
+ incentiveBorrowToken?: string,
101
+ totalSupply?: string,
102
+ totalBorrow?: string,
103
+ canBeSupplied?: boolean,
104
+ canBeBorrowed?: boolean,
105
+ }
106
+
107
+ export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
108
+
109
+ export interface MorphoBlueMarketInfo {
110
+ id: string,
111
+ fee: string,
112
+ loanToken: string,
113
+ collateralToken: string,
114
+ utillization: string,
115
+ oracle: string,
116
+ oracleType: MorphoBlueOracleType,
117
+ lltv: string,
118
+ minRatio: string,
119
+ assetsData: MorphoBlueAssetsData,
120
+ }
121
+
122
+ export interface MorphoBlueAggregatedPositionData {
123
+ suppliedUsd: string,
124
+ suppliedCollateralUsd: string,
125
+ borrowedUsd: string,
126
+ borrowLimitUsd: string,
127
+ liquidationLimitUsd: string,
128
+ leftToBorrowUsd: string,
129
+ leftToBorrow: string,
130
+ netApy: string,
131
+ incentiveUsd: string,
132
+ totalInterestUsd: string,
133
+ ltv: string,
134
+ ratio: string,
135
+ leveragedType: string,
136
+ leveragedAsset?: string,
137
+ leveragedLsdAssetRatio?: string,
138
+ liquidationPrice?: string,
139
+ minCollRatio?: string,
140
+ collLiquidationRatio?: string,
141
+ }
142
+
143
+ export interface MorphoBluePositionData {
144
+ usedAssets: MMUsedAssets,
145
+ suppliedUsd: string,
146
+ suppliedCollateralUsd: string,
147
+ borrowedUsd: string,
148
+ borrowLimitUsd: string,
149
+ liquidationLimitUsd: string,
150
+ leftToBorrowUsd: string,
151
+ leftToBorrow: string,
152
+ netApy: string,
153
+ incentiveUsd: string,
154
+ totalInterestUsd: string,
155
+ ltv: string,
156
+ ratio: string,
157
+ leveragedType: string,
158
+ leveragedAsset?: string,
159
+ leveragedLsdAssetRatio?: string,
160
+ liquidationPrice?: string,
161
+ supplyShares: string,
162
+ borrowShares: string,
163
+ }
164
+
165
+ export interface MorphoBlueVault {
166
+ address: string,
167
+ }
168
+
169
+ export interface MorphoBlueAllocationMarket {
170
+ loanAsset: { address: string },
171
+ collateralAsset: { address: string },
172
+ oracle: { address: string },
173
+ irmAddress: string,
174
+ lltv: string,
175
+ uniqueKey: string,
176
+ }
177
+
178
+ export interface MorphoBluePublicAllocatorItem {
179
+ vault: MorphoBlueVault,
180
+ assets: string,
181
+ allocationMarket: MorphoBlueAllocationMarket,
182
+ }
183
+
184
+ export interface MorphoBlueAllocatorMarketState {
185
+ borrowAssets: string,
186
+ supplyAssets: string,
187
+ }
188
+
189
+ export interface MorphoBlueRealloactionMarketData {
190
+ reallocatableLiquidityAssets: string,
191
+ targetBorrowUtilization: string,
192
+ publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
193
+ state: MorphoBlueAllocatorMarketState,
194
+ }
@@ -1,61 +1,61 @@
1
- import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
2
- import { EthAddress } from './common';
3
- import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
4
- import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
5
- import { EulerV2PositionData, EulerV2Versions } from './euler';
6
- import { FluidVaultData } from './fluid';
7
- import { LiquityTroveInfo } from './liquity';
8
- import { LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
9
- import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
10
- import { CdpData } from './maker';
11
- import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
12
- import { SparkPositionData, SparkVersions } from './spark';
13
-
14
- export interface PortfolioProtocolData<T> {
15
- error: string,
16
- data: T | null,
17
- }
18
-
19
- export interface PortfolioPositionsDataForAddress {
20
- aaveV3: {
21
- [key in AaveVersions]?: PortfolioProtocolData<AaveV3PositionData>;
22
- };
23
- morphoBlue: {
24
- [key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBluePositionData>;
25
- };
26
- compoundV3: {
27
- [key in CompoundVersions]?: PortfolioProtocolData<CompoundV3PositionData>;
28
- };
29
- spark: {
30
- [key in SparkVersions]?: PortfolioProtocolData<SparkPositionData>;
31
- };
32
- eulerV2: {
33
- [key in EulerV2Versions]?: Record<EthAddress, PortfolioProtocolData<EulerV2PositionData>>;
34
- };
35
- maker: {
36
- [key: string]: PortfolioProtocolData<CdpData>;
37
- };
38
- aaveV2: {
39
- [key in AaveVersions]?: PortfolioProtocolData<AaveV2PositionData>;
40
- };
41
- compoundV2: {
42
- [key in CompoundVersions]?: PortfolioProtocolData<CompoundV2PositionData>;
43
- };
44
- liquity: PortfolioProtocolData<LiquityTroveInfo> | {};
45
- crvUsd: {
46
- [key in CrvUSDVersions]?: PortfolioProtocolData<CrvUSDUserData>;
47
- };
48
- llamaLend: {
49
- [key in LlamaLendVersionsType]?: PortfolioProtocolData<LlamaLendUserData>;
50
- };
51
- fluid: {
52
- error: string;
53
- data: {
54
- [key: string]: FluidVaultData;
55
- };
56
- };
57
- }
58
-
59
- export interface PortfolioPositionsData {
60
- [key: EthAddress]: PortfolioPositionsDataForAddress;
1
+ import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
2
+ import { EthAddress } from './common';
3
+ import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
4
+ import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
5
+ import { EulerV2PositionData, EulerV2Versions } from './euler';
6
+ import { FluidVaultData } from './fluid';
7
+ import { LiquityTroveInfo } from './liquity';
8
+ import { LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
9
+ import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
10
+ import { CdpData } from './maker';
11
+ import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
12
+ import { SparkPositionData, SparkVersions } from './spark';
13
+
14
+ export interface PortfolioProtocolData<T> {
15
+ error: string,
16
+ data: T | null,
17
+ }
18
+
19
+ export interface PortfolioPositionsDataForAddress {
20
+ aaveV3: {
21
+ [key in AaveVersions]?: PortfolioProtocolData<AaveV3PositionData>;
22
+ };
23
+ morphoBlue: {
24
+ [key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBluePositionData>;
25
+ };
26
+ compoundV3: {
27
+ [key in CompoundVersions]?: PortfolioProtocolData<CompoundV3PositionData>;
28
+ };
29
+ spark: {
30
+ [key in SparkVersions]?: PortfolioProtocolData<SparkPositionData>;
31
+ };
32
+ eulerV2: {
33
+ [key in EulerV2Versions]?: Record<EthAddress, PortfolioProtocolData<EulerV2PositionData>>;
34
+ };
35
+ maker: {
36
+ [key: string]: PortfolioProtocolData<CdpData>;
37
+ };
38
+ aaveV2: {
39
+ [key in AaveVersions]?: PortfolioProtocolData<AaveV2PositionData>;
40
+ };
41
+ compoundV2: {
42
+ [key in CompoundVersions]?: PortfolioProtocolData<CompoundV2PositionData>;
43
+ };
44
+ liquity: PortfolioProtocolData<LiquityTroveInfo> | {};
45
+ crvUsd: {
46
+ [key in CrvUSDVersions]?: PortfolioProtocolData<CrvUSDUserData>;
47
+ };
48
+ llamaLend: {
49
+ [key in LlamaLendVersionsType]?: PortfolioProtocolData<LlamaLendUserData>;
50
+ };
51
+ fluid: {
52
+ error: string;
53
+ data: {
54
+ [key: string]: FluidVaultData;
55
+ };
56
+ };
57
+ }
58
+
59
+ export interface PortfolioPositionsData {
60
+ [key: EthAddress]: PortfolioPositionsDataForAddress;
61
61
  }