Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ENS configs #278

Open
wants to merge 1 commit into
base: aave-v2-asset-listing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/protocol/tokenization/AToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion contracts/protocol/tokenization/VariableDebtToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export interface iAssetBase<T> {
REN: T;
ENJ: T;
xSUSHI: T;
ENS: T;
}

export type iAssetsWithoutETH<T> = Omit<iAssetBase<T>, 'ETH'>;
Expand Down Expand Up @@ -234,6 +235,7 @@ export type iAavePoolAssets<T> = Pick<
| 'REN'
| 'ENJ'
| 'xSUSHI'
| 'ENS'
>;

export type iMultiPoolsAssets<T> = iAssetCommon<T> | iAavePoolAssets<T>;
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions markets/aave/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
// ----------------
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions markets/aave/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
strategyWETH,
strategyYFI,
strategyXSUSHI,
strategyENS
} from './reservesConfigs';

// ----------------
Expand Down Expand Up @@ -55,6 +56,7 @@ export const AaveConfig: IAaveConfiguration = {
YFI: strategyYFI,
ZRX: strategyZRX,
xSUSHI: strategyXSUSHI,
ENS: strategyENS
},
ReserveAssets: {
[eEthereumNetwork.buidlerevm]: {},
Expand All @@ -81,6 +83,7 @@ export const AaveConfig: IAaveConfiguration = {
WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
YFI: '0xb7c325266ec274fEb1354021D27FA3E3379D840d',
ZRX: '0xD0d76886cF8D952ca26177EB7CfDf83bad08C00C',
ENS: '0x907A5Ed08b0D4da521A8907F8Ef773BB7ab85112'
},
[EthereumNetwork.ropsten]: {
AAVE: '',
Expand All @@ -103,6 +106,7 @@ export const AaveConfig: IAaveConfiguration = {
WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
YFI: ZERO_ADDRESS,
ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959',
ENS: ZERO_ADDRESS
},
[EthereumNetwork.main]: {
AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9',
Expand All @@ -126,6 +130,7 @@ export const AaveConfig: IAaveConfiguration = {
YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
ZRX: '0xE41d2489571d322189246DaFA5ebDe1F4699F498',
xSUSHI: '0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272',
ENS: '0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72'
},
[EthereumNetwork.tenderlyMain]: {
AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9',
Expand All @@ -149,6 +154,7 @@ export const AaveConfig: IAaveConfiguration = {
YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
ZRX: '0xE41d2489571d322189246DaFA5ebDe1F4699F498',
xSUSHI: '0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272',
ENS: '0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72'
},
},
};
Expand Down
17 changes: 17 additions & 0 deletions markets/aave/reservesConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};