From ff1bbe4687ba9d31f0a341421c43b255c6fe85d5 Mon Sep 17 00:00:00 2001 From: Yun Yeo Date: Fri, 14 Jan 2022 11:23:04 +0900 Subject: [PATCH 1/4] add ust --- helpers/types.ts | 5 ++++- markets/aave/commons.ts | 4 ++++ markets/aave/index.ts | 6 ++++++ markets/aave/reservesConfigs.ts | 19 ++++++++++++++++++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/helpers/types.ts b/helpers/types.ts index 4ea1ab06f..5125d811a 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -205,6 +205,7 @@ export interface iAssetBase { REN: T; ENJ: T; xSUSHI: T; + UST: T; } export type iAssetsWithoutETH = Omit, 'ETH'>; @@ -234,6 +235,7 @@ export type iAavePoolAssets = Pick< | 'REN' | 'ENJ' | 'xSUSHI' + | 'UST' >; export type iMultiPoolsAssets = iAssetCommon | iAavePoolAssets; @@ -264,7 +266,8 @@ export enum TokenContractId { YFI = 'YFI', UNI = 'UNI', ENJ = 'ENJ', - xSUSHI = 'xSUSHI' + xSUSHI = 'xSUSHI', + UST = 'UST', } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index 6833e67f2..a83ff370a 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -25,6 +25,7 @@ const MOCK_CHAINLINK_AGGREGATORS_PRICES = { ZRX: oneEther.multipliedBy('0.001151').toFixed(), xSUSHI: oneEther.multipliedBy('0.00913428586').toFixed(), USD: '5848466240000000', + UST: oneEther.multipliedBy('0.00369068412860').toFixed(), }; // ---------------- // PROTOCOL GLOBAL PARAMS @@ -110,6 +111,9 @@ export const CommonsConfig: ICommonConfiguration = { BUSD: { borrowRate: oneRay.multipliedBy(0.05).toFixed(), }, + UST: { + borrowRate: oneRay.multipliedBy(0.05).toFixed(), + }, }, // ---------------- // COMMON PROTOCOL ADDRESSES ACROSS POOLS diff --git a/markets/aave/index.ts b/markets/aave/index.ts index d60db80fd..6bc5761db 100644 --- a/markets/aave/index.ts +++ b/markets/aave/index.ts @@ -23,6 +23,7 @@ import { strategyWETH, strategyYFI, strategyXSUSHI, + strategyUST, } from './reservesConfigs'; // ---------------- @@ -55,6 +56,7 @@ export const AaveConfig: IAaveConfiguration = { YFI: strategyYFI, ZRX: strategyZRX, xSUSHI: strategyXSUSHI, + UST: strategyUST, }, ReserveAssets: { [eEthereumNetwork.buidlerevm]: {}, @@ -81,6 +83,7 @@ export const AaveConfig: IAaveConfiguration = { WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', YFI: '0xb7c325266ec274fEb1354021D27FA3E3379D840d', ZRX: '0xD0d76886cF8D952ca26177EB7CfDf83bad08C00C', + UST: ZERO_ADDRESS, }, [EthereumNetwork.ropsten]: { AAVE: '', @@ -103,6 +106,7 @@ export const AaveConfig: IAaveConfiguration = { WETH: '0xc778417e063141139fce010982780140aa0cd5ab', YFI: ZERO_ADDRESS, ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959', + UST: ZERO_ADDRESS, }, [EthereumNetwork.main]: { AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', @@ -126,6 +130,7 @@ export const AaveConfig: IAaveConfiguration = { YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', ZRX: '0xE41d2489571d322189246DaFA5ebDe1F4699F498', xSUSHI: '0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272', + UST: '0xa693B19d2931d498c5B318dF961919BB4aee87a5', }, [EthereumNetwork.tenderlyMain]: { AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', @@ -149,6 +154,7 @@ export const AaveConfig: IAaveConfiguration = { YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', ZRX: '0xE41d2489571d322189246DaFA5ebDe1F4699F498', xSUSHI: '0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272', + UST: '0xa693B19d2931d498c5B318dF961919BB4aee87a5', }, }, }; diff --git a/markets/aave/reservesConfigs.ts b/markets/aave/reservesConfigs.ts index 30f094ace..c179d382b 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', -}; \ No newline at end of file +}; + +export const strategyUST: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), + stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(), + stableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), + baseLTVAsCollateral: '0', + liquidationThreshold: '0', + liquidationBonus: '0', + borrowingEnabled: true, + stableBorrowRateEnabled: false, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '2000' +}; From 656f534a86b18da81688046716bb027ebdc5d5c8 Mon Sep 17 00:00:00 2001 From: Yun Yeo Date: Fri, 14 Jan 2022 22:55:11 +0900 Subject: [PATCH 2/4] add chainlink feed --- markets/aave/commons.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index a83ff370a..a543ca1b3 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -220,6 +220,7 @@ export const CommonsConfig: ICommonConfiguration = { YFI: '0xC5d1B1DEb2992738C0273408ac43e1e906086B6C', ZRX: '0xBc3f28Ccc21E9b5856E81E6372aFf57307E2E883', USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', + UST: ZERO_ADDRESS, }, [EthereumNetwork.ropsten]: { AAVE: ZERO_ADDRESS, @@ -242,6 +243,7 @@ export const CommonsConfig: ICommonConfiguration = { YFI: ZERO_ADDRESS, ZRX: '0x1d0052e4ae5b4ae4563cbac50edc3627ca0460d7', USD: '0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507', + UST: ZERO_ADDRESS, }, [EthereumNetwork.main]: { AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012', @@ -264,6 +266,7 @@ export const CommonsConfig: ICommonConfiguration = { YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4', ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962', USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', + UST: '0xa20623070413d42a5C01Db2c8111640DD7A5A03a', }, [EthereumNetwork.tenderlyMain]: { AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012', @@ -286,6 +289,7 @@ export const CommonsConfig: ICommonConfiguration = { YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4', ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962', USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419', + UST: '0xa20623070413d42a5C01Db2c8111640DD7A5A03a', }, }, ReserveAssets: { From b7a3915b9ee8ded62c7f247fde02eaaa3ffc91ce Mon Sep 17 00:00:00 2001 From: Yun Yeo Date: Tue, 25 Jan 2022 19:50:48 +0900 Subject: [PATCH 3/4] add incentive controller address for deploy script --- tasks/helpers/deploy-new-asset.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tasks/helpers/deploy-new-asset.ts b/tasks/helpers/deploy-new-asset.ts index 912ebff1c..928eac2e3 100644 --- a/tasks/helpers/deploy-new-asset.ts +++ b/tasks/helpers/deploy-new-asset.ts @@ -11,13 +11,14 @@ import { deployVariableDebtToken, } from './../../helpers/contracts-deployments'; import { setDRE } from '../../helpers/misc-utils'; -import { ZERO_ADDRESS } from './../../helpers/constants'; const LENDING_POOL_ADDRESS_PROVIDER = { main: '0xb53c1a33016b2dc2ff3653530bff1848a515c8c5', kovan: '0x652B2937Efd0B5beA1c8d54293FC1289672AFC6b', }; +const INCENTIVES_CONTROLLER_ADDRESS = '0x036cA61C1977c6EA52222Db81F725fDBd70eFBd7'; + const isSymbolValid = (symbol: string, network: EthereumNetwork) => Object.keys(reserveConfigs).includes('strategy' + symbol) && marketConfigs.AaveConfig.ReserveAssets[network][symbol] && @@ -55,7 +56,7 @@ WRONG RESERVE ASSET SETUP: treasuryAddress, `Aave interest bearing ${symbol}`, `a${symbol}`, - ZERO_ADDRESS, + INCENTIVES_CONTROLLER_ADDRESS, ], verify ); @@ -65,7 +66,7 @@ WRONG RESERVE ASSET SETUP: reserveAssetAddress, `Aave stable debt bearing ${symbol}`, `stableDebt${symbol}`, - ZERO_ADDRESS, + INCENTIVES_CONTROLLER_ADDRESS, ], verify ); @@ -75,7 +76,7 @@ WRONG RESERVE ASSET SETUP: reserveAssetAddress, `Aave variable debt bearing ${symbol}`, `variableDebt${symbol}`, - ZERO_ADDRESS, + INCENTIVES_CONTROLLER_ADDRESS, ], verify ); From e189bf8a5951c4db502116a2089cc2b3f1ff1438 Mon Sep 17 00:00:00 2001 From: Yun Yeo Date: Wed, 26 Jan 2022 11:36:04 +0900 Subject: [PATCH 4/4] back reserveDecimals to 6 --- markets/aave/reservesConfigs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markets/aave/reservesConfigs.ts b/markets/aave/reservesConfigs.ts index c179d382b..e07941bba 100644 --- a/markets/aave/reservesConfigs.ts +++ b/markets/aave/reservesConfigs.ts @@ -371,7 +371,7 @@ export const strategyUST: IReserveParams = { liquidationBonus: '0', borrowingEnabled: true, stableBorrowRateEnabled: false, - reserveDecimals: '18', + reserveDecimals: '6', aTokenImpl: eContractid.AToken, reserveFactor: '2000' };