aave-protocol-v2/helpers/constants.ts

552 lines
23 KiB
TypeScript
Raw Normal View History

import {
iAssetBase,
iAavePoolAssets,
IMarketRates,
iAssetAggregatorBase,
AavePools,
iMultiPoolsAssets,
IReserveParams,
tEthereumAddress,
iBasicDistributionParams,
2020-09-14 13:57:11 +00:00
eEthereumNetwork,
2020-07-13 08:54:08 +00:00
} from './types';
import BigNumber from 'bignumber.js';
2020-09-14 13:57:11 +00:00
import {getParamPerPool, getParamPerNetwork} from './contracts-helpers';
2020-05-29 14:55:31 +00:00
2020-07-13 08:54:08 +00:00
export const TEST_SNAPSHOT_ID = '0x1';
2020-09-14 13:57:11 +00:00
export const BUIDLEREVM_CHAINID = 31337;
export const COVERAGE_CHAINID = 1337;
// ----------------
// MATH
// ----------------
export const WAD = Math.pow(10, 18).toString();
export const HALF_WAD = new BigNumber(WAD).multipliedBy(0.5).toString();
export const RAY = new BigNumber(10).exponentiatedBy(27).toFixed();
export const HALF_RAY = new BigNumber(RAY).multipliedBy(0.5).toFixed();
export const WAD_RAY_RATIO = Math.pow(10, 9).toString();
export const oneEther = new BigNumber(Math.pow(10, 18));
export const oneRay = new BigNumber(Math.pow(10, 27));
2020-05-29 14:55:31 +00:00
export const MAX_UINT_AMOUNT =
2020-07-13 08:54:08 +00:00
'115792089237316195423570985008687907853269984665640564039457584007913129639935';
// ----------------
// PROTOCOL GLOBAL PARAMS
// ----------------
export const OPTIMAL_UTILIZATION_RATE = new BigNumber(0.8).times(RAY);
export const EXCESS_UTILIZATION_RATE = new BigNumber(0.2).times(RAY);
2020-07-13 08:54:08 +00:00
export const ONE_YEAR = '31536000';
export const APPROVAL_AMOUNT_LENDING_POOL = '1000000000000000000000000000';
export const TOKEN_DISTRIBUTOR_PERCENTAGE_BASE = '10000';
export const MOCK_USD_PRICE_IN_WEI = '5848466240000000';
export const USD_ADDRESS = '0x10F7Fc1F91Ba351f9C629c5947AD69bD03C05b96';
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
export const ONE_ADDRESS = '0x0000000000000000000000000000000000000001';
export const AAVE_REFERRAL = '0';
// ----------------
// COMMON PROTOCOL PARAMS ACROSS POOLS AND NETWORKS
// ----------------
export const ALL_AAVE_RESERVES_SYMBOLS = [
[
2020-07-13 08:54:08 +00:00
'ETH',
'DAI',
'LEND',
'TUSD',
'BAT',
'USDC',
'USDT',
'SUSD',
'ZRX',
'MKR',
'WBTC',
'LINK',
'KNC',
'MANA',
'REP',
'SNX',
'BUSD',
'UNI_DAI_ETH',
'UNI_USDC_ETH',
'UNI_SETH_ETH',
'UNI_LINK_ETH',
'UNI_MKR_ETH',
'UNI_LEND_ETH',
],
];
export const MOCK_CHAINLINK_AGGREGATORS_PRICES: iAssetAggregatorBase<string> = {
2020-07-13 08:54:08 +00:00
DAI: oneEther.multipliedBy('0.00369068412860').toFixed(),
TUSD: oneEther.multipliedBy('0.00364714136416').toFixed(),
USDC: oneEther.multipliedBy('0.00367714136416').toFixed(),
LEND: oneEther.multipliedBy('0.00003620948469').toFixed(),
BAT: oneEther.multipliedBy('0.00137893825230').toFixed(),
USDT: oneEther.multipliedBy('0.00369068412860').toFixed(),
SUSD: oneEther.multipliedBy('0.00364714136416').toFixed(),
MKR: oneEther.multipliedBy('2.508581').toFixed(),
REP: oneEther.multipliedBy('0.048235').toFixed(),
ZRX: oneEther.multipliedBy('0.001151').toFixed(),
WBTC: oneEther.multipliedBy('47.332685').toFixed(),
LINK: oneEther.multipliedBy('0.009955').toFixed(),
KNC: oneEther.multipliedBy('0.001072').toFixed(),
MANA: oneEther.multipliedBy('0.000158').toFixed(),
SNX: oneEther.multipliedBy('0.00442616').toFixed(),
BUSD: oneEther.multipliedBy('0.00736484').toFixed(),
WETH: oneEther.toFixed(),
USD: MOCK_USD_PRICE_IN_WEI,
2020-07-13 08:54:08 +00:00
UNI_DAI_ETH: oneEther.multipliedBy('2.1').toFixed(),
UNI_USDC_ETH: oneEther.multipliedBy('2.1').toFixed(),
UNI_SETH_ETH: oneEther.multipliedBy('2.1').toFixed(),
UNI_LEND_ETH: oneEther.multipliedBy('2.1').toFixed(),
UNI_LINK_ETH: oneEther.multipliedBy('2.1').toFixed(),
UNI_MKR_ETH: oneEther.multipliedBy('2.1').toFixed(),
};
export const ALL_ASSETS_INITIAL_PRICES: iAssetBase<string> = {
...MOCK_CHAINLINK_AGGREGATORS_PRICES,
};
export const LENDING_RATE_ORACLE_RATES_COMMON: iAavePoolAssets<IMarketRates> = {
WETH: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
DAI: {
borrowRate: oneRay.multipliedBy(0.039).toFixed(),
},
TUSD: {
borrowRate: oneRay.multipliedBy(0.035).toFixed(),
},
USDC: {
borrowRate: oneRay.multipliedBy(0.039).toFixed(),
},
SUSD: {
borrowRate: oneRay.multipliedBy(0.035).toFixed(),
},
USDT: {
borrowRate: oneRay.multipliedBy(0.035).toFixed(),
},
BAT: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
LEND: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
LINK: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
KNC: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
REP: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
MKR: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
MANA: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
WBTC: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
ZRX: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
SNX: {
borrowRate: oneRay.multipliedBy(0.03).toFixed(),
},
BUSD: {
borrowRate: oneRay.multipliedBy(0.05).toFixed(),
},
};
2020-07-13 08:54:08 +00:00
export const getReservesConfigByPool = (pool: AavePools): iMultiPoolsAssets<IReserveParams> =>
getParamPerPool<iMultiPoolsAssets<IReserveParams>>(
{
[AavePools.proto]: {
DAI: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.05).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '7500',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
TUSD: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.14).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '7500',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
USDC: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '7500',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '6',
},
USDT: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.14).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
2020-07-13 08:54:08 +00:00
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '6',
},
SUSD: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.14).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
2020-07-13 08:54:08 +00:00
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
LEND: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6000',
liquidationThreshold: '6500',
liquidationBonus: '11500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
BAT: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
WETH: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '7500',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
LINK: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6500',
liquidationThreshold: '7000',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
WBTC: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6000',
liquidationThreshold: '6500',
liquidationBonus: '11500',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '8',
},
KNC: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
REP: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
MKR: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
MANA: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
ZRX: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6000',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: true,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
SNX: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.12).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
2020-07-13 08:54:08 +00:00
baseLTVAsCollateral: '-1',
liquidationThreshold: '6500',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
BUSD: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.14).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
2020-07-13 08:54:08 +00:00
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '11000',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
},
[AavePools.secondary]: {
WETH: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
2020-07-13 08:54:08 +00:00
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
DAI: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.06).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
2020-07-13 08:54:08 +00:00
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
USDC: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.06).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
2020-07-13 08:54:08 +00:00
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '6',
},
USDT: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.06).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
2020-07-13 08:54:08 +00:00
baseLTVAsCollateral: '-1',
liquidationThreshold: '8000',
liquidationBonus: '10500',
borrowingEnabled: true,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '6',
},
UNI_DAI_ETH: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6800',
liquidationThreshold: '7300',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
UNI_USDC_ETH: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6800',
liquidationThreshold: '7300',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
UNI_SETH_ETH: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '4800',
liquidationThreshold: '6600',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
UNI_LEND_ETH: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '5100',
liquidationThreshold: '6600',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
UNI_LINK_ETH: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '6300',
liquidationThreshold: '6800',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
UNI_MKR_ETH: {
2020-07-13 08:54:08 +00:00
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
baseLTVAsCollateral: '4800',
liquidationThreshold: '6600',
liquidationBonus: '11000',
borrowingEnabled: false,
stableBorrowRateEnabled: false,
2020-07-13 08:54:08 +00:00
reserveDecimals: '18',
},
},
},
pool
);
export const getFeeDistributionParamsCommon = (
receiver: tEthereumAddress
): iBasicDistributionParams => {
const receivers = [receiver, ZERO_ADDRESS];
2020-07-13 08:54:08 +00:00
const percentages = ['2000', '8000'];
return {
receivers,
percentages,
};
};
2020-09-14 13:57:11 +00:00
export const getATokenDomainSeparatorPerNetwork = (
network: eEthereumNetwork
): tEthereumAddress =>
getParamPerNetwork<tEthereumAddress>(
{
[eEthereumNetwork.coverage]: "0x95b73a72c6ecf4ccbbba5178800023260bad8e75cdccdb8e4827a2977a37c820",
[eEthereumNetwork.buidlerevm]:
"0x76cbbf8aa4b11a7c207dd79ccf8c394f59475301598c9a083f8258b4fafcfa86",
[eEthereumNetwork.kovan]: "",
[eEthereumNetwork.ropsten]: "",
[eEthereumNetwork.main]: "",
},
network
);