@defisaver/positions-sdk 0.0.84 → 0.0.85

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 (80) hide show
  1. package/.yarn/releases/yarn-1.22.1.cjs +147386 -0
  2. package/.yarn/releases/yarn-1.22.1.js +147386 -0
  3. package/.yarnrc.yml +1 -0
  4. package/README.md +63 -63
  5. package/cjs/aaveV2/index.js +4 -4
  6. package/cjs/aaveV3/index.js +2 -2
  7. package/cjs/moneymarket/moneymarketCommonService.d.ts +1 -1
  8. package/cjs/moneymarket/moneymarketCommonService.js +1 -1
  9. package/cjs/morphoAaveV2/index.js +6 -6
  10. package/cjs/morphoAaveV3/index.js +2 -2
  11. package/cjs/spark/index.js +4 -4
  12. package/cjs/staking/staking.d.ts +0 -1
  13. package/cjs/staking/staking.js +9 -19
  14. package/esm/aaveV2/index.js +5 -5
  15. package/esm/aaveV3/index.js +3 -3
  16. package/esm/moneymarket/moneymarketCommonService.d.ts +1 -1
  17. package/esm/moneymarket/moneymarketCommonService.js +1 -1
  18. package/esm/morphoAaveV2/index.js +7 -7
  19. package/esm/morphoAaveV3/index.js +3 -3
  20. package/esm/spark/index.js +5 -5
  21. package/esm/staking/staking.d.ts +0 -1
  22. package/esm/staking/staking.js +8 -17
  23. package/package.json +40 -41
  24. package/src/aaveV2/index.ts +227 -227
  25. package/src/aaveV3/index.ts +558 -559
  26. package/src/assets/index.ts +60 -60
  27. package/src/chickenBonds/index.ts +123 -123
  28. package/src/compoundV2/index.ts +219 -219
  29. package/src/compoundV3/index.ts +273 -273
  30. package/src/config/contracts.js +848 -848
  31. package/src/constants/index.ts +5 -5
  32. package/src/contracts.ts +128 -128
  33. package/src/curveUsd/index.ts +229 -229
  34. package/src/exchange/index.ts +17 -17
  35. package/src/helpers/aaveHelpers/index.ts +134 -134
  36. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  37. package/src/helpers/compoundHelpers/index.ts +181 -181
  38. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  39. package/src/helpers/index.ts +7 -7
  40. package/src/helpers/llamaLendHelpers/index.ts +45 -45
  41. package/src/helpers/makerHelpers/index.ts +94 -94
  42. package/src/helpers/morphoBlueHelpers/index.ts +56 -56
  43. package/src/helpers/sparkHelpers/index.ts +106 -106
  44. package/src/index.ts +46 -46
  45. package/src/liquity/index.ts +116 -116
  46. package/src/llamaLend/index.ts +268 -268
  47. package/src/maker/index.ts +117 -117
  48. package/src/markets/aave/index.ts +80 -80
  49. package/src/markets/aave/marketAssets.ts +25 -25
  50. package/src/markets/compound/index.ts +142 -142
  51. package/src/markets/compound/marketsAssets.ts +50 -50
  52. package/src/markets/curveUsd/index.ts +69 -69
  53. package/src/markets/index.ts +5 -5
  54. package/src/markets/llamaLend/contractAddresses.ts +95 -95
  55. package/src/markets/llamaLend/index.ts +150 -150
  56. package/src/markets/morphoBlue/index.ts +478 -478
  57. package/src/markets/spark/index.ts +29 -29
  58. package/src/markets/spark/marketAssets.ts +10 -10
  59. package/src/moneymarket/moneymarketCommonService.ts +76 -76
  60. package/src/morphoAaveV2/index.ts +256 -256
  61. package/src/morphoAaveV3/index.ts +620 -620
  62. package/src/morphoBlue/index.ts +162 -162
  63. package/src/multicall/index.ts +22 -22
  64. package/src/services/dsrService.ts +15 -15
  65. package/src/services/priceService.ts +21 -21
  66. package/src/services/utils.ts +51 -51
  67. package/src/setup.ts +8 -8
  68. package/src/spark/index.ts +434 -434
  69. package/src/staking/staking.ts +186 -198
  70. package/src/types/aave.ts +256 -256
  71. package/src/types/chickenBonds.ts +45 -45
  72. package/src/types/common.ts +84 -84
  73. package/src/types/compound.ts +128 -128
  74. package/src/types/curveUsd.ts +118 -118
  75. package/src/types/index.ts +8 -8
  76. package/src/types/liquity.ts +30 -30
  77. package/src/types/llamaLend.ts +143 -143
  78. package/src/types/maker.ts +50 -50
  79. package/src/types/morphoBlue.ts +130 -130
  80. package/src/types/spark.ts +106 -106
@@ -1,118 +1,118 @@
1
- import Web3 from 'web3';
2
- import Dec from 'decimal.js';
3
- import { assetAmountInEth, getAssetInfo, ilkToAsset } from '@defisaver/tokens';
4
- import {
5
- Blockish, EthAddress, NetworkNumber, PositionBalances,
6
- } from '../types/common';
7
- import { McdViewContract } from '../contracts';
8
- import { makerHelpers } from '../helpers';
9
- import { CdpData } from '../types';
10
- import { wethToEth } from '../services/utils';
11
-
12
- export const getMakerAccountBalances = async (web3: Web3, network: NetworkNumber, block: Blockish, addressMapping: boolean, cdpId: string, _managerAddress?: EthAddress): Promise<PositionBalances> => {
13
- let balances: PositionBalances = {
14
- collateral: {},
15
- debt: {},
16
- };
17
- const managerAddress = _managerAddress || '0x5ef30b9986345249bc32d8928B7ee64DE9435E39'; // Default CDP Manager (This is used only to differentiate BProtocol CDPs)
18
-
19
- if (!cdpId) {
20
- return balances;
21
- }
22
-
23
- const viewContract = McdViewContract(web3, network, block);
24
-
25
- let ilk;
26
-
27
- const needsIlk = new Dec(block).lt(14410792) && new Dec(block).gte(14384301);
28
-
29
- if (needsIlk) {
30
- ilk = (await viewContract.methods.getUrnAndIlk(managerAddress, cdpId).call({}, block)).ilk;
31
- }
32
-
33
- // @ts-ignore
34
- const cdpInfo = await viewContract.methods.getCdpInfo(...(needsIlk ? [managerAddress, cdpId, ilk] : [cdpId])).call({}, block);
35
- const ilkInfo = await makerHelpers.getCollateralInfo(needsIlk ? ilk : cdpInfo.ilk, web3, network, block);
36
-
37
-
38
- const collateral = needsIlk ? cdpInfo[1] : cdpInfo.collateral;
39
- const debt = needsIlk ? cdpInfo[0] : cdpInfo.debt;
40
-
41
- const asset = wethToEth(ilkToAsset(needsIlk ? ilk : cdpInfo.ilk));
42
-
43
- balances = {
44
- collateral: {
45
- [addressMapping ? getAssetInfo(asset, network).address.toLowerCase() : asset]: asset === 'WBTC' ? new Dec(collateral).div(1e10).floor().toString() : collateral,
46
- },
47
- debt: {
48
- [addressMapping ? getAssetInfo('DAI', network).address.toLowerCase() : 'DAI']: new Dec(debt).times(ilkInfo.currentRate).div(1e27).floor()
49
- .toString(),
50
- },
51
- };
52
-
53
- return balances;
54
- };
55
-
56
- export const getMakerCdpData = async (web3: Web3, network: NetworkNumber, cdpId: string): Promise<CdpData> => {
57
- const viewContract = McdViewContract(web3, network);
58
-
59
- // @ts-ignore
60
- const cdpInfo = await viewContract.methods.getCdpInfo(cdpId).call();
61
-
62
- const [ilkInfo, coll] = await Promise.all([
63
- makerHelpers.getCollateralInfo(cdpInfo.ilk, web3, network),
64
- makerHelpers.getUnclaimedCollateral(web3, network, cdpInfo.urn, cdpInfo.ilk),
65
- ]);
66
-
67
- const asset = ilkToAsset(cdpInfo.ilk);
68
-
69
- const collateralUsd = new Dec(cdpInfo.collateral).mul(ilkInfo.assetPrice).floor().toString();
70
- const debt = new Dec(cdpInfo.debt).times(ilkInfo.currentRate).div(1e27).floor()
71
- .toString();
72
- const futureDebt = new Dec(cdpInfo.debt).times(ilkInfo.futureRate).div(1e27).floor()
73
- .toString(); // after drip
74
- const debtDripDelta = assetAmountInEth(new Dec(futureDebt).sub(debt).toString(), 'DAI');
75
- const liquidationPrice = new Dec(debt).times(ilkInfo.liqRatio).div(cdpInfo.collateral).toString();
76
-
77
- let ratio = new Dec(cdpInfo.collateral).times(ilkInfo.assetPrice).div(debt).times(100)
78
- .toString();
79
- if (new Dec(debt).eq(0)) ratio = '0';
80
-
81
- const debtTooLow = new Dec(debt).gt(0) && new Dec(assetAmountInEth(debt, 'DAI')).lt(ilkInfo.minDebt);
82
-
83
- const par = '1';
84
- return {
85
- owner: cdpInfo.owner,
86
- userAddress: cdpInfo.userAddr,
87
- id: cdpId,
88
- urn: cdpInfo.urn,
89
- type: 'mcd',
90
- ilk: cdpInfo.ilk,
91
- ilkLabel: ilkInfo.ilkLabel,
92
- asset,
93
- collateral: assetAmountInEth(cdpInfo.collateral, `MCD-${asset}`),
94
- collateralUsd: assetAmountInEth(collateralUsd, `MCD-${asset}`),
95
- futureDebt: assetAmountInEth(futureDebt, 'DAI'),
96
- debtDai: assetAmountInEth(debt, 'DAI'),
97
- debtUsd: assetAmountInEth(debt, 'DAI'),
98
- debtInAsset: assetAmountInEth(debt, 'DAI'),
99
- debtAssetPrice: par,
100
- debtAssetMarketPrice: par,
101
- liquidationPrice,
102
- ratio,
103
- liqRatio: ilkInfo.liqRatio.toString(),
104
- liqPercent: parseFloat(ilkInfo.liqPercent.toString()),
105
- assetPrice: ilkInfo.assetPrice,
106
- daiLabel: 'DAI',
107
- debtAsset: 'DAI',
108
- unclaimedCollateral: assetAmountInEth(coll, asset),
109
- debtTooLow,
110
- minDebt: ilkInfo.minDebt,
111
- stabilityFee: ilkInfo.stabilityFee,
112
- creatableDebt: ilkInfo.creatableDebt,
113
- globalDebtCeiling: ilkInfo.globalDebtCeiling,
114
- globalDebtCurrent: ilkInfo.globalDebtCurrent,
115
- liquidationFee: ilkInfo.liquidationFee,
116
- lastUpdated: Date.now(),
117
- };
1
+ import Web3 from 'web3';
2
+ import Dec from 'decimal.js';
3
+ import { assetAmountInEth, getAssetInfo, ilkToAsset } from '@defisaver/tokens';
4
+ import {
5
+ Blockish, EthAddress, NetworkNumber, PositionBalances,
6
+ } from '../types/common';
7
+ import { McdViewContract } from '../contracts';
8
+ import { makerHelpers } from '../helpers';
9
+ import { CdpData } from '../types';
10
+ import { wethToEth } from '../services/utils';
11
+
12
+ export const getMakerAccountBalances = async (web3: Web3, network: NetworkNumber, block: Blockish, addressMapping: boolean, cdpId: string, _managerAddress?: EthAddress): Promise<PositionBalances> => {
13
+ let balances: PositionBalances = {
14
+ collateral: {},
15
+ debt: {},
16
+ };
17
+ const managerAddress = _managerAddress || '0x5ef30b9986345249bc32d8928B7ee64DE9435E39'; // Default CDP Manager (This is used only to differentiate BProtocol CDPs)
18
+
19
+ if (!cdpId) {
20
+ return balances;
21
+ }
22
+
23
+ const viewContract = McdViewContract(web3, network, block);
24
+
25
+ let ilk;
26
+
27
+ const needsIlk = new Dec(block).lt(14410792) && new Dec(block).gte(14384301);
28
+
29
+ if (needsIlk) {
30
+ ilk = (await viewContract.methods.getUrnAndIlk(managerAddress, cdpId).call({}, block)).ilk;
31
+ }
32
+
33
+ // @ts-ignore
34
+ const cdpInfo = await viewContract.methods.getCdpInfo(...(needsIlk ? [managerAddress, cdpId, ilk] : [cdpId])).call({}, block);
35
+ const ilkInfo = await makerHelpers.getCollateralInfo(needsIlk ? ilk : cdpInfo.ilk, web3, network, block);
36
+
37
+
38
+ const collateral = needsIlk ? cdpInfo[1] : cdpInfo.collateral;
39
+ const debt = needsIlk ? cdpInfo[0] : cdpInfo.debt;
40
+
41
+ const asset = wethToEth(ilkToAsset(needsIlk ? ilk : cdpInfo.ilk));
42
+
43
+ balances = {
44
+ collateral: {
45
+ [addressMapping ? getAssetInfo(asset, network).address.toLowerCase() : asset]: asset === 'WBTC' ? new Dec(collateral).div(1e10).floor().toString() : collateral,
46
+ },
47
+ debt: {
48
+ [addressMapping ? getAssetInfo('DAI', network).address.toLowerCase() : 'DAI']: new Dec(debt).times(ilkInfo.currentRate).div(1e27).floor()
49
+ .toString(),
50
+ },
51
+ };
52
+
53
+ return balances;
54
+ };
55
+
56
+ export const getMakerCdpData = async (web3: Web3, network: NetworkNumber, cdpId: string): Promise<CdpData> => {
57
+ const viewContract = McdViewContract(web3, network);
58
+
59
+ // @ts-ignore
60
+ const cdpInfo = await viewContract.methods.getCdpInfo(cdpId).call();
61
+
62
+ const [ilkInfo, coll] = await Promise.all([
63
+ makerHelpers.getCollateralInfo(cdpInfo.ilk, web3, network),
64
+ makerHelpers.getUnclaimedCollateral(web3, network, cdpInfo.urn, cdpInfo.ilk),
65
+ ]);
66
+
67
+ const asset = ilkToAsset(cdpInfo.ilk);
68
+
69
+ const collateralUsd = new Dec(cdpInfo.collateral).mul(ilkInfo.assetPrice).floor().toString();
70
+ const debt = new Dec(cdpInfo.debt).times(ilkInfo.currentRate).div(1e27).floor()
71
+ .toString();
72
+ const futureDebt = new Dec(cdpInfo.debt).times(ilkInfo.futureRate).div(1e27).floor()
73
+ .toString(); // after drip
74
+ const debtDripDelta = assetAmountInEth(new Dec(futureDebt).sub(debt).toString(), 'DAI');
75
+ const liquidationPrice = new Dec(debt).times(ilkInfo.liqRatio).div(cdpInfo.collateral).toString();
76
+
77
+ let ratio = new Dec(cdpInfo.collateral).times(ilkInfo.assetPrice).div(debt).times(100)
78
+ .toString();
79
+ if (new Dec(debt).eq(0)) ratio = '0';
80
+
81
+ const debtTooLow = new Dec(debt).gt(0) && new Dec(assetAmountInEth(debt, 'DAI')).lt(ilkInfo.minDebt);
82
+
83
+ const par = '1';
84
+ return {
85
+ owner: cdpInfo.owner,
86
+ userAddress: cdpInfo.userAddr,
87
+ id: cdpId,
88
+ urn: cdpInfo.urn,
89
+ type: 'mcd',
90
+ ilk: cdpInfo.ilk,
91
+ ilkLabel: ilkInfo.ilkLabel,
92
+ asset,
93
+ collateral: assetAmountInEth(cdpInfo.collateral, `MCD-${asset}`),
94
+ collateralUsd: assetAmountInEth(collateralUsd, `MCD-${asset}`),
95
+ futureDebt: assetAmountInEth(futureDebt, 'DAI'),
96
+ debtDai: assetAmountInEth(debt, 'DAI'),
97
+ debtUsd: assetAmountInEth(debt, 'DAI'),
98
+ debtInAsset: assetAmountInEth(debt, 'DAI'),
99
+ debtAssetPrice: par,
100
+ debtAssetMarketPrice: par,
101
+ liquidationPrice,
102
+ ratio,
103
+ liqRatio: ilkInfo.liqRatio.toString(),
104
+ liqPercent: parseFloat(ilkInfo.liqPercent.toString()),
105
+ assetPrice: ilkInfo.assetPrice,
106
+ daiLabel: 'DAI',
107
+ debtAsset: 'DAI',
108
+ unclaimedCollateral: assetAmountInEth(coll, asset),
109
+ debtTooLow,
110
+ minDebt: ilkInfo.minDebt,
111
+ stabilityFee: ilkInfo.stabilityFee,
112
+ creatableDebt: ilkInfo.creatableDebt,
113
+ globalDebtCeiling: ilkInfo.globalDebtCeiling,
114
+ globalDebtCurrent: ilkInfo.globalDebtCurrent,
115
+ liquidationFee: ilkInfo.liquidationFee,
116
+ lastUpdated: Date.now(),
117
+ };
118
118
  };
@@ -1,80 +1,80 @@
1
- import { getConfigContractAddress } from '../../contracts';
2
- import {
3
- AaveMarketInfo, AaveVersions, MorphoAaveV2MarketInfo, MorphoAaveV3MarketInfo,
4
- } from '../../types';
5
- import { NetworkNumber } from '../../types/common';
6
- import {
7
- aaveV2AssetsDefaultMarket, aaveV3AssetsDefaultMarket, morphoAaveV2AssetDefaultMarket, morphoAaveV3AssetEthMarket,
8
- } from './marketAssets';
9
-
10
- export const AAVE_V2: AaveMarketInfo = {
11
- chainIds: [1],
12
- label: 'Aave v2',
13
- shortLabel: 'v2',
14
- value: AaveVersions.AaveV2,
15
- url: 'default',
16
- assets: aaveV2AssetsDefaultMarket,
17
- provider: 'LendingPoolAddressesProvider',
18
- providerAddress: getConfigContractAddress('LendingPoolAddressesProvider', 1), // rename
19
- lendingPool: 'AaveLendingPoolV2',
20
- lendingPoolAddress: getConfigContractAddress('AaveLendingPoolV2', 1),
21
- protocolData: 'AaveProtocolDataProvider',
22
- protocolDataAddress: getConfigContractAddress('AaveProtocolDataProvider', 1),
23
- // icon: SvgAdapter(protocolIcons.aave),
24
- protocolName: 'aave',
25
- };
26
-
27
- export const AAVE_V3 = (networkId: NetworkNumber): AaveMarketInfo => ({
28
- chainIds: [NetworkNumber.Eth, NetworkNumber.Opt, NetworkNumber.Arb, NetworkNumber.Base],
29
- label: 'Aave v3',
30
- shortLabel: 'v3',
31
- value: AaveVersions.AaveV3,
32
- url: 'default',
33
- assets: networkId ? aaveV3AssetsDefaultMarket[networkId] : [],
34
- provider: 'AaveV3PoolAddressesProvider',
35
- providerAddress: getConfigContractAddress('AaveV3PoolAddressesProvider', networkId),
36
- lendingPool: 'AaveV3LendingPool',
37
- lendingPoolAddress: getConfigContractAddress('AaveV3LendingPool', networkId),
38
- protocolData: 'AaveV3ProtocolDataProvider',
39
- protocolDataAddress: getConfigContractAddress('AaveV3ProtocolDataProvider', networkId),
40
- // icon: SvgAdapter(protocolIcons.aave),
41
- protocolName: 'aave',
42
- });
43
-
44
- export const MORPHO_AAVE_V2: MorphoAaveV2MarketInfo = {
45
- chainIds: [1],
46
- label: 'Morpho-Aave V2',
47
- shortLabel: 'morpho-aave-v2',
48
- value: AaveVersions.MorphoAaveV2,
49
- url: '',
50
- assets: morphoAaveV2AssetDefaultMarket,
51
- providerAddress: getConfigContractAddress('LendingPoolAddressesProvider', 1),
52
- lendingPoolAddress: getConfigContractAddress('MorphoAaveV2Proxy', 1),
53
- // icon: SvgAdapter(protocolIcons.morpho),
54
- protocolName: 'morpho',
55
- };
56
-
57
- export const MORPHO_AAVE_V3_ETH = (networkId: NetworkNumber = NetworkNumber.Eth): MorphoAaveV3MarketInfo => ({
58
- chainIds: [1],
59
- label: 'Morpho-Aave V3',
60
- shortLabel: 'morpho-aave-v3',
61
- subVersionLabel: 'ETH Optimizer',
62
- value: AaveVersions.MorphoAaveV3Eth,
63
- url: 'eth-optimizer',
64
- assets: morphoAaveV3AssetEthMarket,
65
- providerAddress: getConfigContractAddress('AaveV3PoolAddressesProvider', networkId), // TODO - check if used and if value is good?
66
- protocolData: 'AaveV3ProtocolDataProvider',
67
- protocolDataAddress: getConfigContractAddress('AaveV3ProtocolDataProvider', networkId),
68
- lendingPool: 'MorphoAaveV3ProxyEthMarket',
69
- lendingPoolAddress: getConfigContractAddress('MorphoAaveV3ProxyEthMarket', 1),
70
- // icon: SvgAdapter(protocolIcons.morpho),
71
- protocolName: 'morpho',
72
- });
73
-
74
-
75
- export const AaveMarkets = (networkId: NetworkNumber) => ({
76
- [AaveVersions.AaveV2]: AAVE_V2,
77
- [AaveVersions.AaveV3]: AAVE_V3(networkId),
78
- [AaveVersions.MorphoAaveV3Eth]: MORPHO_AAVE_V3_ETH(networkId),
79
- [AaveVersions.MorphoAaveV2]: MORPHO_AAVE_V2,
80
- }) as const;
1
+ import { getConfigContractAddress } from '../../contracts';
2
+ import {
3
+ AaveMarketInfo, AaveVersions, MorphoAaveV2MarketInfo, MorphoAaveV3MarketInfo,
4
+ } from '../../types';
5
+ import { NetworkNumber } from '../../types/common';
6
+ import {
7
+ aaveV2AssetsDefaultMarket, aaveV3AssetsDefaultMarket, morphoAaveV2AssetDefaultMarket, morphoAaveV3AssetEthMarket,
8
+ } from './marketAssets';
9
+
10
+ export const AAVE_V2: AaveMarketInfo = {
11
+ chainIds: [1],
12
+ label: 'Aave v2',
13
+ shortLabel: 'v2',
14
+ value: AaveVersions.AaveV2,
15
+ url: 'default',
16
+ assets: aaveV2AssetsDefaultMarket,
17
+ provider: 'LendingPoolAddressesProvider',
18
+ providerAddress: getConfigContractAddress('LendingPoolAddressesProvider', 1), // rename
19
+ lendingPool: 'AaveLendingPoolV2',
20
+ lendingPoolAddress: getConfigContractAddress('AaveLendingPoolV2', 1),
21
+ protocolData: 'AaveProtocolDataProvider',
22
+ protocolDataAddress: getConfigContractAddress('AaveProtocolDataProvider', 1),
23
+ // icon: SvgAdapter(protocolIcons.aave),
24
+ protocolName: 'aave',
25
+ };
26
+
27
+ export const AAVE_V3 = (networkId: NetworkNumber): AaveMarketInfo => ({
28
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Opt, NetworkNumber.Arb, NetworkNumber.Base],
29
+ label: 'Aave v3',
30
+ shortLabel: 'v3',
31
+ value: AaveVersions.AaveV3,
32
+ url: 'default',
33
+ assets: networkId ? aaveV3AssetsDefaultMarket[networkId] : [],
34
+ provider: 'AaveV3PoolAddressesProvider',
35
+ providerAddress: getConfigContractAddress('AaveV3PoolAddressesProvider', networkId),
36
+ lendingPool: 'AaveV3LendingPool',
37
+ lendingPoolAddress: getConfigContractAddress('AaveV3LendingPool', networkId),
38
+ protocolData: 'AaveV3ProtocolDataProvider',
39
+ protocolDataAddress: getConfigContractAddress('AaveV3ProtocolDataProvider', networkId),
40
+ // icon: SvgAdapter(protocolIcons.aave),
41
+ protocolName: 'aave',
42
+ });
43
+
44
+ export const MORPHO_AAVE_V2: MorphoAaveV2MarketInfo = {
45
+ chainIds: [1],
46
+ label: 'Morpho-Aave V2',
47
+ shortLabel: 'morpho-aave-v2',
48
+ value: AaveVersions.MorphoAaveV2,
49
+ url: '',
50
+ assets: morphoAaveV2AssetDefaultMarket,
51
+ providerAddress: getConfigContractAddress('LendingPoolAddressesProvider', 1),
52
+ lendingPoolAddress: getConfigContractAddress('MorphoAaveV2Proxy', 1),
53
+ // icon: SvgAdapter(protocolIcons.morpho),
54
+ protocolName: 'morpho',
55
+ };
56
+
57
+ export const MORPHO_AAVE_V3_ETH = (networkId: NetworkNumber = NetworkNumber.Eth): MorphoAaveV3MarketInfo => ({
58
+ chainIds: [1],
59
+ label: 'Morpho-Aave V3',
60
+ shortLabel: 'morpho-aave-v3',
61
+ subVersionLabel: 'ETH Optimizer',
62
+ value: AaveVersions.MorphoAaveV3Eth,
63
+ url: 'eth-optimizer',
64
+ assets: morphoAaveV3AssetEthMarket,
65
+ providerAddress: getConfigContractAddress('AaveV3PoolAddressesProvider', networkId), // TODO - check if used and if value is good?
66
+ protocolData: 'AaveV3ProtocolDataProvider',
67
+ protocolDataAddress: getConfigContractAddress('AaveV3ProtocolDataProvider', networkId),
68
+ lendingPool: 'MorphoAaveV3ProxyEthMarket',
69
+ lendingPoolAddress: getConfigContractAddress('MorphoAaveV3ProxyEthMarket', 1),
70
+ // icon: SvgAdapter(protocolIcons.morpho),
71
+ protocolName: 'morpho',
72
+ });
73
+
74
+
75
+ export const AaveMarkets = (networkId: NetworkNumber) => ({
76
+ [AaveVersions.AaveV2]: AAVE_V2,
77
+ [AaveVersions.AaveV3]: AAVE_V3(networkId),
78
+ [AaveVersions.MorphoAaveV3Eth]: MORPHO_AAVE_V3_ETH(networkId),
79
+ [AaveVersions.MorphoAaveV2]: MORPHO_AAVE_V2,
80
+ }) as const;
@@ -1,25 +1,25 @@
1
- import { NetworkNumber } from '../../types/common';
2
-
3
- export const aaveV2AssetsDefaultMarket = ['USDT', 'WBTC', 'ETH', 'YFI', 'ZRX', 'UNI', 'AAVE', 'BAT', 'BUSD', 'DAI', 'ENJ', 'KNCL', 'LINK', 'MANA', 'MKR', 'REN', 'SNX', 'SUSD', 'TUSD', 'USDC', 'CRV', 'GUSD', 'BAL', 'xSUSHI', 'RENFIL', 'RAI', 'AMPL', 'USDP', 'DPI', 'FRAX', 'FEI', 'stETH', 'ENS', 'UST', 'CVX', '1INCH', 'LUSD'];
4
- export const morphoAaveV2AssetDefaultMarket = ['DAI', 'ETH', 'USDC', 'USDT', 'WBTC', 'stETH', 'CRV'];
5
-
6
- export const morphoAaveV3AssetEthMarket = [
7
- 'ETH', 'wstETH', 'DAI', 'USDC', 'WBTC', 'rETH', 'cbETH', 'sDAI', 'USDT',
8
- ];
9
-
10
- export const aaveV3AssetsDefaultMarketEth = ['ETH', 'wstETH', 'WBTC', 'USDC', 'DAI', 'LINK', 'AAVE', 'cbETH', 'USDT', 'rETH', 'LUSD', 'CRV', 'MKR', 'SNX', 'BAL', 'UNI', 'LDO', 'ENS', '1INCH', 'FRAX', 'GHO', 'RPL', 'sDAI', 'STG', 'KNC', 'FXS', 'crvUSD', 'PYUSD', 'weETH', 'osETH', 'USDe'];
11
- export const aaveV3AssetsDefaultMarketOpt = [
12
- 'DAI', 'USDC.e', 'USDT', 'SUSD', 'AAVE', 'LINK', 'WBTC', 'ETH', 'OP', 'wstETH', 'LUSD', 'MAI', 'rETH', 'USDC',
13
- ];
14
- export const aaveV3AssetsDefaultMarketArb = [
15
- 'ETH', 'DAI', 'EURS', 'USDC', 'USDT', 'AAVE', 'LINK', 'WBTC', 'wstETH', 'MAI', 'rETH', 'LUSD', 'USDC.e', 'FRAX', 'ARB', 'weETH',
16
- ];
17
- export const aaveV3AssetsDefaultMarketBase = ['ETH', 'cbETH', 'USDbC', 'wstETH', 'USDC', 'weETH'];
18
-
19
- // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
20
- export const aaveV3AssetsDefaultMarket = {
21
- [NetworkNumber.Eth]: aaveV3AssetsDefaultMarketEth,
22
- [NetworkNumber.Opt]: aaveV3AssetsDefaultMarketOpt,
23
- [NetworkNumber.Arb]: aaveV3AssetsDefaultMarketArb,
24
- [NetworkNumber.Base]: aaveV3AssetsDefaultMarketBase,
25
- } as const;
1
+ import { NetworkNumber } from '../../types/common';
2
+
3
+ export const aaveV2AssetsDefaultMarket = ['USDT', 'WBTC', 'ETH', 'YFI', 'ZRX', 'UNI', 'AAVE', 'BAT', 'BUSD', 'DAI', 'ENJ', 'KNCL', 'LINK', 'MANA', 'MKR', 'REN', 'SNX', 'SUSD', 'TUSD', 'USDC', 'CRV', 'GUSD', 'BAL', 'xSUSHI', 'RENFIL', 'RAI', 'AMPL', 'USDP', 'DPI', 'FRAX', 'FEI', 'stETH', 'ENS', 'UST', 'CVX', '1INCH', 'LUSD'];
4
+ export const morphoAaveV2AssetDefaultMarket = ['DAI', 'ETH', 'USDC', 'USDT', 'WBTC', 'stETH', 'CRV'];
5
+
6
+ export const morphoAaveV3AssetEthMarket = [
7
+ 'ETH', 'wstETH', 'DAI', 'USDC', 'WBTC', 'rETH', 'cbETH', 'sDAI', 'USDT',
8
+ ];
9
+
10
+ export const aaveV3AssetsDefaultMarketEth = ['ETH', 'wstETH', 'WBTC', 'USDC', 'DAI', 'LINK', 'AAVE', 'cbETH', 'USDT', 'rETH', 'LUSD', 'CRV', 'MKR', 'SNX', 'BAL', 'UNI', 'LDO', 'ENS', '1INCH', 'FRAX', 'GHO', 'RPL', 'sDAI', 'STG', 'KNC', 'FXS', 'crvUSD', 'PYUSD', 'weETH', 'osETH', 'USDe'];
11
+ export const aaveV3AssetsDefaultMarketOpt = [
12
+ 'DAI', 'USDC.e', 'USDT', 'SUSD', 'AAVE', 'LINK', 'WBTC', 'ETH', 'OP', 'wstETH', 'LUSD', 'MAI', 'rETH', 'USDC',
13
+ ];
14
+ export const aaveV3AssetsDefaultMarketArb = [
15
+ 'ETH', 'DAI', 'EURS', 'USDC', 'USDT', 'AAVE', 'LINK', 'WBTC', 'wstETH', 'MAI', 'rETH', 'LUSD', 'USDC.e', 'FRAX', 'ARB', 'weETH',
16
+ ];
17
+ export const aaveV3AssetsDefaultMarketBase = ['ETH', 'cbETH', 'USDbC', 'wstETH', 'USDC', 'weETH'];
18
+
19
+ // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
20
+ export const aaveV3AssetsDefaultMarket = {
21
+ [NetworkNumber.Eth]: aaveV3AssetsDefaultMarketEth,
22
+ [NetworkNumber.Opt]: aaveV3AssetsDefaultMarketOpt,
23
+ [NetworkNumber.Arb]: aaveV3AssetsDefaultMarketArb,
24
+ [NetworkNumber.Base]: aaveV3AssetsDefaultMarketBase,
25
+ } as const;