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

Added UST risk parameters #266

Open
wants to merge 4 commits 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
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;
UST: 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'
| 'UST'
>;

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',
UST = 'UST',
}

export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams {
Expand Down
8 changes: 8 additions & 0 deletions markets/aave/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -216,6 +220,7 @@ export const CommonsConfig: ICommonConfiguration = {
YFI: '0xC5d1B1DEb2992738C0273408ac43e1e906086B6C',
ZRX: '0xBc3f28Ccc21E9b5856E81E6372aFf57307E2E883',
USD: '0x9326BFA02ADD2366b30bacB125260Af641031331',
UST: ZERO_ADDRESS,
},
[EthereumNetwork.ropsten]: {
AAVE: ZERO_ADDRESS,
Expand All @@ -238,6 +243,7 @@ export const CommonsConfig: ICommonConfiguration = {
YFI: ZERO_ADDRESS,
ZRX: '0x1d0052e4ae5b4ae4563cbac50edc3627ca0460d7',
USD: '0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507',
UST: ZERO_ADDRESS,
},
[EthereumNetwork.main]: {
AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012',
Expand All @@ -260,6 +266,7 @@ export const CommonsConfig: ICommonConfiguration = {
YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4',
ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962',
USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419',
UST: '0xa20623070413d42a5C01Db2c8111640DD7A5A03a',
},
[EthereumNetwork.tenderlyMain]: {
AAVE: '0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012',
Expand All @@ -282,6 +289,7 @@ export const CommonsConfig: ICommonConfiguration = {
YFI: '0x7c5d4F8345e66f68099581Db340cd65B078C41f4',
ZRX: '0x2Da4983a622a8498bb1a21FaE9D8F6C664939962',
USD: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419',
UST: '0xa20623070413d42a5C01Db2c8111640DD7A5A03a',
},
},
ReserveAssets: {
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,
strategyUST,
} from './reservesConfigs';

// ----------------
Expand Down Expand Up @@ -55,6 +56,7 @@ export const AaveConfig: IAaveConfiguration = {
YFI: strategyYFI,
ZRX: strategyZRX,
xSUSHI: strategyXSUSHI,
UST: strategyUST,
},
ReserveAssets: {
[eEthereumNetwork.buidlerevm]: {},
Expand All @@ -81,6 +83,7 @@ export const AaveConfig: IAaveConfiguration = {
WETH: '0xd0a1e359811322d97991e03f863a0c30c2cf029c',
YFI: '0xb7c325266ec274fEb1354021D27FA3E3379D840d',
ZRX: '0xD0d76886cF8D952ca26177EB7CfDf83bad08C00C',
UST: ZERO_ADDRESS,
},
[EthereumNetwork.ropsten]: {
AAVE: '',
Expand All @@ -103,6 +106,7 @@ export const AaveConfig: IAaveConfiguration = {
WETH: '0xc778417e063141139fce010982780140aa0cd5ab',
YFI: ZERO_ADDRESS,
ZRX: '0x02d7055704EfF050323A2E5ee4ba05DB2A588959',
UST: ZERO_ADDRESS,
},
[EthereumNetwork.main]: {
AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9',
Expand All @@ -126,6 +130,7 @@ export const AaveConfig: IAaveConfiguration = {
YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
ZRX: '0xE41d2489571d322189246DaFA5ebDe1F4699F498',
xSUSHI: '0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272',
UST: '0xa693B19d2931d498c5B318dF961919BB4aee87a5',
},
[EthereumNetwork.tenderlyMain]: {
AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9',
Expand All @@ -149,6 +154,7 @@ export const AaveConfig: IAaveConfiguration = {
YFI: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
ZRX: '0xE41d2489571d322189246DaFA5ebDe1F4699F498',
xSUSHI: '0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272',
UST: '0xa693B19d2931d498c5B318dF961919BB4aee87a5',
},
},
};
Expand Down
19 changes: 18 additions & 1 deletion 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 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: '6',
aTokenImpl: eContractid.AToken,
reserveFactor: '2000'
};
9 changes: 5 additions & 4 deletions tasks/helpers/deploy-new-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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] &&
Expand Down Expand Up @@ -55,7 +56,7 @@ WRONG RESERVE ASSET SETUP:
treasuryAddress,
`Aave interest bearing ${symbol}`,
`a${symbol}`,
ZERO_ADDRESS,
INCENTIVES_CONTROLLER_ADDRESS,
],
verify
);
Expand All @@ -65,7 +66,7 @@ WRONG RESERVE ASSET SETUP:
reserveAssetAddress,
`Aave stable debt bearing ${symbol}`,
`stableDebt${symbol}`,
ZERO_ADDRESS,
INCENTIVES_CONTROLLER_ADDRESS,
],
verify
);
Expand All @@ -75,7 +76,7 @@ WRONG RESERVE ASSET SETUP:
reserveAssetAddress,
`Aave variable debt bearing ${symbol}`,
`variableDebt${symbol}`,
ZERO_ADDRESS,
INCENTIVES_CONTROLLER_ADDRESS,
],
verify
);
Expand Down