diff --git a/helpers/configuration.ts b/helpers/configuration.ts index 39a404c0..618eec82 100644 --- a/helpers/configuration.ts +++ b/helpers/configuration.ts @@ -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 { - 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'*/) { diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index c9c64aec..d025b694 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -179,12 +179,12 @@ export const getParamPerNetwork = (param: iParamsPerNetwork, network: eNet } }; -export const getParamPerPool = ({ proto, lp }: iParamsPerPool, pool: AavePools) => { +export const getParamPerPool = ({ proto, amm }: iParamsPerPool, pool: AavePools) => { switch (pool) { case AavePools.proto: return proto; - case AavePools.lp: - return lp; + case AavePools.amm: + return amm; default: return proto; } diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index 08cc7b55..f0014347 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -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 diff --git a/helpers/types.ts b/helpers/types.ts index 39237440..a56e054b 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -36,8 +36,8 @@ export enum EthereumNetworkNames { export enum AavePools { proto = 'proto', - lp = 'lp', matic = 'matic', + amm = 'amm', } export enum eContractid { @@ -220,11 +220,6 @@ export interface iAssetBase { USD: T; REN: T; ENJ: T; - // LpWETH: T; - // LpWBTC: T; - // LpDAI: T; - // LpUSDC: T; - // LpUSDT: T; UniDAIWETH: T; UniWBTCWETH: T; UniAAVEWETH: T; @@ -334,11 +329,6 @@ 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', @@ -426,8 +416,8 @@ export interface iXDaiParamsPerNetwork { export interface iParamsPerPool { [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; } -export interface ILpConfiguration extends ICommonConfiguration { +export interface IAmmConfiguration extends ICommonConfiguration { ReservesConfig: iLpPoolAssets; } diff --git a/markets/lp/commons.ts b/markets/amm/commons.ts similarity index 100% rename from markets/lp/commons.ts rename to markets/amm/commons.ts diff --git a/markets/lp/index.ts b/markets/amm/index.ts similarity index 96% rename from markets/lp/index.ts rename to markets/amm/index.ts index aeb3bbc7..3cf69834 100644 --- a/markets/lp/index.ts +++ b/markets/amm/index.ts @@ -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 { @@ -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, @@ -129,4 +129,4 @@ export const lpConfig: ILpConfiguration = { }, }; -export default lpConfig; +export default AmmConfig; diff --git a/markets/lp/rateStrategies.ts b/markets/amm/rateStrategies.ts similarity index 94% rename from markets/lp/rateStrategies.ts rename to markets/amm/rateStrategies.ts index a91af2ea..26a68309 100644 --- a/markets/lp/rateStrategies.ts +++ b/markets/amm/rateStrategies.ts @@ -3,8 +3,8 @@ 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", +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(), diff --git a/markets/lp/reservesConfigs.ts b/markets/amm/reservesConfigs.ts similarity index 92% rename from markets/lp/reservesConfigs.ts rename to markets/amm/reservesConfigs.ts index 21db2a1e..31b1a13c 100644 --- a/markets/lp/reservesConfigs.ts +++ b/markets/amm/reservesConfigs.ts @@ -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', @@ -115,7 +115,7 @@ export const strategyBATWETH: IReserveParams = { }; export const strategyUSDCDAI: IReserveParams = { - strategy: rateStrategyLpBase, + 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', diff --git a/package-lock.json b/package-lock.json index 129f12e4..e0a68833 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { diff --git a/package.json b/package.json index cd067de1..5fd959fa 100644 --- a/package.json +++ b/package.json @@ -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'", diff --git a/tasks/full/2_lending_pool.ts b/tasks/full/2_lending_pool.ts index 5f92b8eb..7e1ba2cb 100644 --- a/tasks/full/2_lending_pool.ts +++ b/tasks/full/2_lending_pool.ts @@ -25,7 +25,7 @@ task('full:deploy-lending-pool', 'Deploy lending pool for dev enviroment') const network = DRE.network.name; const poolConfig = loadPoolConfig(pool); const addressesProvider = await getLendingPoolAddressesProvider(); - + const { LendingPool, LendingPoolConfigurator } = poolConfig; // Reuse/deploy lending pool implementation diff --git a/tasks/migrations/lp.mainnet.ts b/tasks/migrations/amm.mainnet.ts similarity index 95% rename from tasks/migrations/lp.mainnet.ts rename to tasks/migrations/amm.mainnet.ts index 97a47ffa..3d0e6c8b 100644 --- a/tasks/migrations/lp.mainnet.ts +++ b/tasks/migrations/amm.mainnet.ts @@ -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 diff --git a/test-suites/test-aave/__setup.spec.ts b/test-suites/test-aave/__setup.spec.ts index 79be455b..c9a54f7f 100644 --- a/test-suites/test-aave/__setup.spec.ts +++ b/test-suites/test-aave/__setup.spec.ts @@ -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'; diff --git a/test-suites/test-lp/__setup.spec.ts b/test-suites/test-amm/__setup.spec.ts similarity index 93% rename from test-suites/test-lp/__setup.spec.ts rename to test-suites/test-amm/__setup.spec.ts index d359b51e..2ce5ce85 100644 --- a/test-suites/test-lp/__setup.spec.ts +++ b/test-suites/test-amm/__setup.spec.ts @@ -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 = (lpConfigData)[tokenSymbol]; + let configData = (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 @@ -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); diff --git a/test-suites/test-lp/addresses-provider-registry.spec.ts b/test-suites/test-amm/addresses-provider-registry.spec.ts similarity index 100% rename from test-suites/test-lp/addresses-provider-registry.spec.ts rename to test-suites/test-amm/addresses-provider-registry.spec.ts diff --git a/test-suites/test-lp/atoken-modifiers.spec.ts b/test-suites/test-amm/atoken-modifiers.spec.ts similarity index 100% rename from test-suites/test-lp/atoken-modifiers.spec.ts rename to test-suites/test-amm/atoken-modifiers.spec.ts diff --git a/test-suites/test-lp/atoken-permit.spec.ts b/test-suites/test-amm/atoken-permit.spec.ts similarity index 100% rename from test-suites/test-lp/atoken-permit.spec.ts rename to test-suites/test-amm/atoken-permit.spec.ts diff --git a/test-suites/test-lp/atoken-transfer.spec.ts b/test-suites/test-amm/atoken-transfer.spec.ts similarity index 98% rename from test-suites/test-lp/atoken-transfer.spec.ts rename to test-suites/test-amm/atoken-transfer.spec.ts index 9d1b8359..0290f941 100644 --- a/test-suites/test-lp/atoken-transfer.spec.ts +++ b/test-suites/test-amm/atoken-transfer.spec.ts @@ -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; diff --git a/test-suites/test-lp/configurator.spec.ts b/test-suites/test-amm/configurator.spec.ts similarity index 99% rename from test-suites/test-lp/configurator.spec.ts rename to test-suites/test-amm/configurator.spec.ts index f4557791..e4e3f4fa 100644 --- a/test-suites/test-lp/configurator.spec.ts +++ b/test-suites/test-amm/configurator.spec.ts @@ -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'); diff --git a/test-suites/test-lp/delegation-aware-atoken.spec.ts b/test-suites/test-amm/delegation-aware-atoken.spec.ts similarity index 96% rename from test-suites/test-lp/delegation-aware-atoken.spec.ts rename to test-suites/test-amm/delegation-aware-atoken.spec.ts index aeaf4499..73ca6883 100644 --- a/test-suites/test-lp/delegation-aware-atoken.spec.ts +++ b/test-suites/test-amm/delegation-aware-atoken.spec.ts @@ -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 ); diff --git a/test-suites/test-lp/flashloan.spec.ts b/test-suites/test-amm/flashloan.spec.ts similarity index 100% rename from test-suites/test-lp/flashloan.spec.ts rename to test-suites/test-amm/flashloan.spec.ts diff --git a/test-suites/test-lp/helpers/actions.ts b/test-suites/test-amm/helpers/actions.ts similarity index 100% rename from test-suites/test-lp/helpers/actions.ts rename to test-suites/test-amm/helpers/actions.ts diff --git a/test-suites/test-lp/helpers/almost-equal.ts b/test-suites/test-amm/helpers/almost-equal.ts similarity index 100% rename from test-suites/test-lp/helpers/almost-equal.ts rename to test-suites/test-amm/helpers/almost-equal.ts diff --git a/test-suites/test-lp/helpers/make-suite.ts b/test-suites/test-amm/helpers/make-suite.ts similarity index 98% rename from test-suites/test-lp/helpers/make-suite.ts rename to test-suites/test-amm/helpers/make-suite.ts index c65f0df0..71d96bf5 100644 --- a/test-suites/test-lp/helpers/make-suite.ts +++ b/test-suites/test-amm/helpers/make-suite.ts @@ -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(); diff --git a/test-suites/test-lp/helpers/scenario-engine.ts b/test-suites/test-amm/helpers/scenario-engine.ts similarity index 100% rename from test-suites/test-lp/helpers/scenario-engine.ts rename to test-suites/test-amm/helpers/scenario-engine.ts diff --git a/test-suites/test-lp/helpers/scenarios/borrow-negatives.json b/test-suites/test-amm/helpers/scenarios/borrow-negatives.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/borrow-negatives.json rename to test-suites/test-amm/helpers/scenarios/borrow-negatives.json diff --git a/test-suites/test-lp/helpers/scenarios/borrow-repay-stable.json b/test-suites/test-amm/helpers/scenarios/borrow-repay-stable.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/borrow-repay-stable.json rename to test-suites/test-amm/helpers/scenarios/borrow-repay-stable.json diff --git a/test-suites/test-lp/helpers/scenarios/borrow-repay-variable.json b/test-suites/test-amm/helpers/scenarios/borrow-repay-variable.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/borrow-repay-variable.json rename to test-suites/test-amm/helpers/scenarios/borrow-repay-variable.json diff --git a/test-suites/test-lp/helpers/scenarios/credit-delegation.json b/test-suites/test-amm/helpers/scenarios/credit-delegation.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/credit-delegation.json rename to test-suites/test-amm/helpers/scenarios/credit-delegation.json diff --git a/test-suites/test-lp/helpers/scenarios/deposit.json b/test-suites/test-amm/helpers/scenarios/deposit.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/deposit.json rename to test-suites/test-amm/helpers/scenarios/deposit.json diff --git a/test-suites/test-lp/helpers/scenarios/rebalance-stable-rate.json b/test-suites/test-amm/helpers/scenarios/rebalance-stable-rate.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/rebalance-stable-rate.json rename to test-suites/test-amm/helpers/scenarios/rebalance-stable-rate.json diff --git a/test-suites/test-lp/helpers/scenarios/set-use-as-collateral.json b/test-suites/test-amm/helpers/scenarios/set-use-as-collateral.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/set-use-as-collateral.json rename to test-suites/test-amm/helpers/scenarios/set-use-as-collateral.json diff --git a/test-suites/test-lp/helpers/scenarios/swap-rate-mode.json b/test-suites/test-amm/helpers/scenarios/swap-rate-mode.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/swap-rate-mode.json rename to test-suites/test-amm/helpers/scenarios/swap-rate-mode.json diff --git a/test-suites/test-lp/helpers/scenarios/withdraw-negatives.json b/test-suites/test-amm/helpers/scenarios/withdraw-negatives.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/withdraw-negatives.json rename to test-suites/test-amm/helpers/scenarios/withdraw-negatives.json diff --git a/test-suites/test-lp/helpers/scenarios/withdraw.json b/test-suites/test-amm/helpers/scenarios/withdraw.json similarity index 100% rename from test-suites/test-lp/helpers/scenarios/withdraw.json rename to test-suites/test-amm/helpers/scenarios/withdraw.json diff --git a/test-suites/test-lp/helpers/utils/calculations.ts b/test-suites/test-amm/helpers/utils/calculations.ts similarity index 100% rename from test-suites/test-lp/helpers/utils/calculations.ts rename to test-suites/test-amm/helpers/utils/calculations.ts diff --git a/test-suites/test-lp/helpers/utils/helpers.ts b/test-suites/test-amm/helpers/utils/helpers.ts similarity index 100% rename from test-suites/test-lp/helpers/utils/helpers.ts rename to test-suites/test-amm/helpers/utils/helpers.ts diff --git a/test-suites/test-lp/helpers/utils/interfaces/index.ts b/test-suites/test-amm/helpers/utils/interfaces/index.ts similarity index 100% rename from test-suites/test-lp/helpers/utils/interfaces/index.ts rename to test-suites/test-amm/helpers/utils/interfaces/index.ts diff --git a/test-suites/test-lp/helpers/utils/math.ts b/test-suites/test-amm/helpers/utils/math.ts similarity index 100% rename from test-suites/test-lp/helpers/utils/math.ts rename to test-suites/test-amm/helpers/utils/math.ts diff --git a/test-suites/test-lp/lending-pool-addresses-provider.spec.ts b/test-suites/test-amm/lending-pool-addresses-provider.spec.ts similarity index 100% rename from test-suites/test-lp/lending-pool-addresses-provider.spec.ts rename to test-suites/test-amm/lending-pool-addresses-provider.spec.ts diff --git a/test-suites/test-lp/liquidation-atoken.spec.ts b/test-suites/test-amm/liquidation-atoken.spec.ts similarity index 100% rename from test-suites/test-lp/liquidation-atoken.spec.ts rename to test-suites/test-amm/liquidation-atoken.spec.ts diff --git a/test-suites/test-lp/liquidation-underlying.spec.ts b/test-suites/test-amm/liquidation-underlying.spec.ts similarity index 99% rename from test-suites/test-lp/liquidation-underlying.spec.ts rename to test-suites/test-amm/liquidation-underlying.spec.ts index 7bc78dad..e44a2d80 100644 --- a/test-suites/test-lp/liquidation-underlying.spec.ts +++ b/test-suites/test-amm/liquidation-underlying.spec.ts @@ -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'; diff --git a/test-suites/test-lp/mainnet/check-list.spec.ts b/test-suites/test-amm/mainnet/check-list.spec.ts similarity index 100% rename from test-suites/test-lp/mainnet/check-list.spec.ts rename to test-suites/test-amm/mainnet/check-list.spec.ts diff --git a/test-suites/test-lp/pausable-functions.spec.ts b/test-suites/test-amm/pausable-functions.spec.ts similarity index 100% rename from test-suites/test-lp/pausable-functions.spec.ts rename to test-suites/test-amm/pausable-functions.spec.ts diff --git a/test-suites/test-lp/pool-modifiers.spec.ts b/test-suites/test-amm/pool-modifiers.spec.ts similarity index 100% rename from test-suites/test-lp/pool-modifiers.spec.ts rename to test-suites/test-amm/pool-modifiers.spec.ts diff --git a/test-suites/test-lp/rate-strategy.spec.ts b/test-suites/test-amm/rate-strategy.spec.ts similarity index 100% rename from test-suites/test-lp/rate-strategy.spec.ts rename to test-suites/test-amm/rate-strategy.spec.ts diff --git a/test-suites/test-lp/scenario.spec.ts b/test-suites/test-amm/scenario.spec.ts similarity index 93% rename from test-suites/test-lp/scenario.spec.ts rename to test-suites/test-amm/scenario.spec.ts index 99bed044..f9c4d78b 100644 --- a/test-suites/test-lp/scenario.spec.ts +++ b/test-suites/test-amm/scenario.spec.ts @@ -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 = >( - getReservesConfigByPool(AavePools.lp) + getReservesConfigByPool(AavePools.amm) ); }); after('Reset', () => { diff --git a/test-suites/test-lp/stable-rate-economy.spec.ts b/test-suites/test-amm/stable-rate-economy.spec.ts similarity index 100% rename from test-suites/test-lp/stable-rate-economy.spec.ts rename to test-suites/test-amm/stable-rate-economy.spec.ts diff --git a/test-suites/test-lp/stable-token.spec.ts b/test-suites/test-amm/stable-token.spec.ts similarity index 100% rename from test-suites/test-lp/stable-token.spec.ts rename to test-suites/test-amm/stable-token.spec.ts diff --git a/test-suites/test-lp/subgraph-scenarios.spec.ts b/test-suites/test-amm/subgraph-scenarios.spec.ts similarity index 96% rename from test-suites/test-lp/subgraph-scenarios.spec.ts rename to test-suites/test-amm/subgraph-scenarios.spec.ts index 24e119f1..a622eb34 100644 --- a/test-suites/test-lp/subgraph-scenarios.spec.ts +++ b/test-suites/test-amm/subgraph-scenarios.spec.ts @@ -19,7 +19,7 @@ makeSuite('Subgraph scenario tests', async (testEnv) => { actionsConfiguration.skipIntegrityCheck = false; //set this to true to execute solidity-coverage calculationsConfiguration.reservesParams = >( - getReservesConfigByPool(AavePools.lp) + getReservesConfigByPool(AavePools.amm) ); }); after('Reset', () => { diff --git a/test-suites/test-lp/uniswapAdapters.base.spec.ts b/test-suites/test-amm/uniswapAdapters.base.spec.ts similarity index 100% rename from test-suites/test-lp/uniswapAdapters.base.spec.ts rename to test-suites/test-amm/uniswapAdapters.base.spec.ts diff --git a/test-suites/test-lp/uniswapAdapters.flashLiquidation.spec.ts b/test-suites/test-amm/uniswapAdapters.flashLiquidation.spec.ts similarity index 100% rename from test-suites/test-lp/uniswapAdapters.flashLiquidation.spec.ts rename to test-suites/test-amm/uniswapAdapters.flashLiquidation.spec.ts diff --git a/test-suites/test-lp/uniswapAdapters.liquiditySwap.spec.ts b/test-suites/test-amm/uniswapAdapters.liquiditySwap.spec.ts similarity index 100% rename from test-suites/test-lp/uniswapAdapters.liquiditySwap.spec.ts rename to test-suites/test-amm/uniswapAdapters.liquiditySwap.spec.ts diff --git a/test-suites/test-lp/uniswapAdapters.repay.spec.ts b/test-suites/test-amm/uniswapAdapters.repay.spec.ts similarity index 100% rename from test-suites/test-lp/uniswapAdapters.repay.spec.ts rename to test-suites/test-amm/uniswapAdapters.repay.spec.ts diff --git a/test-suites/test-lp/upgradeability.spec.ts b/test-suites/test-amm/upgradeability.spec.ts similarity index 100% rename from test-suites/test-lp/upgradeability.spec.ts rename to test-suites/test-amm/upgradeability.spec.ts diff --git a/test-suites/test-lp/variable-debt-token.spec.ts b/test-suites/test-amm/variable-debt-token.spec.ts similarity index 100% rename from test-suites/test-lp/variable-debt-token.spec.ts rename to test-suites/test-amm/variable-debt-token.spec.ts diff --git a/test-suites/test-lp/weth-gateway.spec.ts b/test-suites/test-amm/weth-gateway.spec.ts similarity index 100% rename from test-suites/test-lp/weth-gateway.spec.ts rename to test-suites/test-amm/weth-gateway.spec.ts