From 38e2a984f22238a43d2965aa0cc7402902fa61ab Mon Sep 17 00:00:00 2001 From: eboadom Date: Mon, 28 Feb 2022 17:49:24 +0100 Subject: [PATCH] Add ENS configs --- contracts/protocol/tokenization/AToken.sol | 2 +- .../protocol/tokenization/VariableDebtToken.sol | 2 +- helpers/types.ts | 5 ++++- markets/aave/commons.ts | 4 ++++ markets/aave/index.ts | 6 ++++++ markets/aave/reservesConfigs.ts | 17 +++++++++++++++++ 6 files changed, 33 insertions(+), 3 deletions(-) diff --git a/contracts/protocol/tokenization/AToken.sol b/contracts/protocol/tokenization/AToken.sol index 545d68b18..79ebec6b6 100644 --- a/contracts/protocol/tokenization/AToken.sol +++ b/contracts/protocol/tokenization/AToken.sol @@ -27,7 +27,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)'); uint256 public constant UINT_MAX_VALUE = uint256(-1); - uint256 public constant ATOKEN_REVISION = 0x2; + uint256 public constant ATOKEN_REVISION = 0x1; address public immutable UNDERLYING_ASSET_ADDRESS; address public immutable RESERVE_TREASURY_ADDRESS; ILendingPool public immutable POOL; diff --git a/contracts/protocol/tokenization/VariableDebtToken.sol b/contracts/protocol/tokenization/VariableDebtToken.sol index 368cd1fff..1fcb7f5b1 100644 --- a/contracts/protocol/tokenization/VariableDebtToken.sol +++ b/contracts/protocol/tokenization/VariableDebtToken.sol @@ -16,7 +16,7 @@ import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesControl contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { using WadRayMath for uint256; - uint256 public constant DEBT_TOKEN_REVISION = 0x2; + uint256 public constant DEBT_TOKEN_REVISION = 0x1; constructor( address pool, diff --git a/helpers/types.ts b/helpers/types.ts index 4ea1ab06f..40a7c215c 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -205,6 +205,7 @@ export interface iAssetBase { REN: T; ENJ: T; xSUSHI: T; + ENS: T; } export type iAssetsWithoutETH = Omit, 'ETH'>; @@ -234,6 +235,7 @@ export type iAavePoolAssets = Pick< | 'REN' | 'ENJ' | 'xSUSHI' + | 'ENS' >; export type iMultiPoolsAssets = iAssetCommon | iAavePoolAssets; @@ -264,7 +266,8 @@ export enum TokenContractId { YFI = 'YFI', UNI = 'UNI', ENJ = 'ENJ', - xSUSHI = 'xSUSHI' + xSUSHI = 'xSUSHI', + ENS = 'ENS' } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index 6833e67f2..101a3fc48 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -24,6 +24,7 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { YFI: oneEther.multipliedBy('22.407436').toFixed(), ZRX: oneEther.multipliedBy('0.001151').toFixed(), xSUSHI: oneEther.multipliedBy('0.00913428586').toFixed(), + ENS: oneEther.multipliedBy('0.00731413').toFixed(), USD: '5848466240000000', }; // ---------------- @@ -110,6 +111,9 @@ export const CommonsConfig: ICommonConfiguration = { BUSD: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, + ENS: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, }, // ---------------- // COMMON PROTOCOL ADDRESSES ACROSS POOLS diff --git a/markets/aave/index.ts b/markets/aave/index.ts index d60db80fd..86d6f70e6 100644 --- a/markets/aave/index.ts +++ b/markets/aave/index.ts @@ -23,6 +23,7 @@ import { strategyWETH, strategyYFI, strategyXSUSHI, + strategyENS } from './reservesConfigs'; // ---------------- @@ -55,6 +56,7 @@ export const AaveConfig: IAaveConfiguration = { YFI: strategyYFI, ZRX: strategyZRX, xSUSHI: strategyXSUSHI, + ENS: strategyENS }, ReserveAssets: { [eEthereumNetwork.buidlerevm]: {}, @@ -81,6 +83,7 @@ export const AaveConfig: IAaveConfiguration = { WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', YFI: '0xb7c325266ec274fEb1354021D27FA3E3379D840d', ZRX: '0xD0d76886cF8D952ca26177EB7CfDf83bad08C00C', + ENS: '0x907A5Ed08b0D4da521A8907F8Ef773BB7ab85112' }, [EthereumNetwork.ropsten]: { AAVE: '', @@ -103,6 +106,7 @@ export const AaveConfig: IAaveConfiguration = { WETH: '0xc778417e063141139fce010982780140aa0cd5ab', YFI: ZERO_ADDRESS, ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959', + ENS: ZERO_ADDRESS }, [EthereumNetwork.main]: { AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', @@ -126,6 +130,7 @@ export const AaveConfig: IAaveConfiguration = { YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', ZRX: '0xE41d2489571d322189246DaFA5ebDe1F4699F498', xSUSHI: '0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272', + ENS: '0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72' }, [EthereumNetwork.tenderlyMain]: { AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', @@ -149,6 +154,7 @@ export const AaveConfig: IAaveConfiguration = { YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', ZRX: '0xE41d2489571d322189246DaFA5ebDe1F4699F498', xSUSHI: '0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272', + ENS: '0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72' }, }, }; diff --git a/markets/aave/reservesConfigs.ts b/markets/aave/reservesConfigs.ts index 30f094ace..496d7cff5 100644 --- a/markets/aave/reservesConfigs.ts +++ b/markets/aave/reservesConfigs.ts @@ -357,4 +357,21 @@ export const strategyXSUSHI: IReserveParams = { reserveDecimals: '18', aTokenImpl: eContractid.AToken, reserveFactor: '3500', +}; + +export const strategyENS: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: '0', + variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(), + stableRateSlope1: '0', + stableRateSlope2: '0', + baseLTVAsCollateral: '5000', + liquidationThreshold: '6000', + liquidationBonus: '10800', + borrowingEnabled: true, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.DelegationAwareAToken, + reserveFactor: '2000', }; \ No newline at end of file