mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
fix: finalized configuration of AAVE in Aave pro
This commit is contained in:
parent
e74386aa69
commit
cb804585a6
|
@ -202,6 +202,7 @@ export const deployLendingPool = async (verify?: boolean, lendingPoolImpl?: eCon
|
||||||
default:
|
default:
|
||||||
instance = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy();
|
instance = await new LendingPoolFactory(libraries, await getFirstSigner()).deploy();
|
||||||
}
|
}
|
||||||
|
await instance.deployTransaction.wait();
|
||||||
|
|
||||||
await insertContractAddressInDb(eContractid.LendingPoolImpl, instance.address);
|
await insertContractAddressInDb(eContractid.LendingPoolImpl, instance.address);
|
||||||
return withSaveAndVerify(instance, eContractid.LendingPool, [], verify);
|
return withSaveAndVerify(instance, eContractid.LendingPool, [], verify);
|
||||||
|
@ -367,15 +368,13 @@ export const deployStableDebtTokenByType = async (type: string) => {
|
||||||
return deployGenericStableDebtToken();
|
return deployGenericStableDebtToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Deploying instance of ", type);
|
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case eContractid.StableDebtToken:
|
case eContractid.StableDebtToken:
|
||||||
return deployGenericStableDebtToken();
|
return deployGenericStableDebtToken();
|
||||||
case eContractid.PermissionedStableDebtToken:
|
case eContractid.PermissionedStableDebtToken:
|
||||||
return deployPermissionedStableDebtToken();
|
return deployPermissionedStableDebtToken();
|
||||||
default:
|
default:
|
||||||
console.log("[stable]Cant find token type ", type);
|
console.log("Cant find the debt token type ", type);
|
||||||
throw "Invalid debt token type";
|
throw "Invalid debt token type";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,7 +276,7 @@ export type iAavePoolAssets<T> = Pick<
|
||||||
|
|
||||||
export type iAaveProPoolAssets<T> = Pick<
|
export type iAaveProPoolAssets<T> = Pick<
|
||||||
iAssetsWithoutUSD<T>,
|
iAssetsWithoutUSD<T>,
|
||||||
'USDC' | 'USDT' | 'WBTC' | 'WETH'
|
'USDC' | 'WBTC' | 'WETH' | 'AAVE'
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export type iLpPoolAssets<T> = Pick<
|
export type iLpPoolAssets<T> = Pick<
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { IAaveProConfiguration, eEthereumNetwork, eContractid } from '../../help
|
||||||
|
|
||||||
import { CommonsConfig } from './commons';
|
import { CommonsConfig } from './commons';
|
||||||
import {
|
import {
|
||||||
|
strategyAAVE,
|
||||||
strategyUSDC,
|
strategyUSDC,
|
||||||
strategyUSDT,
|
|
||||||
strategyWBTC,
|
strategyWBTC,
|
||||||
strategyWETH,
|
strategyWETH,
|
||||||
} from './reservesConfigs';
|
} from './reservesConfigs';
|
||||||
|
@ -20,9 +20,9 @@ export const AaveConfig: IAaveProConfiguration = {
|
||||||
LendingPoolImpl: eContractid.PermissionedLendingPool,
|
LendingPoolImpl: eContractid.PermissionedLendingPool,
|
||||||
ReservesConfig: {
|
ReservesConfig: {
|
||||||
USDC: strategyUSDC,
|
USDC: strategyUSDC,
|
||||||
USDT: strategyUSDT,
|
|
||||||
WBTC: strategyWBTC,
|
WBTC: strategyWBTC,
|
||||||
WETH: strategyWETH,
|
WETH: strategyWETH,
|
||||||
|
AAVE: strategyAAVE
|
||||||
},
|
},
|
||||||
ReserveAssets: {
|
ReserveAssets: {
|
||||||
[eEthereumNetwork.buidlerevm]: {},
|
[eEthereumNetwork.buidlerevm]: {},
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { oneRay } from '../../helpers/constants';
|
||||||
import { IInterestRateStrategyParams } from '../../helpers/types';
|
import { IInterestRateStrategyParams } from '../../helpers/types';
|
||||||
|
|
||||||
|
|
||||||
// USDC USDT
|
// USDC
|
||||||
export const rateStrategyStable: IInterestRateStrategyParams = {
|
export const rateStrategyStable: IInterestRateStrategyParams = {
|
||||||
name: "rateStrategyStable",
|
name: "rateStrategyStable",
|
||||||
optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(),
|
optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(),
|
||||||
|
@ -14,6 +14,17 @@ export const rateStrategyStable: IInterestRateStrategyParams = {
|
||||||
stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(),
|
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
|
// WETH
|
||||||
export const rateStrategyWETH: IInterestRateStrategyParams = {
|
export const rateStrategyWETH: IInterestRateStrategyParams = {
|
||||||
name: "rateStrategyWETH",
|
name: "rateStrategyWETH",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { eContractid, IReserveParams } from '../../helpers/types';
|
import { eContractid, IReserveParams } from '../../helpers/types';
|
||||||
|
|
||||||
import { rateStrategyStable, rateStrategyWETH, rateStrategyWBTC } from './rateStrategies';
|
import { rateStrategyStable, rateStrategyWETH, rateStrategyWBTC, rateStrategyAAVE } from './rateStrategies';
|
||||||
|
|
||||||
export const strategyUSDC: IReserveParams = {
|
export const strategyUSDC: IReserveParams = {
|
||||||
strategy: rateStrategyStable,
|
strategy: rateStrategyStable,
|
||||||
|
@ -16,18 +16,18 @@ export const strategyUSDC: IReserveParams = {
|
||||||
reserveFactor: '1000',
|
reserveFactor: '1000',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyUSDT: IReserveParams = {
|
export const strategyAAVE: IReserveParams = {
|
||||||
strategy: rateStrategyStable,
|
strategy: rateStrategyAAVE,
|
||||||
baseLTVAsCollateral: '8000',
|
baseLTVAsCollateral: '5000',
|
||||||
liquidationThreshold: '8500',
|
liquidationThreshold: '6500',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '11000',
|
||||||
borrowingEnabled: true,
|
borrowingEnabled: false,
|
||||||
stableBorrowRateEnabled: true,
|
stableBorrowRateEnabled: false,
|
||||||
reserveDecimals: '6',
|
reserveDecimals: '18',
|
||||||
aTokenImpl: eContractid.AToken,
|
aTokenImpl: eContractid.AToken,
|
||||||
stableDebtTokenImpl: eContractid.PermissionedStableDebtToken,
|
stableDebtTokenImpl: eContractid.PermissionedStableDebtToken,
|
||||||
variableDebtTokenImpl: eContractid.PermissionedVariableDebtToken,
|
variableDebtTokenImpl: eContractid.PermissionedVariableDebtToken,
|
||||||
reserveFactor: '1000',
|
reserveFactor: '0'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyWETH: IReserveParams = {
|
export const strategyWETH: IReserveParams = {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
import { HardhatRuntimeEnvironment } from 'hardhat/types';
|
import { HardhatRuntimeEnvironment } from 'hardhat/types';
|
||||||
import { loadPoolConfig, ConfigNames } from '../../helpers/configuration';
|
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')
|
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||||
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
|
.addParam('pool', `Pool name to retrieve configuration, supported: ${Object.values(ConfigNames)}`)
|
||||||
.setAction(async ({ verify, pool }, DRE: HardhatRuntimeEnvironment) => {
|
.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...');
|
console.log('\tDeploying new lending pool implementation & libraries...');
|
||||||
const lendingPoolImpl = await deployLendingPool(verify, poolConfig.LendingPoolImpl);
|
const lendingPoolImpl = await deployLendingPool(verify, poolConfig.LendingPoolImpl);
|
||||||
lendingPoolImplAddress = lendingPoolImpl.address;
|
lendingPoolImplAddress = lendingPoolImpl.address;
|
||||||
await lendingPoolImpl.initialize(addressesProvider.address);
|
await waitForTx(await lendingPoolImpl.initialize(addressesProvider.address));
|
||||||
}
|
}
|
||||||
console.log('\tSetting lending pool implementation with address:', lendingPoolImplAddress);
|
console.log('\tSetting lending pool implementation with address:', lendingPoolImplAddress);
|
||||||
// Set lending pool impl to Address provider
|
// Set lending pool impl to Address provider
|
||||||
|
|
Loading…
Reference in New Issue
Block a user