@defisaver/positions-sdk 2.1.29 → 2.1.31-syrup-dev

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