Merge pull request #42 from aave/config-clean-up-updated-amm

Updated a few small errors & changed "Lp" to "Amm"
This commit is contained in:
Zer0dot 2021-02-24 16:50:03 -05:00 committed by GitHub
commit 70b1a6bdce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 103 additions and 110 deletions

View File

@ -8,8 +8,8 @@ import {
} from './types';
import { getParamPerPool } from './contracts-helpers';
import AaveConfig from '../markets/aave';
import LpConfig from '../markets/lp';
import MaticConfig from '../markets/matic';
import AmmConfig from '../markets/amm';
import { CommonsConfig } from '../markets/aave/commons';
import { DRE, filterMapBy } from './misc-utils';
import { tEthereumAddress } from './types';
@ -19,18 +19,18 @@ import { deployWETHMocked } from './contracts-deployments';
export enum ConfigNames {
Commons = 'Commons',
Aave = 'Aave',
Lp = 'Lp',
Matic = 'Matic',
Amm = 'Amm',
}
export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => {
switch (configName) {
case ConfigNames.Aave:
return AaveConfig;
case ConfigNames.Lp:
return LpConfig;
case ConfigNames.Matic:
return MaticConfig;
case ConfigNames.Amm:
return AmmConfig;
case ConfigNames.Commons:
return CommonsConfig;
default:
@ -48,8 +48,8 @@ export const getReservesConfigByPool = (pool: AavePools): iMultiPoolsAssets<IRes
[AavePools.proto]: {
...AaveConfig.ReservesConfig,
},
[AavePools.lp]: {
...LpConfig.ReservesConfig,
[AavePools.amm]: {
...AmmConfig.ReservesConfig,
},
[AavePools.matic]: {
...MaticConfig.ReservesConfig,

View File

@ -54,7 +54,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_PRICES = {
UniWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(),
UniAAVEWETH: oneEther.multipliedBy('0.003620948469').toFixed(),
UniBATWETH: oneEther.multipliedBy('22.407436').toFixed(),
UniUSDCDAI: oneEther.multipliedBy('22.407436').toFixed(),
UniDAIUSDC: oneEther.multipliedBy('22.407436').toFixed(),
UniCRVWETH: oneEther.multipliedBy('22.407436').toFixed(),
UniLINKWETH: oneEther.multipliedBy('0.009955').toFixed(),
UniMKRWETH: oneEther.multipliedBy('22.407436').toFixed(),

View File

@ -172,7 +172,7 @@ export const getPairsTokenAggregator = (
},
aggregatorsAddresses: { [tokenSymbol: string]: tEthereumAddress }
): [string[], string[]] => {
const { ETH, USD, WETH, LpWETH, ...assetsAddressesWithoutEth } = allAssetsAddresses;
const { ETH, USD, WETH, ...assetsAddressesWithoutEth } = allAssetsAddresses;
const pairs = Object.entries(assetsAddressesWithoutEth).map(([tokenSymbol, tokenAddress]) => {
//if (true/*tokenSymbol !== 'WETH' && tokenSymbol !== 'ETH' && tokenSymbol !== 'LpWETH'*/) {

View File

@ -167,7 +167,7 @@ export const getParamPerNetwork = <T>(param: iParamsPerNetwork<T>, network: eNet
case eEthereumNetwork.ropsten:
return ropsten;
case eEthereumNetwork.main:
return mumbai;
return main;
case eEthereumNetwork.tenderlyMain:
return tenderlyMain;
case ePolygonNetwork.matic:
@ -179,12 +179,14 @@ export const getParamPerNetwork = <T>(param: iParamsPerNetwork<T>, network: eNet
}
};
export const getParamPerPool = <T>({ proto, lp }: iParamsPerPool<T>, pool: AavePools) => {
export const getParamPerPool = <T>({ proto, amm, matic }: iParamsPerPool<T>, pool: AavePools) => {
switch (pool) {
case AavePools.proto:
return proto;
case AavePools.lp:
return lp;
case AavePools.amm:
return amm;
case AavePools.matic:
return matic;
default:
return proto;
}

View File

@ -105,7 +105,7 @@ export const initReservesByHelper = async (
let stableDebtTokenImplementationAddress = '';
let variableDebtTokenImplementationAddress = '';
// NOT WORKING ON MATIC
// NOT WORKING ON MATIC, DEPLOYING INDIVIDUAL IMPLs INSTEAD
// const tx1 = await waitForTx(
// await stableAndVariableDeployer.initDeployment([ZERO_ADDRESS], ["1"])
// );
@ -216,7 +216,7 @@ export const initReservesByHelper = async (
const chunkedInitInputParams = chunk(initInputParams, initChunks);
const configurator = await getLendingPoolConfiguratorProxy();
await waitForTx(await addressProvider.setPoolAdmin(admin));
//await waitForTx(await addressProvider.setPoolAdmin(admin));
console.log(`- Reserves initialization in ${chunkedInitInputParams.length} txs`);
for (let chunkIndex = 0; chunkIndex < chunkedInitInputParams.length; chunkIndex++) {
@ -386,7 +386,7 @@ export const initTokenReservesByHelper = async (
const poolAddress = await addressProvider.getLendingPool();
// Set aTokenAndRatesDeployer as temporal admin
await waitForTx(await addressProvider.setPoolAdmin(atokenAndRatesDeployer.address));
//await waitForTx(await addressProvider.setPoolAdmin(atokenAndRatesDeployer.address));
// CHUNK CONFIGURATION
const initChunks = 4;
@ -562,7 +562,7 @@ export const initTokenReservesByHelper = async (
const chunkedInitInputParams = chunk(initInputParams, initChunks);
const configurator = await getLendingPoolConfiguratorProxy();
await waitForTx(await addressProvider.setPoolAdmin(admin));
//await waitForTx(await addressProvider.setPoolAdmin(admin));
console.log(`- Reserves initialization in ${chunkedInitInputParams.length} txs`);
for (let chunkIndex = 0; chunkIndex < chunkedInitInputParams.length; chunkIndex++) {
@ -575,8 +575,8 @@ export const initTokenReservesByHelper = async (
}
// Set deployer back as admin
await waitForTx(await addressProvider.setPoolAdmin(admin));
return gasUsage; // No longer relevant
//await waitForTx(await addressProvider.setPoolAdmin(admin));
return gasUsage; // No longer relevant
};
// Function deprecated

View File

@ -36,8 +36,8 @@ export enum EthereumNetworkNames {
export enum AavePools {
proto = 'proto',
lp = 'lp',
matic = 'matic',
amm = 'amm',
}
export enum eContractid {
@ -220,16 +220,11 @@ export interface iAssetBase<T> {
USD: T;
REN: T;
ENJ: T;
// LpWETH: T;
// LpWBTC: T;
// LpDAI: T;
// LpUSDC: T;
// LpUSDT: T;
UniDAIWETH: T;
UniWBTCWETH: T;
UniAAVEWETH: T;
UniBATWETH: T;
UniUSDCDAI: T;
UniDAIUSDC: T;
UniCRVWETH: T;
UniLINKWETH: T;
UniMKRWETH: T;
@ -283,7 +278,7 @@ export type iLpPoolAssets<T> = Pick<
| 'UniWBTCWETH'
| 'UniAAVEWETH'
| 'UniBATWETH'
| 'UniUSDCDAI'
| 'UniDAIUSDC'
| 'UniCRVWETH'
| 'UniLINKWETH'
| 'UniMKRWETH'
@ -334,16 +329,11 @@ export enum TokenContractId {
YFI = 'YFI',
UNI = 'UNI',
ENJ = 'ENJ',
// LpWETH = 'LpWETH',
// LpWBTC = 'LpWBTC',
// LpDAI = 'LpDAI',
// LpUSDC = 'LpUSDC',
// LpUSDT = 'LpUSDT',
UniDAIWETH = 'UniDAIWETH',
UniWBTCWETH = 'UniWBTCWETH',
UniAAVEWETH = 'UniAAVEWETH',
UniBATWETH = 'UniBATWETH',
UniUSDCDAI = 'UniUSDCDAI',
UniDAIUSDC = 'UniDAIUSDC',
UniCRVWETH = 'UniCRVWETH',
UniLINKWETH = 'UniLINKWETH',
UniMKRWETH = 'UniMKRWETH',
@ -426,8 +416,8 @@ export interface iXDaiParamsPerNetwork<T> {
export interface iParamsPerPool<T> {
[AavePools.proto]: T;
[AavePools.lp]: T;
[AavePools.matic]: T;
[AavePools.amm]: T;
}
export interface iBasicDistributionParams {
@ -502,7 +492,7 @@ export interface IAaveConfiguration extends ICommonConfiguration {
ReservesConfig: iAavePoolAssets<IReserveParams>;
}
export interface ILpConfiguration extends ICommonConfiguration {
export interface IAmmConfiguration extends ICommonConfiguration {
ReservesConfig: iLpPoolAssets<IReserveParams>;
}

View File

@ -60,7 +60,7 @@ export const CommonsConfig: ICommonConfiguration = {
UniBATWETH: {
borrowRate: oneRay.multipliedBy(0.05).toFixed(),
},
UniUSDCDAI: {
UniDAIUSDC: {
borrowRate: oneRay.multipliedBy(0.05).toFixed(),
},
UniCRVWETH: {
@ -141,8 +141,8 @@ export const CommonsConfig: ICommonConfiguration = {
LendingRateOracle: {
[eEthereumNetwork.coverage]: '',
[eEthereumNetwork.hardhat]: '',
[eEthereumNetwork.buidlerevm]: '',
[eEthereumNetwork.kovan]: '',//'0xdCde9Bb6a49e37fA433990832AB541AE2d4FEB4a', // Need to re-deploy because of onlyOwner
[eEthereumNetwork.buidlerevm]: '',// Updated to match Kovan deployment
[eEthereumNetwork.kovan]: '0xd00Bd28FAdDa9d5658D1D4e0c151973146C7A533',//'0xE48F95873855bfd97BF89572DDf5cBC44D9c545b'
[eEthereumNetwork.ropsten]: '0x05dcca805a6562c1bdd0423768754acb6993241b',
[eEthereumNetwork.main]: '', //'0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', // Need to re-deploy because of onlyOwner
[eEthereumNetwork.tenderlyMain]: '0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D',
@ -178,7 +178,7 @@ export const CommonsConfig: ICommonConfiguration = {
[eEthereumNetwork.coverage]: '',
[eEthereumNetwork.hardhat]: '',
[eEthereumNetwork.buidlerevm]: '',
[eEthereumNetwork.kovan]: '',
[eEthereumNetwork.kovan]: '0x1c4A1cC35A477aa1cF35DF671d93ACc04d8131E0',
[eEthereumNetwork.ropsten]: '',
[eEthereumNetwork.main]: '',
[eEthereumNetwork.tenderlyMain]: '',
@ -223,7 +223,7 @@ export const CommonsConfig: ICommonConfiguration = {
UniWBTCWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',
UniAAVEWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',
UniBATWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',
UniUSDCDAI: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',
UniDAIUSDC: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',
UniCRVWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',
UniLINKWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',
UniMKRWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',
@ -247,7 +247,7 @@ export const CommonsConfig: ICommonConfiguration = {
UniWBTCWETH: ZERO_ADDRESS,
UniAAVEWETH: ZERO_ADDRESS,
UniBATWETH: ZERO_ADDRESS,
UniUSDCDAI: ZERO_ADDRESS,
UniDAIUSDC: ZERO_ADDRESS,
UniCRVWETH: ZERO_ADDRESS,
UniLINKWETH: ZERO_ADDRESS,
UniMKRWETH: ZERO_ADDRESS,
@ -269,7 +269,7 @@ export const CommonsConfig: ICommonConfiguration = {
UniWBTCWETH: ZERO_ADDRESS,
UniAAVEWETH: ZERO_ADDRESS,
UniBATWETH: ZERO_ADDRESS,
UniUSDCDAI: ZERO_ADDRESS,
UniDAIUSDC: ZERO_ADDRESS,
UniCRVWETH: ZERO_ADDRESS,
UniLINKWETH: ZERO_ADDRESS,
UniMKRWETH: ZERO_ADDRESS,

View File

@ -1,5 +1,5 @@
import { oneRay, ZERO_ADDRESS } from '../../helpers/constants';
import { ILpConfiguration, eEthereumNetwork } from '../../helpers/types';
import { IAmmConfiguration, eEthereumNetwork } from '../../helpers/types';
import { CommonsConfig } from './commons';
import {
@ -12,7 +12,7 @@ import {
strategyDAIWETH,
strategyAAVEWETH,
strategyBATWETH,
strategyUSDCDAI,
strategyDAIUSDC,
strategyCRVWETH,
strategyLINKWETH,
strategyMKRWETH,
@ -28,9 +28,9 @@ import {
// POOL--SPECIFIC PARAMS
// ----------------
export const lpConfig: ILpConfiguration = {
export const AmmConfig: IAmmConfiguration = {
...CommonsConfig,
MarketId: 'Aave LP market',
MarketId: 'Aave AMM market',
ProviderId: 2,
ReservesConfig: {
WETH: strategyWETH,
@ -42,7 +42,7 @@ export const lpConfig: ILpConfiguration = {
UniWBTCWETH: strategyWBTCWETH,
UniAAVEWETH: strategyAAVEWETH,
UniBATWETH: strategyBATWETH,
UniUSDCDAI: strategyUSDCDAI,
UniDAIUSDC: strategyDAIUSDC,
UniCRVWETH: strategyCRVWETH,
UniLINKWETH: strategyLINKWETH,
UniMKRWETH: strategyMKRWETH,
@ -68,7 +68,7 @@ export const lpConfig: ILpConfiguration = {
UniWBTCWETH: '0x796d562B1dF5b9dc85A4612187B6f29Ed213d960',
UniAAVEWETH: '0x657A7B8b46F35C5C6583AEF43824744B236EF826',
UniBATWETH: '0xf8CEBA8b16579956B3aE4B5D09002a30f873F783',
UniUSDCDAI: '0x8e80b7a7531c276dD1dBEC2f1Cc281c11c859e62',
UniDAIUSDC: '0x8e80b7a7531c276dD1dBEC2f1Cc281c11c859e62',
UniCRVWETH: '0x9c31b7538467bF0b01e6d5fA789e66Ce540a521e',
UniLINKWETH: '0x5Acab7f8B79620ec7127A96E5D8837d2124D5D7c',
UniMKRWETH: '0xB0C6EC5d58ddbF4cd1e419A56a19924E9904e4Dd',
@ -92,7 +92,7 @@ export const lpConfig: ILpConfiguration = {
UniWBTCWETH: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940',
UniAAVEWETH: '0xDFC14d2Af169B0D36C4EFF567Ada9b2E0CAE044f',
UniBATWETH: '0xB6909B960DbbE7392D405429eB2b3649752b4838',
UniUSDCDAI: '0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5',
UniDAIUSDC: '0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5',
UniCRVWETH: '0x3dA1313aE46132A397D90d95B1424A9A7e3e0fCE',
UniLINKWETH: '0xa2107FA5B38d9bbd2C461D6EDf11B11A50F6b974',
UniMKRWETH: '0xC2aDdA861F89bBB333c90c492cB837741916A225',
@ -114,7 +114,7 @@ export const lpConfig: ILpConfiguration = {
UniWBTCWETH: '0xBb2b8038a1640196FbE3e38816F3e67Cba72D940',
UniAAVEWETH: '0xDFC14d2Af169B0D36C4EFF567Ada9b2E0CAE044f',
UniBATWETH: '0xB6909B960DbbE7392D405429eB2b3649752b4838',
UniUSDCDAI: '0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5',
UniDAIUSDC: '0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5',
UniCRVWETH: '0x3dA1313aE46132A397D90d95B1424A9A7e3e0fCE',
UniLINKWETH: '0xa2107FA5B38d9bbd2C461D6EDf11B11A50F6b974',
UniMKRWETH: '0xC2aDdA861F89bBB333c90c492cB837741916A225',
@ -129,4 +129,4 @@ export const lpConfig: ILpConfiguration = {
},
};
export default lpConfig;
export default AmmConfig;

View File

@ -2,9 +2,9 @@ import BigNumber from 'bignumber.js';
import { oneRay } from '../../helpers/constants';
import { IInterestRateStrategyParams } from '../../helpers/types';
// DAIWETH WBTCWETH AAVEWETH BATWETH USDCDAI CRVWETH LINKWETH MKRWETH RENWETH SNXWETH UNIWETH USDCWETH WBTCUSDC YFIWETH
export const rateStrategyLpBase: IInterestRateStrategyParams = {
name: "rateStrategyLpBase",
// DAIWETH WBTCWETH AAVEWETH BATWETH DAIUSDC CRVWETH LINKWETH MKRWETH RENWETH SNXWETH UNIWETH USDCWETH WBTCUSDC YFIWETH
export const rateStrategyAmmBase: IInterestRateStrategyParams = {
name: "rateStrategyAmmBase",
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),

View File

@ -1,6 +1,6 @@
import { eContractid, IReserveParams} from '../../helpers/types';
import {
rateStrategyLpBase,
rateStrategyAmmBase,
rateStrategyStable,
rateStrategyBaseOne,
} from './rateStrategies';
@ -67,7 +67,7 @@ export const strategyUSDT: IReserveParams = {
};
export const strategyDAIWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -79,7 +79,7 @@ export const strategyDAIWETH: IReserveParams = {
};
export const strategyWBTCWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -91,7 +91,7 @@ export const strategyWBTCWETH: IReserveParams = {
};
export const strategyAAVEWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -103,7 +103,7 @@ export const strategyAAVEWETH: IReserveParams = {
};
export const strategyBATWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -114,8 +114,8 @@ export const strategyBATWETH: IReserveParams = {
reserveFactor: '1500'
};
export const strategyUSDCDAI: IReserveParams = {
strategy: rateStrategyLpBase,
export const strategyDAIUSDC: IReserveParams = {
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -127,7 +127,7 @@ export const strategyUSDCDAI: IReserveParams = {
};
export const strategyCRVWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '5000',
liquidationThreshold: '6000',
liquidationBonus: '11500',
@ -139,7 +139,7 @@ export const strategyCRVWETH: IReserveParams = {
};
export const strategyLINKWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -151,7 +151,7 @@ export const strategyLINKWETH: IReserveParams = {
};
export const strategyMKRWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -163,7 +163,7 @@ export const strategyMKRWETH: IReserveParams = {
};
export const strategyRENWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -175,7 +175,7 @@ export const strategyRENWETH: IReserveParams = {
};
export const strategySNXWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '4000',
liquidationThreshold: '6000',
liquidationBonus: '11500',
@ -187,7 +187,7 @@ export const strategySNXWETH: IReserveParams = {
};
export const strategyUNIWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -199,7 +199,7 @@ export const strategyUNIWETH: IReserveParams = {
};
export const strategyUSDCWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -211,7 +211,7 @@ export const strategyUSDCWETH: IReserveParams = {
};
export const strategyWBTCUSDC: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '6000',
liquidationThreshold: '7000',
liquidationBonus: '11500',
@ -223,7 +223,7 @@ export const strategyWBTCUSDC: IReserveParams = {
};
export const strategyYFIWETH: IReserveParams = {
strategy: rateStrategyLpBase,
strategy: rateStrategyAmmBase,
baseLTVAsCollateral: '5000',
liquidationThreshold: '6000',
liquidationBonus: '11500',

View File

@ -68,11 +68,11 @@ export const CommonsConfig: ICommonConfiguration = {
},
LendingPool: {
[ePolygonNetwork.mumbai]: '',
[ePolygonNetwork.matic]: '0x15Ec48a46d2D26cf4ADf5A39123E4c75e6887fE0',
[ePolygonNetwork.matic]: '0xABdC61Cd16e5111f335f4135B7A0e65Cc7F86327',
},
LendingPoolConfigurator: {
[ePolygonNetwork.mumbai]: '',
[ePolygonNetwork.matic]: '0x268F48E09c72f6008DA50D6465a174C10167918e',
[ePolygonNetwork.matic]: '0x17c4A170FFF882862F656597889016D3a6073534',
},
EmergencyAdminIndex: 1,
ProviderRegistry: {
@ -89,7 +89,7 @@ export const CommonsConfig: ICommonConfiguration = {
},
LendingPoolCollateralManager: {
[ePolygonNetwork.mumbai]: '',
[ePolygonNetwork.matic]: '',
[ePolygonNetwork.matic]: '0x9Af76e0575D139570D3B4c821567Fe935E8c25C5',
},
TokenDistributor: {
[ePolygonNetwork.mumbai]: '',
@ -97,11 +97,11 @@ export const CommonsConfig: ICommonConfiguration = {
},
WethGateway: {
[ePolygonNetwork.mumbai]: '',
[ePolygonNetwork.matic]: '0x4fAfE6704a78e21Fc43C01bEb153607604F6768a',
[ePolygonNetwork.matic]: '0x15A46f5073789b7D16F6F46632aE50Bae838d938',
},
AaveOracle: {
[ePolygonNetwork.mumbai]: '',
[ePolygonNetwork.matic]: '',
[ePolygonNetwork.matic]: '0x1B38fa90596F2C25bCf1B193A6c6a718349AFDfC',
},
FallbackOracle: {
[ePolygonNetwork.mumbai]: ZERO_ADDRESS,

8
package-lock.json generated
View File

@ -27128,7 +27128,7 @@
"requires": {
"underscore": "1.9.1",
"web3-core-helpers": "1.2.1",
"websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis"
"websocket": "websocket@github:web3-js/WebSocket-Node#polyfill/globalThis"
}
},
"web3-shh": {
@ -39846,7 +39846,7 @@
"integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=",
"dev": true,
"requires": {
"ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git",
"ethereumjs-abi": "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git",
"ethereumjs-util": "^5.1.1"
}
},
@ -46846,7 +46846,7 @@
"eth-lib": "0.2.7",
"ethereumjs-common": "^1.3.2",
"ethereumjs-tx": "^2.1.1",
"scrypt-shim": "github:web3-js/scrypt-shim",
"scrypt-shim": "scrypt-shim@github:web3-js/scrypt-shim",
"underscore": "1.9.1",
"uuid": "3.3.2",
"web3-core": "1.2.2",
@ -47176,7 +47176,7 @@
"requires": {
"underscore": "1.9.1",
"web3-core-helpers": "1.2.2",
"websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis"
"websocket": "websocket@github:web3-js/WebSocket-Node#polyfill/globalThis"
}
},
"web3-shh": {

View File

@ -19,8 +19,8 @@
"compile": "SKIP_LOAD=true hardhat compile",
"console:fork": "MAINNET_FORK=true hardhat console",
"test": "TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-aave/*.spec.ts",
"test-lp": "TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-lp/*.spec.ts",
"test-lp-scenarios": "TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-lp/__setup.spec.ts test-suites/test-lp/scenario.spec.ts",
"test-amm": "TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-amm/*.spec.ts",
"test-amm-scenarios": "TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-amm/__setup.spec.ts test-suites/test-amm/scenario.spec.ts",
"test-scenarios": "npx hardhat test test-suites/test-aave/__setup.spec.ts test-suites/test-aave/scenario.spec.ts",
"test-repay-with-collateral": "hardhat test test-suites/test-aave/__setup.spec.ts test-suites/test-aave/repay-with-collateral.spec.ts",
"test-liquidate-with-collateral": "hardhat test test-suites/test-aave/__setup.spec.ts test-suites/test-aave/flash-liquidation-with-collateral.spec.ts",
@ -35,21 +35,21 @@
"test-stable-and-atokens": "hardhat test test-suites/test-aave/__setup.spec.ts test-suites/test-aave/atoken-transfer.spec.ts test-suites/test-aave/stable-token.spec.ts",
"test-subgraph:scenarios": "hardhat --network hardhatevm_docker test test-suites/test-aave/__setup.spec.ts test-suites/test-aave/subgraph-scenarios.spec.ts",
"test-weth:main": "hardhat test test-suites/test-aave/__setup.spec.ts test-suites/test-aave/weth-gateway.spec.ts",
"test-weth:lp": "hardhat test test-suites/test-lp/__setup.spec.ts test-suites/test-lp/weth-gateway.spec.ts",
"test-weth:amm": "hardhat test test-suites/test-amm/__setup.spec.ts test-suites/test-amm/weth-gateway.spec.ts",
"test-uniswap": "hardhat test test-suites/test-aave/__setup.spec.ts test-suites/test-aave/uniswapAdapters*.spec.ts",
"test:main:check-list": "MAINNET_FORK=true TS_NODE_TRANSPILE_ONLY=1 hardhat test test-suites/test-aave/__setup.spec.ts test-suites/test-aave/mainnet/check-list.spec.ts",
"dev:coverage": "buidler compile --force && buidler coverage --network coverage",
"aave:evm:dev:migration": "npm run compile && hardhat aave:dev",
"aave:docker:full:migration": "npm run compile && npm run hardhat:docker -- aave:mainnet",
"aave:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- aave:mainnet --verify",
"lp:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- lp:mainnet --verify",
"matic:mumbai:full:migration": "npm run compile && npm run hardhat:mumbai matic:mainnet",
"matic:matic:full:migration": "npm run compile && npm run hardhat:matic matic:mainnet",
"amm:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- amm:mainnet --verify",
"aave:kovan:full:initialize": "npm run hardhat:kovan -- full:initialize-lending-pool --verify --pool Aave",
"aave:ropsten:full:migration": "npm run compile && npm run hardhat:ropsten -- aave:mainnet --verify",
"aave:fork:main:tenderly": "npm run compile && npm run hardhat:tenderly-main -- aave:mainnet",
"aave:fork:main": "npm run compile && MAINNET_FORK=true hardhat aave:mainnet",
"lp:fork:main": "npm run compile && MAINNET_FORK=true hardhat lp:mainnet",
"amm:fork:main": "npm run compile && MAINNET_FORK=true hardhat amm:mainnet",
"aave:main:full:migration": "npm run compile && npm run hardhat:main -- aave:mainnet --verify",
"aave:main:full:initialize": "npm run compile && MAINNET_FORK=true full:initialize-tokens --pool Aave",
"prettier:check": "npx prettier -c 'tasks/**/*.ts' 'contracts/**/*.sol' 'helpers/**/*.ts' 'test-suites/test-aave/**/*.ts'",

View File

@ -4,10 +4,10 @@ import { ConfigNames } from '../../helpers/configuration';
import { printContracts } from '../../helpers/misc-utils';
import { usingTenderly } from '../../helpers/tenderly-utils';
task('lp:mainnet', 'Deploy development enviroment')
task('amm:mainnet', 'Deploy development enviroment')
.addFlag('verify', 'Verify contracts at Etherscan')
.setAction(async ({ verify }, DRE) => {
const POOL_NAME = ConfigNames.Lp;
const POOL_NAME = ConfigNames.Amm;
await DRE.run('set-DRE');
// Prevent loss of gas verifying all the needed ENVs for Etherscan verification

View File

@ -21,7 +21,7 @@ task('matic:mainnet', 'Deploy development enviroment')
await DRE.run('full:deploy-address-provider', { pool: POOL_NAME });
console.log('2. Deploy lending pool');
await DRE.run('full:deploy-lending-pool');
await DRE.run('full:deploy-lending-pool', { pool: POOL_NAME});
console.log('3. Deploy oracles');
await DRE.run('full:deploy-oracles', { pool: POOL_NAME });

View File

@ -28,6 +28,7 @@ import {
deployFlashLiquidationAdapter,
authorizeWETHGateway,
} from '../../helpers/contracts-deployments';
import { eEthereumNetwork } from '../../helpers/types';
import { Signer } from 'ethers';
import { TokenContractId, eContractid, tEthereumAddress, AavePools } from '../../helpers/types';
import { MintableERC20 } from '../../types/MintableERC20';
@ -175,7 +176,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
UniWBTCWETH: mockTokens.UniWBTCWETH.address,
UniAAVEWETH: mockTokens.UniAAVEWETH.address,
UniBATWETH: mockTokens.UniBATWETH.address,
UniUSDCDAI: mockTokens.UniUSDCDAI.address,
UniDAIUSDC: mockTokens.UniDAIUSDC.address,
UniCRVWETH: mockTokens.UniCRVWETH.address,
UniLINKWETH: mockTokens.UniLINKWETH.address,
UniMKRWETH: mockTokens.UniMKRWETH.address,

View File

@ -46,7 +46,7 @@ import {
} from '../../helpers/oracles-helpers';
import { DRE, waitForTx } from '../../helpers/misc-utils';
import { initReservesByHelper, configureReservesByHelper } from '../../helpers/init-helpers';
import LpConfig from '../../markets/lp';
import AmmConfig from '../../markets/amm';
import { ZERO_ADDRESS } from '../../helpers/constants';
import {
getLendingPool,
@ -55,16 +55,16 @@ import {
} from '../../helpers/contracts-getters';
import { WETH9Mocked } from '../../types/WETH9Mocked';
const MOCK_USD_PRICE_IN_WEI = LpConfig.ProtocolGlobalParams.MockUsdPriceInWei;
const ALL_ASSETS_INITIAL_PRICES = LpConfig.Mocks.AllAssetsInitialPrices;
const USD_ADDRESS = LpConfig.ProtocolGlobalParams.UsdAddress;
const MOCK_CHAINLINK_AGGREGATORS_PRICES = LpConfig.Mocks.AllAssetsInitialPrices;
const LENDING_RATE_ORACLE_RATES_COMMON = LpConfig.LendingRateOracleRatesCommon;
const MOCK_USD_PRICE_IN_WEI = AmmConfig.ProtocolGlobalParams.MockUsdPriceInWei;
const ALL_ASSETS_INITIAL_PRICES = AmmConfig.Mocks.AllAssetsInitialPrices;
const USD_ADDRESS = AmmConfig.ProtocolGlobalParams.UsdAddress;
const MOCK_CHAINLINK_AGGREGATORS_PRICES = AmmConfig.Mocks.AllAssetsInitialPrices;
const LENDING_RATE_ORACLE_RATES_COMMON = AmmConfig.LendingRateOracleRatesCommon;
const deployAllMockTokens = async (deployer: Signer) => {
const tokens: { [symbol: string]: MockContract | MintableERC20 | WETH9Mocked } = {};
const lpConfigData = getReservesConfigByPool(AavePools.lp);
const ammConfigData = getReservesConfigByPool(AavePools.amm);
for (const tokenSymbol of Object.keys(TokenContractId)) {
if (tokenSymbol === 'WETH') {
@ -74,7 +74,7 @@ const deployAllMockTokens = async (deployer: Signer) => {
}
let decimals = 18;
let configData = (<any>lpConfigData)[tokenSymbol];
let configData = (<any>ammConfigData)[tokenSymbol];
if (!configData) {
decimals = 18;
@ -97,7 +97,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
const mockTokens = await deployAllMockTokens(deployer);
const addressesProvider = await deployLendingPoolAddressesProvider(LpConfig.MarketId);
const addressesProvider = await deployLendingPoolAddressesProvider(AmmConfig.MarketId);
await waitForTx(await addressesProvider.setPoolAdmin(aaveAdmin));
//setting users[1] as emergency admin, which is in position 2 in the DRE addresses list
@ -175,7 +175,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
UniWBTCWETH: mockTokens.UniWBTCWETH.address,
UniAAVEWETH: mockTokens.UniAAVEWETH.address,
UniBATWETH: mockTokens.UniBATWETH.address,
UniUSDCDAI: mockTokens.UniUSDCDAI.address,
UniDAIUSDC: mockTokens.UniDAIUSDC.address,
UniCRVWETH: mockTokens.UniCRVWETH.address,
UniLINKWETH: mockTokens.UniLINKWETH.address,
UniMKRWETH: mockTokens.UniMKRWETH.address,
@ -229,7 +229,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
aaveAdmin
);
const reservesParams = getReservesConfigByPool(AavePools.lp);
const reservesParams = getReservesConfigByPool(AavePools.amm);
const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address);
@ -238,7 +238,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
console.log('Initialize configuration');
const config = loadPoolConfig(ConfigNames.Lp);
const config = loadPoolConfig(ConfigNames.Amm);
const {
ATokenNamePrefix,
@ -294,7 +294,7 @@ before(async () => {
const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
if (MAINNET_FORK) {
await rawBRE.run('lp:mainnet');
await rawBRE.run('amm:mainnet');
} else {
console.log('-> Deploying test environment...');
await buildTestEnv(deployer, secondaryWallet);

View File

@ -4,7 +4,7 @@ import { expect } from 'chai';
import { ethers } from 'ethers';
import { RateMode, ProtocolErrors } from '../../helpers/types';
import { makeSuite, TestEnv } from './helpers/make-suite';
import { CommonsConfig } from '../../markets/lp/commons';
import { CommonsConfig } from '../../markets/amm/commons';
const AAVE_REFERRAL = CommonsConfig.ProtocolGlobalParams.AaveReferral;

View File

@ -2,7 +2,7 @@ import { TestEnv, makeSuite } from './helpers/make-suite';
import { APPROVAL_AMOUNT_LENDING_POOL, RAY } from '../../helpers/constants';
import { convertToCurrencyDecimals } from '../../helpers/contracts-helpers';
import { ProtocolErrors } from '../../helpers/types';
import { strategyWETH } from '../../markets/lp/reservesConfigs';
import { strategyWETH } from '../../markets/amm/reservesConfigs';
const { expect } = require('chai');

View File

@ -20,7 +20,7 @@ import {
import { DelegationAwareATokenFactory } from '../../types';
import { DelegationAwareAToken } from '../../types/DelegationAwareAToken';
import { MintableDelegationERC20 } from '../../types/MintableDelegationERC20';
import LpConfig from '../../markets/lp';
import AmmConfig from '../../markets/amm';
const { parseEther } = ethers.utils;
@ -35,7 +35,7 @@ makeSuite('AToken: underlying delegation', (testEnv: TestEnv) => {
delegationERC20 = await deployMintableDelegationERC20(['DEL', 'DEL', '18']);
delegationAToken = await deployDelegationAwareAToken(
[pool.address, delegationERC20.address, await getTreasuryAddress(LpConfig), ZERO_ADDRESS, 'aDEL', 'aDEL'],
[pool.address, delegationERC20.address, await getTreasuryAddress(AmmConfig), ZERO_ADDRESS, 'aDEL', 'aDEL'],
false
);

View File

@ -36,7 +36,7 @@ import { getParamPerNetwork } from '../../../helpers/contracts-helpers';
import { WETH9Mocked } from '../../../types/WETH9Mocked';
import { WETHGateway } from '../../../types/WETHGateway';
import { solidity } from 'ethereum-waffle';
import { lpConfig } from '../../../markets/lp';
import { AmmConfig } from '../../../markets/amm';
import { FlashLiquidationAdapter } from '../../../types';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { usingTenderly } from '../../../helpers/tenderly-utils';
@ -118,7 +118,7 @@ export async function initializeMakeSuite() {
if (process.env.MAINNET_FORK === 'true') {
testEnv.registry = await getLendingPoolAddressesProviderRegistry(
getParamPerNetwork(lpConfig.ProviderRegistry, eEthereumNetwork.main)
getParamPerNetwork(AmmConfig.ProviderRegistry, eEthereumNetwork.main)
);
} else {
testEnv.registry = await getLendingPoolAddressesProviderRegistry();

View File

@ -7,7 +7,7 @@ import { makeSuite } from './helpers/make-suite';
import { ProtocolErrors, RateMode } from '../../helpers/types';
import { calcExpectedVariableDebtTokenBalance } from './helpers/utils/calculations';
import { getReserveData, getUserData } from './helpers/utils/helpers';
import { CommonsConfig } from '../../markets/lp/commons';
import { CommonsConfig } from '../../markets/amm/commons';
import { parseEther } from 'ethers/lib/utils';

View File

@ -8,7 +8,7 @@ import { getReservesConfigByPool } from '../../helpers/configuration';
import { AavePools, iLpPoolAssets, IReserveParams } from '../../helpers/types';
import { executeStory } from './helpers/scenario-engine';
const scenarioFolder = './test-suites/test-lp/helpers/scenarios/';
const scenarioFolder = './test-suites/test-amm/helpers/scenarios/';
const selectedScenarios: string[] = [];
@ -25,7 +25,7 @@ fs.readdirSync(scenarioFolder).forEach((file) => {
actionsConfiguration.skipIntegrityCheck = false; //set this to true to execute solidity-coverage
calculationsConfiguration.reservesParams = <iLpPoolAssets<IReserveParams>>(
getReservesConfigByPool(AavePools.lp)
getReservesConfigByPool(AavePools.amm)
);
});
after('Reset', () => {

View File

@ -19,7 +19,7 @@ makeSuite('Subgraph scenario tests', async (testEnv) => {
actionsConfiguration.skipIntegrityCheck = false; //set this to true to execute solidity-coverage
calculationsConfiguration.reservesParams = <iLpPoolAssets<IReserveParams>>(
getReservesConfigByPool(AavePools.lp)
getReservesConfigByPool(AavePools.amm)
);
});
after('Reset', () => {