feat: updated configs to add exposure caps

This commit is contained in:
Hadrien Charlanes 2021-06-02 17:58:33 +02:00
parent 1e55bb69ab
commit 360e2e74a6
5 changed files with 55 additions and 4 deletions

View File

@ -253,10 +253,9 @@ export const getPairsTokenAggregator = (
const aggregatorAddressIndex = Object.keys(aggregatorsAddresses).findIndex(
(value) => value === tokenSymbol
);
const [, aggregatorAddress] = (Object.entries(aggregatorsAddresses) as [
string,
tEthereumAddress
][])[aggregatorAddressIndex];
const [, aggregatorAddress] = (
Object.entries(aggregatorsAddresses) as [string, tEthereumAddress][]
)[aggregatorAddressIndex];
return [tokenAddress, aggregatorAddress];
}
}) as [string, string][];
@ -286,6 +285,7 @@ export const configureReservesByHelper = async (
reserveFactor: BigNumberish;
borrowCap: BigNumberish;
supplyCap: BigNumberish;
exposureCap: BigNumberish;
stableBorrowingEnabled: boolean;
borrowingEnabled: boolean;
}[] = [];
@ -299,6 +299,7 @@ export const configureReservesByHelper = async (
reserveFactor,
borrowCap,
supplyCap,
exposureCap,
stableBorrowRateEnabled,
borrowingEnabled,
},
@ -335,6 +336,7 @@ export const configureReservesByHelper = async (
reserveFactor,
borrowCap,
supplyCap,
exposureCap,
stableBorrowingEnabled: stableBorrowRateEnabled,
borrowingEnabled: borrowingEnabled,
});

View File

@ -394,6 +394,7 @@ export interface IReserveCollateralParams {
baseLTVAsCollateral: string;
liquidationThreshold: string;
liquidationBonus: string;
exposureCap: string;
}
export interface IMarketRates {
borrowRate: string;

View File

@ -24,6 +24,7 @@ export const strategyBUSD: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyDAI: IReserveParams = {
@ -38,6 +39,7 @@ export const strategyDAI: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategySUSD: IReserveParams = {
@ -52,6 +54,7 @@ export const strategySUSD: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyTUSD: IReserveParams = {
@ -66,6 +69,7 @@ export const strategyTUSD: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyUSDC: IReserveParams = {
@ -80,6 +84,7 @@ export const strategyUSDC: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyUSDT: IReserveParams = {
@ -94,6 +99,7 @@ export const strategyUSDT: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyAAVE: IReserveParams = {
@ -108,6 +114,7 @@ export const strategyAAVE: IReserveParams = {
reserveFactor: '0',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyBAT: IReserveParams = {
@ -122,6 +129,7 @@ export const strategyBAT: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyENJ: IReserveParams = {
@ -136,6 +144,7 @@ export const strategyENJ: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyWETH: IReserveParams = {
@ -150,6 +159,7 @@ export const strategyWETH: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyKNC: IReserveParams = {
@ -164,6 +174,7 @@ export const strategyKNC: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyLINK: IReserveParams = {
@ -178,6 +189,7 @@ export const strategyLINK: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyMANA: IReserveParams = {
@ -192,6 +204,7 @@ export const strategyMANA: IReserveParams = {
reserveFactor: '3500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyMKR: IReserveParams = {
@ -206,6 +219,7 @@ export const strategyMKR: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyREN: IReserveParams = {
@ -220,6 +234,7 @@ export const strategyREN: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategySNX: IReserveParams = {
@ -234,6 +249,7 @@ export const strategySNX: IReserveParams = {
reserveFactor: '3500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
// Invalid borrow rates in params currently, replaced with snx params
@ -249,6 +265,7 @@ export const strategyUNI: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyWBTC: IReserveParams = {
@ -263,6 +280,7 @@ export const strategyWBTC: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyYFI: IReserveParams = {
@ -277,6 +295,7 @@ export const strategyYFI: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyZRX: IReserveParams = {
@ -291,6 +310,7 @@ export const strategyZRX: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyXSUSHI: IReserveParams = {
@ -305,4 +325,5 @@ export const strategyXSUSHI: IReserveParams = {
reserveFactor: '3500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};

View File

@ -13,6 +13,7 @@ export const strategyWETH: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyWBTC: IReserveParams = {
@ -27,6 +28,7 @@ export const strategyWBTC: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyDAI: IReserveParams = {
@ -41,6 +43,7 @@ export const strategyDAI: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyUSDC: IReserveParams = {
@ -55,6 +58,7 @@ export const strategyUSDC: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyUSDT: IReserveParams = {
@ -69,6 +73,7 @@ export const strategyUSDT: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyDAIWETH: IReserveParams = {
@ -83,6 +88,7 @@ export const strategyDAIWETH: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyWBTCWETH: IReserveParams = {
@ -97,6 +103,7 @@ export const strategyWBTCWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyAAVEWETH: IReserveParams = {
@ -111,6 +118,7 @@ export const strategyAAVEWETH: IReserveParams = {
reserveFactor: '500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyBATWETH: IReserveParams = {
@ -125,6 +133,7 @@ export const strategyBATWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyDAIUSDC: IReserveParams = {
@ -139,6 +148,7 @@ export const strategyDAIUSDC: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyCRVWETH: IReserveParams = {
@ -153,6 +163,7 @@ export const strategyCRVWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyLINKWETH: IReserveParams = {
@ -167,6 +178,7 @@ export const strategyLINKWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyMKRWETH: IReserveParams = {
@ -181,6 +193,7 @@ export const strategyMKRWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyRENWETH: IReserveParams = {
@ -195,6 +208,7 @@ export const strategyRENWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategySNXWETH: IReserveParams = {
@ -209,6 +223,7 @@ export const strategySNXWETH: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyUNIWETH: IReserveParams = {
@ -223,6 +238,7 @@ export const strategyUNIWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyUSDCWETH: IReserveParams = {
@ -237,6 +253,7 @@ export const strategyUSDCWETH: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyWBTCUSDC: IReserveParams = {
@ -251,6 +268,7 @@ export const strategyWBTCUSDC: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyYFIWETH: IReserveParams = {
@ -265,6 +283,7 @@ export const strategyYFIWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyBALWETH: IReserveParams = {
@ -279,4 +298,5 @@ export const strategyBALWETH: IReserveParams = {
reserveFactor: '1500',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};

View File

@ -22,6 +22,7 @@ export const strategyDAI: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyUSDC: IReserveParams = {
@ -36,6 +37,7 @@ export const strategyUSDC: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyUSDT: IReserveParams = {
@ -50,6 +52,7 @@ export const strategyUSDT: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyWETH: IReserveParams = {
@ -64,6 +67,7 @@ export const strategyWETH: IReserveParams = {
reserveFactor: '1000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyWBTC: IReserveParams = {
@ -78,6 +82,7 @@ export const strategyWBTC: IReserveParams = {
reserveFactor: '2000',
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
};
export const strategyMATIC: IReserveParams = {
@ -91,6 +96,7 @@ export const strategyMATIC: IReserveParams = {
aTokenImpl: eContractid.AToken,
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
reserveFactor: '2000',
};
@ -105,5 +111,6 @@ export const strategyAAVE: IReserveParams = {
aTokenImpl: eContractid.AToken,
borrowCap: '0',
supplyCap: '0',
exposureCap: '0',
reserveFactor: '0',
};