@defisaver/positions-sdk 2.1.39 → 2.1.41

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 (120) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +64 -64
  4. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  5. package/cjs/savings/morphoVaults/index.js +17 -17
  6. package/cjs/savings/morphoVaults/options.d.ts +0 -1
  7. package/cjs/savings/morphoVaults/options.js +1 -10
  8. package/cjs/spark/index.js +7 -5
  9. package/cjs/types/savings/morphoVaults.d.ts +1 -2
  10. package/cjs/types/savings/morphoVaults.js +0 -1
  11. package/cjs/types/spark.d.ts +1 -0
  12. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  13. package/esm/savings/morphoVaults/index.js +17 -17
  14. package/esm/savings/morphoVaults/options.d.ts +0 -1
  15. package/esm/savings/morphoVaults/options.js +0 -9
  16. package/esm/spark/index.js +7 -5
  17. package/esm/types/savings/morphoVaults.d.ts +1 -2
  18. package/esm/types/savings/morphoVaults.js +0 -1
  19. package/esm/types/spark.d.ts +1 -0
  20. package/package.json +48 -48
  21. package/src/aaveV2/index.ts +240 -240
  22. package/src/aaveV3/index.ts +625 -625
  23. package/src/aaveV3/merit.ts +97 -97
  24. package/src/aaveV3/merkl.ts +74 -74
  25. package/src/claiming/aaveV3.ts +154 -154
  26. package/src/claiming/compV3.ts +22 -22
  27. package/src/claiming/ethena.ts +61 -61
  28. package/src/claiming/index.ts +12 -12
  29. package/src/claiming/king.ts +66 -66
  30. package/src/claiming/morphoBlue.ts +118 -118
  31. package/src/claiming/spark.ts +225 -225
  32. package/src/compoundV2/index.ts +244 -244
  33. package/src/compoundV3/index.ts +274 -274
  34. package/src/config/contracts.ts +1295 -1295
  35. package/src/constants/index.ts +10 -10
  36. package/src/contracts.ts +171 -171
  37. package/src/curveUsd/index.ts +254 -254
  38. package/src/eulerV2/index.ts +324 -324
  39. package/src/exchange/index.ts +25 -25
  40. package/src/fluid/index.ts +1800 -1800
  41. package/src/helpers/aaveHelpers/index.ts +187 -187
  42. package/src/helpers/compoundHelpers/index.ts +283 -283
  43. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  44. package/src/helpers/eulerHelpers/index.ts +222 -222
  45. package/src/helpers/fluidHelpers/index.ts +326 -326
  46. package/src/helpers/index.ts +10 -10
  47. package/src/helpers/liquityV2Helpers/index.ts +82 -82
  48. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  49. package/src/helpers/makerHelpers/index.ts +52 -52
  50. package/src/helpers/morphoBlueHelpers/index.ts +396 -396
  51. package/src/helpers/sparkHelpers/index.ts +158 -158
  52. package/src/index.ts +49 -49
  53. package/src/liquity/index.ts +159 -159
  54. package/src/liquityV2/index.ts +703 -703
  55. package/src/llamaLend/index.ts +305 -305
  56. package/src/maker/index.ts +223 -223
  57. package/src/markets/aave/index.ts +118 -118
  58. package/src/markets/aave/marketAssets.ts +54 -54
  59. package/src/markets/compound/index.ts +243 -243
  60. package/src/markets/compound/marketsAssets.ts +97 -97
  61. package/src/markets/curveUsd/index.ts +69 -69
  62. package/src/markets/euler/index.ts +26 -26
  63. package/src/markets/fluid/index.ts +2900 -2900
  64. package/src/markets/index.ts +25 -25
  65. package/src/markets/liquityV2/index.ts +102 -102
  66. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  67. package/src/markets/llamaLend/index.ts +235 -235
  68. package/src/markets/morphoBlue/index.ts +971 -971
  69. package/src/markets/spark/index.ts +29 -29
  70. package/src/markets/spark/marketAssets.ts +12 -12
  71. package/src/moneymarket/moneymarketCommonService.ts +85 -85
  72. package/src/morphoBlue/index.ts +274 -274
  73. package/src/portfolio/index.ts +598 -598
  74. package/src/savings/index.ts +95 -95
  75. package/src/savings/makerDsr/index.ts +53 -53
  76. package/src/savings/makerDsr/options.ts +9 -9
  77. package/src/savings/morphoVaults/index.ts +80 -80
  78. package/src/savings/morphoVaults/options.ts +193 -203
  79. package/src/savings/skyOptions/index.ts +95 -95
  80. package/src/savings/skyOptions/options.ts +10 -10
  81. package/src/savings/sparkSavingsVaults/index.ts +60 -60
  82. package/src/savings/sparkSavingsVaults/options.ts +35 -35
  83. package/src/savings/yearnV3Vaults/index.ts +61 -61
  84. package/src/savings/yearnV3Vaults/options.ts +55 -55
  85. package/src/savings/yearnVaults/index.ts +73 -73
  86. package/src/savings/yearnVaults/options.ts +32 -32
  87. package/src/services/priceService.ts +278 -278
  88. package/src/services/utils.ts +115 -115
  89. package/src/services/viem.ts +34 -34
  90. package/src/setup.ts +8 -8
  91. package/src/spark/index.ts +458 -456
  92. package/src/staking/eligibility.ts +53 -53
  93. package/src/staking/index.ts +1 -1
  94. package/src/staking/staking.ts +186 -186
  95. package/src/types/aave.ts +196 -196
  96. package/src/types/claiming.ts +114 -114
  97. package/src/types/common.ts +107 -107
  98. package/src/types/compound.ts +144 -144
  99. package/src/types/curveUsd.ts +123 -123
  100. package/src/types/euler.ts +175 -175
  101. package/src/types/fluid.ts +483 -483
  102. package/src/types/index.ts +14 -14
  103. package/src/types/liquity.ts +30 -30
  104. package/src/types/liquityV2.ts +126 -126
  105. package/src/types/llamaLend.ts +159 -159
  106. package/src/types/maker.ts +63 -63
  107. package/src/types/merit.ts +1 -1
  108. package/src/types/merkl.ts +70 -70
  109. package/src/types/morphoBlue.ts +200 -200
  110. package/src/types/portfolio.ts +60 -60
  111. package/src/types/savings/index.ts +23 -23
  112. package/src/types/savings/makerDsr.ts +13 -13
  113. package/src/types/savings/morphoVaults.ts +32 -33
  114. package/src/types/savings/sky.ts +14 -14
  115. package/src/types/savings/sparkSavingsVaults.ts +15 -15
  116. package/src/types/savings/yearnV3Vaults.ts +17 -17
  117. package/src/types/savings/yearnVaults.ts +14 -14
  118. package/src/types/spark.ts +134 -133
  119. package/src/umbrella/index.ts +69 -69
  120. 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
+ }