@defisaver/positions-sdk 2.1.49-aave-v4-dev-1-dev → 2.1.49-aave-v4-dev-2

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 (116) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +64 -64
  4. package/cjs/helpers/aaveV4Helpers/index.d.ts +4 -0
  5. package/cjs/helpers/aaveV4Helpers/index.js +54 -2
  6. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  7. package/cjs/savings/morphoVaults/index.js +17 -17
  8. package/esm/helpers/aaveV4Helpers/index.d.ts +4 -0
  9. package/esm/helpers/aaveV4Helpers/index.js +53 -2
  10. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  11. package/esm/savings/morphoVaults/index.js +17 -17
  12. package/package.json +48 -48
  13. package/src/aaveV2/index.ts +240 -240
  14. package/src/aaveV3/index.ts +635 -635
  15. package/src/aaveV3/merit.ts +97 -97
  16. package/src/aaveV3/merkl.ts +74 -74
  17. package/src/aaveV4/index.ts +168 -168
  18. package/src/claiming/aaveV3.ts +154 -154
  19. package/src/claiming/compV3.ts +22 -22
  20. package/src/claiming/ethena.ts +61 -61
  21. package/src/claiming/index.ts +12 -12
  22. package/src/claiming/king.ts +66 -66
  23. package/src/claiming/morphoBlue.ts +118 -118
  24. package/src/claiming/spark.ts +225 -225
  25. package/src/compoundV2/index.ts +244 -244
  26. package/src/compoundV3/index.ts +274 -274
  27. package/src/config/contracts.ts +1328 -1328
  28. package/src/constants/index.ts +10 -10
  29. package/src/contracts.ts +173 -173
  30. package/src/curveUsd/index.ts +254 -254
  31. package/src/eulerV2/index.ts +324 -324
  32. package/src/exchange/index.ts +25 -25
  33. package/src/fluid/index.ts +1800 -1800
  34. package/src/helpers/aaveHelpers/index.ts +191 -191
  35. package/src/helpers/aaveV4Helpers/index.ts +120 -68
  36. package/src/helpers/compoundHelpers/index.ts +283 -283
  37. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  38. package/src/helpers/eulerHelpers/index.ts +222 -222
  39. package/src/helpers/fluidHelpers/index.ts +326 -326
  40. package/src/helpers/index.ts +11 -11
  41. package/src/helpers/liquityV2Helpers/index.ts +82 -82
  42. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  43. package/src/helpers/makerHelpers/index.ts +52 -52
  44. package/src/helpers/morphoBlueHelpers/index.ts +396 -396
  45. package/src/helpers/sparkHelpers/index.ts +158 -158
  46. package/src/index.ts +51 -51
  47. package/src/liquity/index.ts +159 -159
  48. package/src/liquityV2/index.ts +703 -703
  49. package/src/llamaLend/index.ts +305 -305
  50. package/src/maker/index.ts +223 -223
  51. package/src/markets/aave/index.ts +118 -118
  52. package/src/markets/aave/marketAssets.ts +54 -54
  53. package/src/markets/aaveV4/index.ts +18 -18
  54. package/src/markets/compound/index.ts +243 -243
  55. package/src/markets/compound/marketsAssets.ts +97 -97
  56. package/src/markets/curveUsd/index.ts +69 -69
  57. package/src/markets/euler/index.ts +26 -26
  58. package/src/markets/fluid/index.ts +2900 -2900
  59. package/src/markets/index.ts +25 -25
  60. package/src/markets/liquityV2/index.ts +102 -102
  61. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  62. package/src/markets/llamaLend/index.ts +235 -235
  63. package/src/markets/morphoBlue/index.ts +971 -971
  64. package/src/markets/spark/index.ts +29 -29
  65. package/src/markets/spark/marketAssets.ts +12 -12
  66. package/src/moneymarket/moneymarketCommonService.ts +85 -85
  67. package/src/morphoBlue/index.ts +274 -274
  68. package/src/portfolio/index.ts +618 -618
  69. package/src/savings/index.ts +95 -95
  70. package/src/savings/makerDsr/index.ts +53 -53
  71. package/src/savings/makerDsr/options.ts +9 -9
  72. package/src/savings/morphoVaults/index.ts +80 -80
  73. package/src/savings/morphoVaults/options.ts +193 -193
  74. package/src/savings/skyOptions/index.ts +95 -95
  75. package/src/savings/skyOptions/options.ts +10 -10
  76. package/src/savings/sparkSavingsVaults/index.ts +60 -60
  77. package/src/savings/sparkSavingsVaults/options.ts +35 -35
  78. package/src/savings/yearnV3Vaults/index.ts +61 -61
  79. package/src/savings/yearnV3Vaults/options.ts +55 -55
  80. package/src/savings/yearnVaults/index.ts +73 -73
  81. package/src/savings/yearnVaults/options.ts +32 -32
  82. package/src/services/priceService.ts +278 -278
  83. package/src/services/utils.ts +115 -115
  84. package/src/services/viem.ts +34 -34
  85. package/src/setup.ts +8 -8
  86. package/src/spark/index.ts +459 -459
  87. package/src/staking/eligibility.ts +53 -53
  88. package/src/staking/index.ts +1 -1
  89. package/src/staking/staking.ts +192 -192
  90. package/src/types/aave.ts +198 -198
  91. package/src/types/aaveV4.ts +142 -142
  92. package/src/types/claiming.ts +114 -114
  93. package/src/types/common.ts +107 -107
  94. package/src/types/compound.ts +144 -144
  95. package/src/types/curveUsd.ts +123 -123
  96. package/src/types/euler.ts +175 -175
  97. package/src/types/fluid.ts +483 -483
  98. package/src/types/index.ts +15 -15
  99. package/src/types/liquity.ts +30 -30
  100. package/src/types/liquityV2.ts +126 -126
  101. package/src/types/llamaLend.ts +159 -159
  102. package/src/types/maker.ts +63 -63
  103. package/src/types/merit.ts +1 -1
  104. package/src/types/merkl.ts +70 -70
  105. package/src/types/morphoBlue.ts +200 -200
  106. package/src/types/portfolio.ts +64 -64
  107. package/src/types/savings/index.ts +23 -23
  108. package/src/types/savings/makerDsr.ts +13 -13
  109. package/src/types/savings/morphoVaults.ts +32 -32
  110. package/src/types/savings/sky.ts +14 -14
  111. package/src/types/savings/sparkSavingsVaults.ts +15 -15
  112. package/src/types/savings/yearnV3Vaults.ts +17 -17
  113. package/src/types/savings/yearnVaults.ts +14 -14
  114. package/src/types/spark.ts +134 -134
  115. package/src/umbrella/index.ts +69 -69
  116. 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,200 +1,200 @@
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
- MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
16
- MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
17
- MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
18
- MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
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
- MorphoBlueLBTCUSDC_860 = 'morphobluelbtcusdc_860', // LBTC/USDC
26
- MorphoBlueLBTCCbBTC_945 = 'morphobluelbtccbbtc_945', // LBTC/cbBTC
27
- MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
28
- MorphoBlueSyrupUSDCUSDC_915 = 'morphobluesyrupusdcusdc_915', // syrupUSDC/USDC
29
- MorphoBluesUSDSUSDT_965 = 'morphobluesusdsusdt_965', // sUSDS/USDT
30
- // ezETH/ETH
31
- MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
32
- MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
33
- // weETH/ETH
34
- MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
35
- // wstETH/WETH
36
- MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
37
- MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
38
- MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
39
- // sUSDe/DAI
40
- MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
41
- MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
42
- MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
43
- // USDe/DAI
44
- MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
45
- MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
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
- MorphoBlueWETHEURC_860_Base = 'morphobluewetheurc_860_base', // WETH/EURC
66
-
67
- // ARBITRUM
68
- MorphoBlueSyrupUSDCUSDC_915_Arb = 'morphobluesyrupusdcusdc_915_arb', // syrupUSDC/USDC
69
- MorphoBlueWBTCUSDC_860_Arb = 'morphobluewbtcusdc_860_arb', // WBTC/USDC
70
- MorphoBlueWstEthUSDC_860_Arb = 'morphobluewstethusdc_860_arb', // wstETH/USDC
71
- MorphoBlueEthUSDC_860_Arb = 'morphoblueethusdc_860_arb', // ETH/USDC
72
- MorphoBluesUSDSUSDC_945_Arb = 'morphobluesusdsusdc_945_arb', // sUSDS/USDC
73
- }
74
-
75
- export enum MorphoBlueOracleType {
76
- MARKET_RATE = 'Market rate',
77
- LIDO_RATE = 'Lido rate',
78
- ETHENA_RATE = 'Ethena rate',
79
- CONTRACT_RATE = 'Contract rate',
80
- }
81
-
82
- export interface MorphoBlueMarketData {
83
- chainIds: NetworkNumber[],
84
- label: string,
85
- shortLabel: string,
86
- url: string,
87
- value: MorphoBlueVersions,
88
- loanToken: EthAddress,
89
- collateralToken: EthAddress,
90
- oracle: EthAddress,
91
- oracleType: MorphoBlueOracleType,
92
- irm: EthAddress,
93
- lltv: number | string,
94
- marketId: string,
95
- // icon: Function,
96
- protocolName: string,
97
- }
98
-
99
- export interface MorphoBlueAssetData {
100
- symbol: string,
101
- address: string,
102
- price: string,
103
- supplyRate: string,
104
- borrowRate: string,
105
- supplyIncentives: IncentiveData[],
106
- borrowIncentives: IncentiveData[],
107
- totalSupply?: string,
108
- totalBorrow?: string,
109
- canBeSupplied?: boolean,
110
- canBeBorrowed?: boolean,
111
- }
112
-
113
- export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
114
-
115
- export interface MorphoBlueMarketInfo {
116
- id: string,
117
- fee: string,
118
- loanToken: string,
119
- collateralToken: string,
120
- utillization: string,
121
- oracle: string,
122
- oracleType: MorphoBlueOracleType,
123
- lltv: string,
124
- minRatio: string,
125
- assetsData: MorphoBlueAssetsData,
126
- }
127
-
128
- export interface MorphoBlueAggregatedPositionData {
129
- suppliedUsd: string,
130
- suppliedCollateralUsd: string,
131
- borrowedUsd: string,
132
- borrowLimitUsd: string,
133
- liquidationLimitUsd: string,
134
- leftToBorrowUsd: string,
135
- leftToBorrow: string,
136
- netApy: string,
137
- incentiveUsd: string,
138
- totalInterestUsd: string,
139
- ltv: string,
140
- ratio: string,
141
- leveragedType: string,
142
- leveragedAsset?: string,
143
- leveragedLsdAssetRatio?: string,
144
- liquidationPrice?: string,
145
- minCollRatio?: string,
146
- collLiquidationRatio?: string,
147
- }
148
-
149
- export interface MorphoBluePositionData {
150
- usedAssets: MMUsedAssets,
151
- suppliedUsd: string,
152
- suppliedCollateralUsd: string,
153
- borrowedUsd: string,
154
- borrowLimitUsd: string,
155
- liquidationLimitUsd: string,
156
- leftToBorrowUsd: string,
157
- leftToBorrow: string,
158
- netApy: string,
159
- incentiveUsd: string,
160
- totalInterestUsd: string,
161
- ltv: string,
162
- ratio: string,
163
- leveragedType: string,
164
- leveragedAsset?: string,
165
- leveragedLsdAssetRatio?: string,
166
- liquidationPrice?: string,
167
- supplyShares: string,
168
- borrowShares: string,
169
- }
170
-
171
- export interface MorphoBlueVault {
172
- address: string,
173
- }
174
-
175
- export interface MorphoBlueAllocationMarket {
176
- loanAsset: { address: string },
177
- collateralAsset: { address: string },
178
- oracle: { address: string },
179
- irmAddress: string,
180
- lltv: string,
181
- uniqueKey: string,
182
- }
183
-
184
- export interface MorphoBluePublicAllocatorItem {
185
- vault: MorphoBlueVault,
186
- assets: string,
187
- allocationMarket: MorphoBlueAllocationMarket,
188
- }
189
-
190
- export interface MorphoBlueAllocatorMarketState {
191
- borrowAssets: string,
192
- supplyAssets: string,
193
- }
194
-
195
- export interface MorphoBlueRealloactionMarketData {
196
- reallocatableLiquidityAssets: string,
197
- targetBorrowUtilization: string,
198
- publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
199
- state: MorphoBlueAllocatorMarketState,
200
- }
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
+ MorphoBlueWBTCPYUSD = 'morphobluewbtcpyusd', // WBTC/PYUSD
16
+ MorphoBlueWBTCEth = 'morphobluewbtceth', // WBTC/ETH
17
+ MorphoBlueUSDeUSDT = 'morphoblueusdeusdt', // USDe/USDT
18
+ MorphoBlueSUSDeUSDT = 'morphobluesusdeusdt', // sUSDe/USDT
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
+ MorphoBlueLBTCUSDC_860 = 'morphobluelbtcusdc_860', // LBTC/USDC
26
+ MorphoBlueLBTCCbBTC_945 = 'morphobluelbtccbbtc_945', // LBTC/cbBTC
27
+ MorphoBlueUSRUSDC_915 = 'morphoblueusrusdc_915', // USR/USDC
28
+ MorphoBlueSyrupUSDCUSDC_915 = 'morphobluesyrupusdcusdc_915', // syrupUSDC/USDC
29
+ MorphoBluesUSDSUSDT_965 = 'morphobluesusdsusdt_965', // sUSDS/USDT
30
+ // ezETH/ETH
31
+ MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
32
+ MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
33
+ // weETH/ETH
34
+ MorphoBlueWeEthEth_945 = 'morphoblueweetheth_945',
35
+ // wstETH/WETH
36
+ MorphoBlueWstEthEth_945 = 'morphobluewstetheth_945',
37
+ MorphoBlueWstEthEth_945_Exchange_Rate = 'morphobluewstetheth_945_exchange_rate',
38
+ MorphoBlueWstEthEth_965_Exchange_Rate = 'morphobluewstetheth_965_exchange_rate',
39
+ // sUSDe/DAI
40
+ MorphoBlueSUSDeDAI_860 = 'morphobluesusdedai_860',
41
+ MorphoBlueSUSDeDAI_915 = 'morphobluesusdedai_915',
42
+ MorphoBlueSUSDeDAI_945 = 'morphobluesusdedai_945',
43
+ // USDe/DAI
44
+ MorphoBlueUSDeDAI_860 = 'morphoblueusdedai_860',
45
+ MorphoBlueUSDeDAI_915 = 'morphoblueusdedai_915',
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
+ MorphoBlueWETHEURC_860_Base = 'morphobluewetheurc_860_base', // WETH/EURC
66
+
67
+ // ARBITRUM
68
+ MorphoBlueSyrupUSDCUSDC_915_Arb = 'morphobluesyrupusdcusdc_915_arb', // syrupUSDC/USDC
69
+ MorphoBlueWBTCUSDC_860_Arb = 'morphobluewbtcusdc_860_arb', // WBTC/USDC
70
+ MorphoBlueWstEthUSDC_860_Arb = 'morphobluewstethusdc_860_arb', // wstETH/USDC
71
+ MorphoBlueEthUSDC_860_Arb = 'morphoblueethusdc_860_arb', // ETH/USDC
72
+ MorphoBluesUSDSUSDC_945_Arb = 'morphobluesusdsusdc_945_arb', // sUSDS/USDC
73
+ }
74
+
75
+ export enum MorphoBlueOracleType {
76
+ MARKET_RATE = 'Market rate',
77
+ LIDO_RATE = 'Lido rate',
78
+ ETHENA_RATE = 'Ethena rate',
79
+ CONTRACT_RATE = 'Contract rate',
80
+ }
81
+
82
+ export interface MorphoBlueMarketData {
83
+ chainIds: NetworkNumber[],
84
+ label: string,
85
+ shortLabel: string,
86
+ url: string,
87
+ value: MorphoBlueVersions,
88
+ loanToken: EthAddress,
89
+ collateralToken: EthAddress,
90
+ oracle: EthAddress,
91
+ oracleType: MorphoBlueOracleType,
92
+ irm: EthAddress,
93
+ lltv: number | string,
94
+ marketId: string,
95
+ // icon: Function,
96
+ protocolName: string,
97
+ }
98
+
99
+ export interface MorphoBlueAssetData {
100
+ symbol: string,
101
+ address: string,
102
+ price: string,
103
+ supplyRate: string,
104
+ borrowRate: string,
105
+ supplyIncentives: IncentiveData[],
106
+ borrowIncentives: IncentiveData[],
107
+ totalSupply?: string,
108
+ totalBorrow?: string,
109
+ canBeSupplied?: boolean,
110
+ canBeBorrowed?: boolean,
111
+ }
112
+
113
+ export type MorphoBlueAssetsData = { [key: string]: MorphoBlueAssetData };
114
+
115
+ export interface MorphoBlueMarketInfo {
116
+ id: string,
117
+ fee: string,
118
+ loanToken: string,
119
+ collateralToken: string,
120
+ utillization: string,
121
+ oracle: string,
122
+ oracleType: MorphoBlueOracleType,
123
+ lltv: string,
124
+ minRatio: string,
125
+ assetsData: MorphoBlueAssetsData,
126
+ }
127
+
128
+ export interface MorphoBlueAggregatedPositionData {
129
+ suppliedUsd: string,
130
+ suppliedCollateralUsd: string,
131
+ borrowedUsd: string,
132
+ borrowLimitUsd: string,
133
+ liquidationLimitUsd: string,
134
+ leftToBorrowUsd: string,
135
+ leftToBorrow: string,
136
+ netApy: string,
137
+ incentiveUsd: string,
138
+ totalInterestUsd: string,
139
+ ltv: string,
140
+ ratio: string,
141
+ leveragedType: string,
142
+ leveragedAsset?: string,
143
+ leveragedLsdAssetRatio?: string,
144
+ liquidationPrice?: string,
145
+ minCollRatio?: string,
146
+ collLiquidationRatio?: string,
147
+ }
148
+
149
+ export interface MorphoBluePositionData {
150
+ usedAssets: MMUsedAssets,
151
+ suppliedUsd: string,
152
+ suppliedCollateralUsd: string,
153
+ borrowedUsd: string,
154
+ borrowLimitUsd: string,
155
+ liquidationLimitUsd: string,
156
+ leftToBorrowUsd: string,
157
+ leftToBorrow: string,
158
+ netApy: string,
159
+ incentiveUsd: string,
160
+ totalInterestUsd: string,
161
+ ltv: string,
162
+ ratio: string,
163
+ leveragedType: string,
164
+ leveragedAsset?: string,
165
+ leveragedLsdAssetRatio?: string,
166
+ liquidationPrice?: string,
167
+ supplyShares: string,
168
+ borrowShares: string,
169
+ }
170
+
171
+ export interface MorphoBlueVault {
172
+ address: string,
173
+ }
174
+
175
+ export interface MorphoBlueAllocationMarket {
176
+ loanAsset: { address: string },
177
+ collateralAsset: { address: string },
178
+ oracle: { address: string },
179
+ irmAddress: string,
180
+ lltv: string,
181
+ uniqueKey: string,
182
+ }
183
+
184
+ export interface MorphoBluePublicAllocatorItem {
185
+ vault: MorphoBlueVault,
186
+ assets: string,
187
+ allocationMarket: MorphoBlueAllocationMarket,
188
+ }
189
+
190
+ export interface MorphoBlueAllocatorMarketState {
191
+ borrowAssets: string,
192
+ supplyAssets: string,
193
+ }
194
+
195
+ export interface MorphoBlueRealloactionMarketData {
196
+ reallocatableLiquidityAssets: string,
197
+ targetBorrowUtilization: string,
198
+ publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
199
+ state: MorphoBlueAllocatorMarketState,
200
+ }