@defisaver/positions-sdk 2.1.8 → 2.1.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.
Files changed (96) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/CLAUDE.md +32 -0
  4. package/README.md +64 -64
  5. package/cjs/fluid/index.js +40 -12
  6. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  7. package/cjs/markets/fluid/index.d.ts +4 -0
  8. package/cjs/markets/fluid/index.js +4 -0
  9. package/cjs/types/fluid.d.ts +7 -3
  10. package/cjs/types/fluid.js +4 -0
  11. package/esm/fluid/index.js +40 -12
  12. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  13. package/esm/markets/fluid/index.d.ts +4 -0
  14. package/esm/markets/fluid/index.js +4 -0
  15. package/esm/types/fluid.d.ts +7 -3
  16. package/esm/types/fluid.js +4 -0
  17. package/package.json +47 -47
  18. package/src/aaveV2/index.ts +240 -240
  19. package/src/aaveV3/index.ts +614 -614
  20. package/src/aaveV3/merit.ts +97 -97
  21. package/src/aaveV3/merkl.ts +74 -74
  22. package/src/claiming/aaveV3.ts +154 -154
  23. package/src/claiming/compV3.ts +22 -22
  24. package/src/claiming/index.ts +12 -12
  25. package/src/claiming/king.ts +66 -66
  26. package/src/claiming/morphoBlue.ts +118 -118
  27. package/src/claiming/spark.ts +225 -225
  28. package/src/compoundV2/index.ts +244 -244
  29. package/src/compoundV3/index.ts +274 -274
  30. package/src/config/contracts.ts +1251 -1251
  31. package/src/constants/index.ts +10 -10
  32. package/src/contracts.ts +120 -120
  33. package/src/curveUsd/index.ts +254 -254
  34. package/src/eulerV2/index.ts +324 -324
  35. package/src/exchange/index.ts +25 -25
  36. package/src/fluid/index.ts +1668 -1638
  37. package/src/helpers/aaveHelpers/index.ts +187 -187
  38. package/src/helpers/compoundHelpers/index.ts +283 -283
  39. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  40. package/src/helpers/eulerHelpers/index.ts +222 -222
  41. package/src/helpers/fluidHelpers/index.ts +326 -326
  42. package/src/helpers/index.ts +10 -10
  43. package/src/helpers/liquityV2Helpers/index.ts +82 -82
  44. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  45. package/src/helpers/makerHelpers/index.ts +52 -52
  46. package/src/helpers/morphoBlueHelpers/index.ts +396 -396
  47. package/src/helpers/sparkHelpers/index.ts +155 -155
  48. package/src/index.ts +47 -47
  49. package/src/liquity/index.ts +159 -159
  50. package/src/liquityV2/index.ts +657 -657
  51. package/src/llamaLend/index.ts +305 -305
  52. package/src/maker/index.ts +223 -223
  53. package/src/markets/aave/index.ts +116 -116
  54. package/src/markets/aave/marketAssets.ts +54 -54
  55. package/src/markets/compound/index.ts +238 -238
  56. package/src/markets/compound/marketsAssets.ts +97 -97
  57. package/src/markets/curveUsd/index.ts +69 -69
  58. package/src/markets/euler/index.ts +26 -26
  59. package/src/markets/fluid/index.ts +2460 -2456
  60. package/src/markets/index.ts +25 -25
  61. package/src/markets/liquityV2/index.ts +102 -102
  62. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  63. package/src/markets/llamaLend/index.ts +235 -235
  64. package/src/markets/morphoBlue/index.ts +895 -895
  65. package/src/markets/spark/index.ts +29 -29
  66. package/src/markets/spark/marketAssets.ts +12 -12
  67. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  68. package/src/morphoBlue/index.ts +274 -274
  69. package/src/portfolio/index.ts +570 -570
  70. package/src/services/priceService.ts +159 -159
  71. package/src/services/utils.ts +115 -115
  72. package/src/services/viem.ts +34 -34
  73. package/src/setup.ts +8 -8
  74. package/src/spark/index.ts +445 -445
  75. package/src/staking/eligibility.ts +53 -53
  76. package/src/staking/index.ts +1 -1
  77. package/src/staking/staking.ts +170 -170
  78. package/src/types/aave.ts +189 -189
  79. package/src/types/claiming.ts +109 -109
  80. package/src/types/common.ts +107 -107
  81. package/src/types/compound.ts +136 -136
  82. package/src/types/curveUsd.ts +123 -123
  83. package/src/types/euler.ts +175 -175
  84. package/src/types/fluid.ts +452 -448
  85. package/src/types/index.ts +13 -13
  86. package/src/types/liquity.ts +30 -30
  87. package/src/types/liquityV2.ts +126 -126
  88. package/src/types/llamaLend.ts +159 -159
  89. package/src/types/maker.ts +63 -63
  90. package/src/types/merit.ts +1 -1
  91. package/src/types/merkl.ts +70 -70
  92. package/src/types/morphoBlue.ts +194 -194
  93. package/src/types/portfolio.ts +60 -60
  94. package/src/types/spark.ts +135 -135
  95. package/src/umbrella/index.ts +69 -69
  96. package/src/umbrella/umbrellaUtils.ts +29 -29
@@ -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,2 +1,2 @@
1
- export type MeritRewardInfo = { apy: string; rewardTokenSymbol: string, description: string };
1
+ export type MeritRewardInfo = { apy: string; rewardTokenSymbol: string, description: string };
2
2
  export type MeritTokenRewardMap = { supply: Record<string, MeritRewardInfo>; borrow: Record<string, MeritRewardInfo> };
@@ -1,71 +1,71 @@
1
- import { EthAddress } from './common';
2
-
3
- export enum OpportunityAction {
4
- LEND = 'LEND',
5
- BORROW = 'BORROW',
6
- }
7
-
8
- export enum OpportunityStatus {
9
- LIVE = 'LIVE',
10
- PAST = 'PAST',
11
- UPCOMING = 'UPCOMING',
12
- }
13
-
14
- export type MerklOpportunity = {
15
- chainId: number;
16
- type: string;
17
- identifier: EthAddress;
18
- name: string;
19
- status: OpportunityStatus;
20
- action: OpportunityAction;
21
- tvl: number;
22
- apr: number;
23
- dailyRewards: number;
24
- tags: [];
25
- id: string;
26
- explorerAddress?: EthAddress;
27
- description?: string;
28
- tokens: {
29
- id: string;
30
- name: string;
31
- chainId: number;
32
- address: EthAddress;
33
- decimals: number;
34
- icon: string;
35
- verified: boolean;
36
- isTest: boolean;
37
- price: number;
38
- symbol: string;
39
- }[];
40
- rewardsRecord: {
41
- id: string;
42
- total: number;
43
- timestamp: string;
44
- breakdowns: {
45
- token: {
46
- id: string;
47
- name: string;
48
- chainId: number;
49
- address: EthAddress;
50
- decimals: number;
51
- symbol: string;
52
- displaySymbol: string;
53
- icon: string;
54
- verified: boolean;
55
- isTest: boolean;
56
- type: string;
57
- isNative: boolean;
58
- price: number;
59
- };
60
- amount: string;
61
- value: number;
62
- distributionType: string;
63
- id: string;
64
- campaignId: string;
65
- dailyRewardsRecordId: string;
66
- }[];
67
- };
68
- };
69
-
70
- export type MerkleRewardInfo = { apy: string; rewardTokenSymbol: string, description: string, identifier: string };
1
+ import { EthAddress } from './common';
2
+
3
+ export enum OpportunityAction {
4
+ LEND = 'LEND',
5
+ BORROW = 'BORROW',
6
+ }
7
+
8
+ export enum OpportunityStatus {
9
+ LIVE = 'LIVE',
10
+ PAST = 'PAST',
11
+ UPCOMING = 'UPCOMING',
12
+ }
13
+
14
+ export type MerklOpportunity = {
15
+ chainId: number;
16
+ type: string;
17
+ identifier: EthAddress;
18
+ name: string;
19
+ status: OpportunityStatus;
20
+ action: OpportunityAction;
21
+ tvl: number;
22
+ apr: number;
23
+ dailyRewards: number;
24
+ tags: [];
25
+ id: string;
26
+ explorerAddress?: EthAddress;
27
+ description?: string;
28
+ tokens: {
29
+ id: string;
30
+ name: string;
31
+ chainId: number;
32
+ address: EthAddress;
33
+ decimals: number;
34
+ icon: string;
35
+ verified: boolean;
36
+ isTest: boolean;
37
+ price: number;
38
+ symbol: string;
39
+ }[];
40
+ rewardsRecord: {
41
+ id: string;
42
+ total: number;
43
+ timestamp: string;
44
+ breakdowns: {
45
+ token: {
46
+ id: string;
47
+ name: string;
48
+ chainId: number;
49
+ address: EthAddress;
50
+ decimals: number;
51
+ symbol: string;
52
+ displaySymbol: string;
53
+ icon: string;
54
+ verified: boolean;
55
+ isTest: boolean;
56
+ type: string;
57
+ isNative: boolean;
58
+ price: number;
59
+ };
60
+ amount: string;
61
+ value: number;
62
+ distributionType: string;
63
+ id: string;
64
+ campaignId: string;
65
+ dailyRewardsRecordId: string;
66
+ }[];
67
+ };
68
+ };
69
+
70
+ export type MerkleRewardInfo = { apy: string; rewardTokenSymbol: string, description: string, identifier: string };
71
71
  export type MerkleRewardMap = Record<EthAddress, { supply?: MerkleRewardInfo; borrow?: MerkleRewardInfo }>;
@@ -1,194 +1,194 @@
1
- import {
2
- EthAddress, IncentiveData, MMUsedAssets, NetworkNumber,
3
- } from './common';
4
-
5
- export enum MorphoBlueVersions {
6
- // MAINNET
7
- MorphoBlueWstEthUSDC = 'morphobluewstethusdc', // wstETH/USDC
8
- MorphoBlueSDAIUSDC = 'morphobluesdaiusdc', // sDAI/USDC
9
- MorphoBlueWBTCUSDC = 'morphobluewbtcusdc', // WBTC/USDC
10
- MorphoBlueEthUSDC = 'morphoblueethusdc', // ETH/USDC
11
- MorphoBlueWBTCUSDT = 'morphobluewbtcusdt', // WBTC/USDT
12
- MorphoBlueWstEthUSDT = 'morphobluewstethusdt', // wstETH/USDT
13
- MorphoBlueWstEthUSDA_Exchange_Rate = 'morphobluewstethusda_exchange_rate', // wstETH/USDA
14
- MorphoBlueWstEthPYUSD = 'morphobluwstethpyusd', // wstETH/PYUSD
15
- MorphoBlueREthEth_945 = 'morphoblueretheth_945', // rETH/ETH
16
- MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
17
- MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
18
- MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
19
- MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
20
- MorphoBlueSDAIEth = 'morphobluesdaieth', // sDAI/ETH
21
- MorphoBlueMKRUSDC = 'morphobluemkrusdc', // MKR/USDC
22
- MorphoBlueTBTCUSDC = 'morphobluetbtcusdc', // tBTC/USDC
23
- MorphoBlueCbBTCEth_915 = 'morphobluecbbtceth', // cbBTC/Eth
24
- MorphoBlueCbBTCUSDC_860 = 'morphobluecbbtcusdc', // cbBTC/USDC
25
- MorphoBlueSUSDeUSDC_915 = 'morphobluesusdeusdc_915', // sUSDe/USDC
26
- MorphoBlueLBTCWBTC_945 = 'morphobluelbtcwbtc_945', // LBTC/WBTC
27
- MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
28
- // ezETH/ETH
29
- MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
30
- MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
31
- // weETH/ETH
32
- MorphoBlueWeEthEth_860 = 'morphoblueweetheth_860',
33
- MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
34
- // wstETH/WETH
35
- MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
36
- MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
37
- MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
38
- // sUSDe/DAI
39
- MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
40
- MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
41
- MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
42
- MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
43
- // USDe/DAI
44
- MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
45
- MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
46
- MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
47
- MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
48
-
49
- // BASE
50
- MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
51
- MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
52
- MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
53
- MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
54
- MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
55
- MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
56
- MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
57
- MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
58
- MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
59
- MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
60
- MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
61
- MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
62
- MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
63
- MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
64
- MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
65
- MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
66
- MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
67
- }
68
-
69
- export enum MorphoBlueOracleType {
70
- MARKET_RATE = 'Market rate',
71
- LIDO_RATE = 'Lido rate',
72
- ETHENA_RATE = 'Ethena rate',
73
- CONTRACT_RATE = 'Contract rate',
74
- }
75
-
76
- export interface MorphoBlueMarketData {
77
- chainIds: NetworkNumber[],
78
- label: string,
79
- shortLabel: string,
80
- url: string,
81
- value: MorphoBlueVersions,
82
- loanToken: EthAddress,
83
- collateralToken: EthAddress,
84
- oracle: EthAddress,
85
- oracleType: MorphoBlueOracleType,
86
- irm: EthAddress,
87
- lltv: number | string,
88
- marketId: string,
89
- // icon: Function,
90
- protocolName: string,
91
- }
92
-
93
- export interface MorphoBlueAssetData {
94
- symbol: string,
95
- address: string,
96
- price: string,
97
- supplyRate: string,
98
- borrowRate: string,
99
- supplyIncentives: IncentiveData[],
100
- borrowIncentives: IncentiveData[],
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 {
2
+ EthAddress, IncentiveData, MMUsedAssets, NetworkNumber,
3
+ } from './common';
4
+
5
+ export enum MorphoBlueVersions {
6
+ // MAINNET
7
+ MorphoBlueWstEthUSDC = 'morphobluewstethusdc', // wstETH/USDC
8
+ MorphoBlueSDAIUSDC = 'morphobluesdaiusdc', // sDAI/USDC
9
+ MorphoBlueWBTCUSDC = 'morphobluewbtcusdc', // WBTC/USDC
10
+ MorphoBlueEthUSDC = 'morphoblueethusdc', // ETH/USDC
11
+ MorphoBlueWBTCUSDT = 'morphobluewbtcusdt', // WBTC/USDT
12
+ MorphoBlueWstEthUSDT = 'morphobluewstethusdt', // wstETH/USDT
13
+ MorphoBlueWstEthUSDA_Exchange_Rate = 'morphobluewstethusda_exchange_rate', // wstETH/USDA
14
+ MorphoBlueWstEthPYUSD = 'morphobluwstethpyusd', // wstETH/PYUSD
15
+ MorphoBlueREthEth_945 = 'morphoblueretheth_945', // rETH/ETH
16
+ MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
17
+ MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
18
+ MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
19
+ MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
20
+ MorphoBlueSDAIEth = 'morphobluesdaieth', // sDAI/ETH
21
+ MorphoBlueMKRUSDC = 'morphobluemkrusdc', // MKR/USDC
22
+ MorphoBlueTBTCUSDC = 'morphobluetbtcusdc', // tBTC/USDC
23
+ MorphoBlueCbBTCEth_915 = 'morphobluecbbtceth', // cbBTC/Eth
24
+ MorphoBlueCbBTCUSDC_860 = 'morphobluecbbtcusdc', // cbBTC/USDC
25
+ MorphoBlueSUSDeUSDC_915 = 'morphobluesusdeusdc_915', // sUSDe/USDC
26
+ MorphoBlueLBTCWBTC_945 = 'morphobluelbtcwbtc_945', // LBTC/WBTC
27
+ MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
28
+ // ezETH/ETH
29
+ MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
30
+ MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
31
+ // weETH/ETH
32
+ MorphoBlueWeEthEth_860 = 'morphoblueweetheth_860',
33
+ MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
34
+ // wstETH/WETH
35
+ MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
36
+ MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
37
+ MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
38
+ // sUSDe/DAI
39
+ MorphoBlueSUSDeDAI_770 = 'morphobluesusdedai_770',
40
+ MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
41
+ MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
42
+ MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
43
+ // USDe/DAI
44
+ MorphoBlueUSDeDAI_770 = 'morphoblueusdedai_770',
45
+ MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
46
+ MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
47
+ MorphoBlueUSDeDAI_945 = 'morphoblueusdedai_945',
48
+
49
+ // BASE
50
+ MorphoBlueCbEthUSDC_860_Base = 'morphobluecbethusdc_860_base',
51
+ MorphoBlueCbEthUSDC_860_Base_1c21c59d = 'morphobluecbethusdc_860_base_1c21c59d',
52
+ MorphoBlueWstEthUSDC_860_Base = 'morphobluewstethusdc_860_base',
53
+ MorphoBlueWstEthUSDC_860_Base_13c42741 = 'morphobluewstethusdc_860_base_13c42741',
54
+ MorphoBlueEthUSDC_860_Base = 'morphoblueethusdc_860_base',
55
+ MorphoBlueCbEthEth_945_Base = 'morphobluecbetheth_945_base',
56
+ MorphoBlueCbEthEth_965_Base = 'morphobluecbetheth_965_base',
57
+ MorphoBlueWstEthEth_945_Base = 'morphobluewstetheth_945_base',
58
+ MorphoBlueWstEthEth_965_Base = 'morphobluewstetheth_965_base',
59
+ MorphoBlueREthUSDC_860_Base = 'morphobluerethusdc_860_base',
60
+ MorphoBlueREthEth_945_Base = 'morphoblueretheth_945_base',
61
+ MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
62
+ MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
63
+ MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
64
+ MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
65
+ MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
66
+ MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
67
+ }
68
+
69
+ export enum MorphoBlueOracleType {
70
+ MARKET_RATE = 'Market rate',
71
+ LIDO_RATE = 'Lido rate',
72
+ ETHENA_RATE = 'Ethena rate',
73
+ CONTRACT_RATE = 'Contract rate',
74
+ }
75
+
76
+ export interface MorphoBlueMarketData {
77
+ chainIds: NetworkNumber[],
78
+ label: string,
79
+ shortLabel: string,
80
+ url: string,
81
+ value: MorphoBlueVersions,
82
+ loanToken: EthAddress,
83
+ collateralToken: EthAddress,
84
+ oracle: EthAddress,
85
+ oracleType: MorphoBlueOracleType,
86
+ irm: EthAddress,
87
+ lltv: number | string,
88
+ marketId: string,
89
+ // icon: Function,
90
+ protocolName: string,
91
+ }
92
+
93
+ export interface MorphoBlueAssetData {
94
+ symbol: string,
95
+ address: string,
96
+ price: string,
97
+ supplyRate: string,
98
+ borrowRate: string,
99
+ supplyIncentives: IncentiveData[],
100
+ borrowIncentives: IncentiveData[],
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
+ }