@defisaver/positions-sdk 0.0.20 → 0.0.22

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 (99) hide show
  1. package/README.md +63 -0
  2. package/cjs/aaveV2/index.js +9 -4
  3. package/cjs/aaveV3/index.js +9 -4
  4. package/cjs/compoundV2/index.d.ts +1 -0
  5. package/cjs/compoundV2/index.js +15 -8
  6. package/cjs/config/contracts.d.ts +373 -201
  7. package/cjs/config/contracts.js +22 -0
  8. package/cjs/helpers/aaveHelpers/index.js +0 -5
  9. package/cjs/helpers/compoundHelpers/index.js +2 -2
  10. package/cjs/markets/compound/index.d.ts +2 -0
  11. package/cjs/markets/compound/index.js +60 -13
  12. package/cjs/markets/compound/marketsAssets.d.ts +7 -1
  13. package/cjs/markets/compound/marketsAssets.js +12 -2
  14. package/cjs/morphoAaveV2/index.js +4 -3
  15. package/cjs/morphoAaveV3/index.js +9 -4
  16. package/cjs/spark/index.js +9 -4
  17. package/cjs/types/aave.d.ts +0 -5
  18. package/cjs/types/compound.d.ts +6 -4
  19. package/cjs/types/compound.js +1 -0
  20. package/cjs/types/contracts/generated/CUSDCev3.d.ts +441 -0
  21. package/cjs/types/contracts/generated/CUSDCev3.js +5 -0
  22. package/cjs/types/contracts/generated/CompV3USDCBulkerArb.d.ts +41 -0
  23. package/cjs/types/contracts/generated/CompV3USDCBulkerArb.js +5 -0
  24. package/cjs/types/contracts/generated/index.d.ts +2 -0
  25. package/esm/aaveV2/index.js +11 -6
  26. package/esm/aaveV3/index.js +11 -6
  27. package/esm/compoundV2/index.d.ts +1 -0
  28. package/esm/compoundV2/index.js +13 -7
  29. package/esm/config/contracts.d.ts +373 -201
  30. package/esm/config/contracts.js +22 -0
  31. package/esm/helpers/aaveHelpers/index.js +0 -5
  32. package/esm/helpers/compoundHelpers/index.js +2 -2
  33. package/esm/markets/compound/index.d.ts +2 -0
  34. package/esm/markets/compound/index.js +59 -13
  35. package/esm/markets/compound/marketsAssets.d.ts +7 -1
  36. package/esm/markets/compound/marketsAssets.js +11 -1
  37. package/esm/morphoAaveV2/index.js +4 -3
  38. package/esm/morphoAaveV3/index.js +9 -4
  39. package/esm/spark/index.js +11 -6
  40. package/esm/types/aave.d.ts +0 -5
  41. package/esm/types/compound.d.ts +6 -4
  42. package/esm/types/compound.js +1 -0
  43. package/esm/types/contracts/generated/CUSDCev3.d.ts +441 -0
  44. package/esm/types/contracts/generated/CUSDCev3.js +4 -0
  45. package/esm/types/contracts/generated/CompV3USDCBulkerArb.d.ts +41 -0
  46. package/esm/types/contracts/generated/CompV3USDCBulkerArb.js +4 -0
  47. package/esm/types/contracts/generated/index.d.ts +2 -0
  48. package/package.json +40 -40
  49. package/src/aaveV2/index.ts +226 -220
  50. package/src/aaveV3/index.ts +561 -554
  51. package/src/assets/index.ts +60 -60
  52. package/src/chickenBonds/index.ts +123 -123
  53. package/src/compoundV2/index.ts +219 -206
  54. package/src/compoundV3/index.ts +275 -275
  55. package/src/config/contracts.js +673 -651
  56. package/src/constants/index.ts +3 -3
  57. package/src/contracts.ts +100 -100
  58. package/src/curveUsd/index.ts +228 -228
  59. package/src/exchange/index.ts +17 -17
  60. package/src/helpers/aaveHelpers/index.ts +134 -141
  61. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  62. package/src/helpers/compoundHelpers/index.ts +181 -181
  63. package/src/helpers/curveUsdHelpers/index.ts +32 -32
  64. package/src/helpers/index.ts +5 -5
  65. package/src/helpers/makerHelpers/index.ts +94 -94
  66. package/src/helpers/sparkHelpers/index.ts +106 -106
  67. package/src/index.ts +40 -40
  68. package/src/liquity/index.ts +116 -116
  69. package/src/maker/index.ts +101 -101
  70. package/src/markets/aave/index.ts +80 -80
  71. package/src/markets/aave/marketAssets.ts +32 -32
  72. package/src/markets/compound/index.ts +141 -85
  73. package/src/markets/compound/marketsAssets.ts +46 -35
  74. package/src/markets/curveUsd/index.ts +69 -69
  75. package/src/markets/index.ts +3 -3
  76. package/src/markets/spark/index.ts +29 -29
  77. package/src/markets/spark/marketAssets.ts +9 -9
  78. package/src/moneymarket/moneymarketCommonService.ts +75 -75
  79. package/src/morpho/markets.ts +39 -39
  80. package/src/morphoAaveV2/index.ts +255 -254
  81. package/src/morphoAaveV3/index.ts +619 -614
  82. package/src/multicall/index.ts +22 -22
  83. package/src/services/dsrService.ts +15 -15
  84. package/src/services/priceService.ts +21 -21
  85. package/src/services/utils.ts +34 -34
  86. package/src/spark/index.ts +421 -413
  87. package/src/staking/staking.ts +167 -167
  88. package/src/types/aave.ts +256 -261
  89. package/src/types/chickenBonds.ts +45 -45
  90. package/src/types/common.ts +83 -83
  91. package/src/types/compound.ts +128 -122
  92. package/src/types/contracts/generated/CUSDCev3.ts +685 -0
  93. package/src/types/contracts/generated/CompV3USDCBulkerArb.ts +85 -0
  94. package/src/types/contracts/generated/index.ts +2 -0
  95. package/src/types/curveUsd.ts +112 -112
  96. package/src/types/index.ts +6 -6
  97. package/src/types/liquity.ts +30 -30
  98. package/src/types/maker.ts +50 -50
  99. package/src/types/spark.ts +106 -106
@@ -1,102 +1,102 @@
1
- import Web3 from 'web3';
2
- import Dec from 'decimal.js';
3
- import { assetAmountInEth, getAssetInfo, ilkToAsset } from '@defisaver/tokens';
4
- import { Blockish, NetworkNumber, PositionBalances } from '../types/common';
5
- import { McdViewContract } from '../contracts';
6
- import { makerHelpers } from '../helpers';
7
- import { CdpData } from '../types';
8
- import { wethToEth } from '../services/utils';
9
-
10
- export const getMakerAccountBalances = async (web3: Web3, network: NetworkNumber, block: Blockish, addressMapping: boolean, cdpId: string): Promise<PositionBalances> => {
11
- let balances: PositionBalances = {
12
- collateral: {},
13
- debt: {},
14
- };
15
-
16
- if (!cdpId) {
17
- return balances;
18
- }
19
-
20
- const viewContract = McdViewContract(web3, network, block);
21
- // @ts-ignore
22
- const cdpInfo = await viewContract.methods.getCdpInfo(cdpId).call({}, block);
23
- const ilkInfo = await makerHelpers.getCollateralInfo(cdpInfo.ilk, web3, network, block);
24
-
25
- const asset = wethToEth(ilkToAsset(cdpInfo.ilk));
26
-
27
- balances = {
28
- collateral: {
29
- [addressMapping ? getAssetInfo(asset, network).address.toLowerCase() : asset]: asset === 'WBTC' ? new Dec(cdpInfo.collateral).div(1e10).floor().toString() : cdpInfo.collateral,
30
- },
31
- debt: {
32
- [addressMapping ? getAssetInfo('DAI', network).address.toLowerCase() : 'DAI']: new Dec(cdpInfo.debt).times(ilkInfo.currentRate).div(1e27).floor()
33
- .toString(),
34
- },
35
- };
36
-
37
- return balances;
38
- };
39
-
40
- export const getMakerCdpData = async (web3: Web3, network: NetworkNumber, cdpId: string): Promise<CdpData> => {
41
- const viewContract = McdViewContract(web3, network);
42
-
43
- // @ts-ignore
44
- const cdpInfo = await viewContract.methods.getCdpInfo(cdpId).call();
45
-
46
- const [ilkInfo, coll] = await Promise.all([
47
- makerHelpers.getCollateralInfo(cdpInfo.ilk, web3, network),
48
- makerHelpers.getUnclaimedCollateral(web3, network, cdpInfo.urn, cdpInfo.ilk),
49
- ]);
50
-
51
- const asset = ilkToAsset(cdpInfo.ilk);
52
-
53
- const collateralUsd = new Dec(cdpInfo.collateral).mul(ilkInfo.assetPrice).floor().toString();
54
- const debt = new Dec(cdpInfo.debt).times(ilkInfo.currentRate).div(1e27).floor()
55
- .toString();
56
- const futureDebt = new Dec(cdpInfo.debt).times(ilkInfo.futureRate).div(1e27).floor()
57
- .toString(); // after drip
58
- const debtDripDelta = assetAmountInEth(new Dec(futureDebt).sub(debt).toString(), 'DAI');
59
- const liquidationPrice = new Dec(debt).times(ilkInfo.liqRatio).div(cdpInfo.collateral).toString();
60
-
61
- let ratio = new Dec(cdpInfo.collateral).times(ilkInfo.assetPrice).div(debt).times(100)
62
- .toString();
63
- if (new Dec(debt).eq(0)) ratio = '0';
64
-
65
- const debtTooLow = new Dec(debt).gt(0) && new Dec(assetAmountInEth(debt, 'DAI')).lt(ilkInfo.minDebt);
66
-
67
- const par = '1';
68
- return {
69
- owner: cdpInfo.owner,
70
- userAddress: cdpInfo.userAddr,
71
- id: cdpId,
72
- urn: cdpInfo.urn,
73
- type: 'mcd',
74
- ilk: cdpInfo.ilk,
75
- ilkLabel: ilkInfo.ilkLabel,
76
- asset,
77
- collateral: assetAmountInEth(cdpInfo.collateral, `MCD-${asset}`),
78
- collateralUsd: assetAmountInEth(collateralUsd, `MCD-${asset}`),
79
- futureDebt: assetAmountInEth(futureDebt, 'DAI'),
80
- debtDai: assetAmountInEth(debt, 'DAI'),
81
- debtUsd: assetAmountInEth(debt, 'DAI'),
82
- debtInAsset: assetAmountInEth(debt, 'DAI'),
83
- debtAssetPrice: par,
84
- debtAssetMarketPrice: par,
85
- liquidationPrice,
86
- ratio,
87
- liqRatio: ilkInfo.liqRatio.toString(),
88
- liqPercent: parseFloat(ilkInfo.liqPercent.toString()),
89
- assetPrice: ilkInfo.assetPrice,
90
- daiLabel: 'DAI',
91
- debtAsset: 'DAI',
92
- unclaimedCollateral: assetAmountInEth(coll, asset),
93
- debtTooLow,
94
- minDebt: ilkInfo.minDebt,
95
- stabilityFee: ilkInfo.stabilityFee,
96
- creatableDebt: ilkInfo.creatableDebt,
97
- globalDebtCeiling: ilkInfo.globalDebtCeiling,
98
- globalDebtCurrent: ilkInfo.globalDebtCurrent,
99
- liquidationFee: ilkInfo.liquidationFee,
100
- lastUpdated: Date.now(),
101
- };
1
+ import Web3 from 'web3';
2
+ import Dec from 'decimal.js';
3
+ import { assetAmountInEth, getAssetInfo, ilkToAsset } from '@defisaver/tokens';
4
+ import { Blockish, NetworkNumber, PositionBalances } from '../types/common';
5
+ import { McdViewContract } from '../contracts';
6
+ import { makerHelpers } from '../helpers';
7
+ import { CdpData } from '../types';
8
+ import { wethToEth } from '../services/utils';
9
+
10
+ export const getMakerAccountBalances = async (web3: Web3, network: NetworkNumber, block: Blockish, addressMapping: boolean, cdpId: string): Promise<PositionBalances> => {
11
+ let balances: PositionBalances = {
12
+ collateral: {},
13
+ debt: {},
14
+ };
15
+
16
+ if (!cdpId) {
17
+ return balances;
18
+ }
19
+
20
+ const viewContract = McdViewContract(web3, network, block);
21
+ // @ts-ignore
22
+ const cdpInfo = await viewContract.methods.getCdpInfo(cdpId).call({}, block);
23
+ const ilkInfo = await makerHelpers.getCollateralInfo(cdpInfo.ilk, web3, network, block);
24
+
25
+ const asset = wethToEth(ilkToAsset(cdpInfo.ilk));
26
+
27
+ balances = {
28
+ collateral: {
29
+ [addressMapping ? getAssetInfo(asset, network).address.toLowerCase() : asset]: asset === 'WBTC' ? new Dec(cdpInfo.collateral).div(1e10).floor().toString() : cdpInfo.collateral,
30
+ },
31
+ debt: {
32
+ [addressMapping ? getAssetInfo('DAI', network).address.toLowerCase() : 'DAI']: new Dec(cdpInfo.debt).times(ilkInfo.currentRate).div(1e27).floor()
33
+ .toString(),
34
+ },
35
+ };
36
+
37
+ return balances;
38
+ };
39
+
40
+ export const getMakerCdpData = async (web3: Web3, network: NetworkNumber, cdpId: string): Promise<CdpData> => {
41
+ const viewContract = McdViewContract(web3, network);
42
+
43
+ // @ts-ignore
44
+ const cdpInfo = await viewContract.methods.getCdpInfo(cdpId).call();
45
+
46
+ const [ilkInfo, coll] = await Promise.all([
47
+ makerHelpers.getCollateralInfo(cdpInfo.ilk, web3, network),
48
+ makerHelpers.getUnclaimedCollateral(web3, network, cdpInfo.urn, cdpInfo.ilk),
49
+ ]);
50
+
51
+ const asset = ilkToAsset(cdpInfo.ilk);
52
+
53
+ const collateralUsd = new Dec(cdpInfo.collateral).mul(ilkInfo.assetPrice).floor().toString();
54
+ const debt = new Dec(cdpInfo.debt).times(ilkInfo.currentRate).div(1e27).floor()
55
+ .toString();
56
+ const futureDebt = new Dec(cdpInfo.debt).times(ilkInfo.futureRate).div(1e27).floor()
57
+ .toString(); // after drip
58
+ const debtDripDelta = assetAmountInEth(new Dec(futureDebt).sub(debt).toString(), 'DAI');
59
+ const liquidationPrice = new Dec(debt).times(ilkInfo.liqRatio).div(cdpInfo.collateral).toString();
60
+
61
+ let ratio = new Dec(cdpInfo.collateral).times(ilkInfo.assetPrice).div(debt).times(100)
62
+ .toString();
63
+ if (new Dec(debt).eq(0)) ratio = '0';
64
+
65
+ const debtTooLow = new Dec(debt).gt(0) && new Dec(assetAmountInEth(debt, 'DAI')).lt(ilkInfo.minDebt);
66
+
67
+ const par = '1';
68
+ return {
69
+ owner: cdpInfo.owner,
70
+ userAddress: cdpInfo.userAddr,
71
+ id: cdpId,
72
+ urn: cdpInfo.urn,
73
+ type: 'mcd',
74
+ ilk: cdpInfo.ilk,
75
+ ilkLabel: ilkInfo.ilkLabel,
76
+ asset,
77
+ collateral: assetAmountInEth(cdpInfo.collateral, `MCD-${asset}`),
78
+ collateralUsd: assetAmountInEth(collateralUsd, `MCD-${asset}`),
79
+ futureDebt: assetAmountInEth(futureDebt, 'DAI'),
80
+ debtDai: assetAmountInEth(debt, 'DAI'),
81
+ debtUsd: assetAmountInEth(debt, 'DAI'),
82
+ debtInAsset: assetAmountInEth(debt, 'DAI'),
83
+ debtAssetPrice: par,
84
+ debtAssetMarketPrice: par,
85
+ liquidationPrice,
86
+ ratio,
87
+ liqRatio: ilkInfo.liqRatio.toString(),
88
+ liqPercent: parseFloat(ilkInfo.liqPercent.toString()),
89
+ assetPrice: ilkInfo.assetPrice,
90
+ daiLabel: 'DAI',
91
+ debtAsset: 'DAI',
92
+ unclaimedCollateral: assetAmountInEth(coll, asset),
93
+ debtTooLow,
94
+ minDebt: ilkInfo.minDebt,
95
+ stabilityFee: ilkInfo.stabilityFee,
96
+ creatableDebt: ilkInfo.creatableDebt,
97
+ globalDebtCeiling: ilkInfo.globalDebtCeiling,
98
+ globalDebtCurrent: ilkInfo.globalDebtCurrent,
99
+ liquidationFee: ilkInfo.liquidationFee,
100
+ lastUpdated: Date.now(),
101
+ };
102
102
  };
@@ -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,33 +1,33 @@
1
- // TODO generate this file automatically
2
-
3
- import { NetworkNumber } from '../../types/common';
4
-
5
- export const aaveV2AssetsDefaultMarket = [
6
- 'AAVE', 'BAL', 'BAT', 'BUSD', 'CRV', 'DAI', 'ENJ', 'ETH', 'GUSD', 'LINK', 'MANA', 'MKR',
7
- 'REN', 'SNX', 'SUSD', 'TUSD', 'UNI', 'USDC', 'USDT', 'WBTC', 'YFI', 'xSUSHI', 'ZRX', 'RAI',
8
- 'AMPL', 'DPI', 'USDP', 'RENFIL', 'FRAX', 'FEI', 'stETH', 'ENS', 'UST', 'CVX', '1INCH', 'LUSD',
9
- ] as const;
10
-
11
- export const morphoAaveV2AssetDefaultMarket = [
12
- 'ETH', 'stETH', 'USDC', 'WBTC', 'USDT', 'DAI', 'CRV',
13
- ];
14
-
15
- export const morphoAaveV3AssetEthMarket = [
16
- 'ETH', 'wstETH', 'DAI', 'USDC', 'WBTC', 'rETH', 'cbETH',
17
- ];
18
-
19
- export const aaveV3AssetsDefaultMarket = {
20
- [NetworkNumber.Eth]: [
21
- 'WBTC', 'ETH', 'wstETH', 'USDC', 'DAI', 'LINK', 'AAVE', 'cbETH', 'USDT', 'rETH', 'LUSD', 'UNI', 'MKR', 'SNX', 'BAL',
22
- 'LDO', 'CRV', 'ENS', '1INCH', 'GHO', 'FRAX', 'RPL', 'sDAI',
23
- ],
24
- [NetworkNumber.Opt]: [
25
- 'DAI', 'USDC.e', 'USDT', 'SUSD', 'AAVE', 'LINK', 'WBTC', 'ETH', 'OP', 'wstETH', 'LUSD', 'MAI', 'rETH',
26
- ],
27
- [NetworkNumber.Arb]: [
28
- 'ETH', 'DAI', 'EURS', 'USDC', 'USDT', 'AAVE', 'LINK', 'WBTC', 'wstETH', 'MAI', 'rETH', 'LUSD', 'USDC.e', 'FRAX', 'ARB',
29
- ],
30
- [NetworkNumber.Base]: [
31
- 'ETH', 'USDbC', 'cbETH',
32
- ],
1
+ // TODO generate this file automatically
2
+
3
+ import { NetworkNumber } from '../../types/common';
4
+
5
+ export const aaveV2AssetsDefaultMarket = [
6
+ 'AAVE', 'BAL', 'BAT', 'BUSD', 'CRV', 'DAI', 'ENJ', 'ETH', 'GUSD', 'LINK', 'MANA', 'MKR',
7
+ 'REN', 'SNX', 'SUSD', 'TUSD', 'UNI', 'USDC', 'USDT', 'WBTC', 'YFI', 'xSUSHI', 'ZRX', 'RAI',
8
+ 'AMPL', 'DPI', 'USDP', 'RENFIL', 'FRAX', 'FEI', 'stETH', 'ENS', 'UST', 'CVX', '1INCH', 'LUSD',
9
+ ] as const;
10
+
11
+ export const morphoAaveV2AssetDefaultMarket = [
12
+ 'ETH', 'stETH', 'USDC', 'WBTC', 'USDT', 'DAI', 'CRV',
13
+ ];
14
+
15
+ export const morphoAaveV3AssetEthMarket = [
16
+ 'ETH', 'wstETH', 'DAI', 'USDC', 'WBTC', 'rETH', 'cbETH',
17
+ ];
18
+
19
+ export const aaveV3AssetsDefaultMarket = {
20
+ [NetworkNumber.Eth]: [
21
+ 'WBTC', 'ETH', 'wstETH', 'USDC', 'DAI', 'LINK', 'AAVE', 'cbETH', 'USDT', 'rETH', 'LUSD', 'UNI', 'MKR', 'SNX', 'BAL',
22
+ 'LDO', 'CRV', 'ENS', '1INCH', 'GHO', 'FRAX', 'RPL', 'sDAI',
23
+ ],
24
+ [NetworkNumber.Opt]: [
25
+ 'DAI', 'USDC.e', 'USDT', 'SUSD', 'AAVE', 'LINK', 'WBTC', 'ETH', 'OP', 'wstETH', 'LUSD', 'MAI', 'rETH',
26
+ ],
27
+ [NetworkNumber.Arb]: [
28
+ 'ETH', 'DAI', 'EURS', 'USDC', 'USDT', 'AAVE', 'LINK', 'WBTC', 'wstETH', 'MAI', 'rETH', 'LUSD', 'USDC.e', 'FRAX', 'ARB',
29
+ ],
30
+ [NetworkNumber.Base]: [
31
+ 'ETH', 'USDbC', 'cbETH',
32
+ ],
33
33
  } as const;