@defisaver/positions-sdk 2.1.35 → 2.1.37

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