@defisaver/positions-sdk 2.1.35 → 2.1.36

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