fix: finalized configuration of AAVE in Aave pro

This commit is contained in:
The3D 2021-05-18 12:38:17 +02:00
parent e74386aa69
commit cb804585a6
6 changed files with 30 additions and 20 deletions

View File

@ -202,6 +202,7 @@ export const deployLendingPool = async (verify?: boolean, lendingPoolImpl?: eCon
default:
instance = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy();
}
await instance.deployTransaction.wait();
await insertContractAddressInDb(eContractid.LendingPoolImpl, instance.address);
return withSaveAndVerify(instance, eContractid.LendingPool, [], verify);
@ -367,15 +368,13 @@ export const deployStableDebtTokenByType = async (type: string) => {
return deployGenericStableDebtToken();
}
console.log("Deploying instance of ", type);
switch(type) {
case eContractid.StableDebtToken:
return deployGenericStableDebtToken();
case eContractid.PermissionedStableDebtToken:
return deployPermissionedStableDebtToken();
default:
console.log("[stable]Cant find token type ", type);
console.log("Cant find the debt token type ", type);
throw "Invalid debt token type";
}
}
@ -415,7 +414,7 @@ export const deployPermissionedVariableDebtToken = async () =>
false
);
export const deployGenericStableDebtToken = async () =>
export const deployGenericStableDebtToken = async () =>
withSaveAndVerify(
await new StableDebtTokenFactory(await getFirstSigner()).deploy(),
eContractid.StableDebtToken,

View File

@ -276,7 +276,7 @@ export type iAavePoolAssets<T> = Pick<
export type iAaveProPoolAssets<T> = Pick<
iAssetsWithoutUSD<T>,
'USDC' | 'USDT' | 'WBTC' | 'WETH'
'USDC' | 'WBTC' | 'WETH' | 'AAVE'
>;
export type iLpPoolAssets<T> = Pick<

View File

@ -3,8 +3,8 @@ import { IAaveProConfiguration, eEthereumNetwork, eContractid } from '../../help
import { CommonsConfig } from './commons';
import {
strategyAAVE,
strategyUSDC,
strategyUSDT,
strategyWBTC,
strategyWETH,
} from './reservesConfigs';
@ -20,9 +20,9 @@ export const AaveConfig: IAaveProConfiguration = {
LendingPoolImpl: eContractid.PermissionedLendingPool,
ReservesConfig: {
USDC: strategyUSDC,
USDT: strategyUSDT,
WBTC: strategyWBTC,
WETH: strategyWETH,
AAVE: strategyAAVE
},
ReserveAssets: {
[eEthereumNetwork.buidlerevm]: {},

View File

@ -3,7 +3,7 @@ import { oneRay } from '../../helpers/constants';
import { IInterestRateStrategyParams } from '../../helpers/types';
// USDC USDT
// USDC
export const rateStrategyStable: IInterestRateStrategyParams = {
name: "rateStrategyStable",
optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(),
@ -14,6 +14,17 @@ export const rateStrategyStable: IInterestRateStrategyParams = {
stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(),
}
// AAVE
export const rateStrategyAAVE: IInterestRateStrategyParams = {
name: "rateStrategyAAVE",
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
baseVariableBorrowRate: '0',
variableRateSlope1: '0',
variableRateSlope2: '0',
stableRateSlope1: '0',
stableRateSlope2: '0',
}
// WETH
export const rateStrategyWETH: IInterestRateStrategyParams = {
name: "rateStrategyWETH",

View File

@ -1,6 +1,6 @@
import { eContractid, IReserveParams } from '../../helpers/types';
import { rateStrategyStable, rateStrategyWETH, rateStrategyWBTC } from './rateStrategies';
import { rateStrategyStable, rateStrategyWETH, rateStrategyWBTC, rateStrategyAAVE } from './rateStrategies';
export const strategyUSDC: IReserveParams = {
strategy: rateStrategyStable,
@ -16,18 +16,18 @@ export const strategyUSDC: IReserveParams = {
reserveFactor: '1000',
};
export const strategyUSDT: IReserveParams = {
strategy: rateStrategyStable,
baseLTVAsCollateral: '8000',
liquidationThreshold: '8500',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
reserveDecimals: '6',
export const strategyAAVE: IReserveParams = {
strategy: rateStrategyAAVE,
baseLTVAsCollateral: '5000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
reserveDecimals: '18',
aTokenImpl: eContractid.AToken,
stableDebtTokenImpl: eContractid.PermissionedStableDebtToken,
variableDebtTokenImpl: eContractid.PermissionedVariableDebtToken,
reserveFactor: '1000',
reserveFactor: '0'
};
export const strategyWETH: IReserveParams = {

View File

@ -16,7 +16,7 @@ import {
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { loadPoolConfig, ConfigNames } from '../../helpers/configuration';
task('full:deploy-lending-pool', 'Deploy lending pool for dev enviroment')
task('full:deploy-lending-pool', 'Deploy lending pool for dev environment')
.addFlag('verify', 'Verify contracts at Etherscan')
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
.setAction(async ({ verify, pool }, DRE: HardhatRuntimeEnvironment) => {
@ -34,7 +34,7 @@ task('full:deploy-lending-pool', 'Deploy lending pool for dev enviroment')
console.log('\tDeploying new lending pool implementation & libraries...');
const lendingPoolImpl = await deployLendingPool(verify, poolConfig.LendingPoolImpl);
lendingPoolImplAddress = lendingPoolImpl.address;
await lendingPoolImpl.initialize(addressesProvider.address);
await waitForTx(await lendingPoolImpl.initialize(addressesProvider.address));
}
console.log('\tSetting lending pool implementation with address:', lendingPoolImplAddress);
// Set lending pool impl to Address provider