2020-06-08 12:03:40 +00:00
|
|
|
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-06-08 19:06:26 +00:00
|
|
|
|
2020-09-14 13:57:11 +00:00
|
|
|
export const BUIDLEREVM_CHAINID = 31337;
|
|
|
|
export const COVERAGE_CHAINID = 1337;
|
|
|
|
|
2020-06-08 12:03:40 +00:00
|
|
|
// ----------------
|
|
|
|
// 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';
|
2020-06-08 12:03:40 +00:00
|
|
|
|
|
|
|
// ----------------
|
|
|
|
// 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';
|
2020-06-08 12:03:40 +00:00
|
|
|
|
|
|
|
// ----------------
|
|
|
|
// 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',
|
2020-06-08 12:03:40 +00:00
|
|
|
],
|
|
|
|
];
|
|
|
|
|
|
|
|
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(),
|
2020-08-13 11:06:23 +00:00
|
|
|
WETH: oneEther.toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const ALL_ASSETS_INITIAL_PRICES: iAssetBase<string> = {
|
|
|
|
...MOCK_CHAINLINK_AGGREGATORS_PRICES,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const LENDING_RATE_ORACLE_RATES_COMMON: iAavePoolAssets<IMarketRates> = {
|
2020-08-13 11:06:23 +00:00
|
|
|
WETH: {
|
2020-06-08 12:03:40 +00:00
|
|
|
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> =>
|
2020-06-08 12:03:40 +00:00
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
2020-07-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '7500',
|
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '7500',
|
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
2020-07-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '7500',
|
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '6',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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',
|
2020-07-27 14:14:21 +00:00
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '6',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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',
|
2020-07-27 14:14:21 +00:00
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
LEND: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6000',
|
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
BAT: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6000',
|
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
2020-08-13 11:06:23 +00:00
|
|
|
WETH: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '7500',
|
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
LINK: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6500',
|
|
|
|
liquidationThreshold: '7000',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
WBTC: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6000',
|
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '8',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
KNC: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6000',
|
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
REP: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6000',
|
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
MKR: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6000',
|
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
MANA: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6000',
|
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
ZRX: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6000',
|
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: true,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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',
|
2020-07-27 14:14:21 +00:00
|
|
|
liquidationThreshold: '6500',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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',
|
2020-07-27 14:14:21 +00:00
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
[AavePools.secondary]: {
|
2020-08-13 11:06:23 +00:00
|
|
|
WETH: {
|
2020-07-13 08:54:08 +00:00
|
|
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
|
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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',
|
2020-07-27 14:14:21 +00:00
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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',
|
2020-07-27 14:14:21 +00:00
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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',
|
2020-07-27 14:14:21 +00:00
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '6',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
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',
|
2020-07-27 14:14:21 +00:00
|
|
|
liquidationThreshold: '8000',
|
|
|
|
liquidationBonus: '10500',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: true,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '6',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
2020-07-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6800',
|
|
|
|
liquidationThreshold: '7300',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: false,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
2020-07-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6800',
|
|
|
|
liquidationThreshold: '7300',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: false,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
2020-07-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '4800',
|
|
|
|
liquidationThreshold: '6600',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: false,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
2020-07-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '5100',
|
|
|
|
liquidationThreshold: '6600',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: false,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
2020-07-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '6300',
|
|
|
|
liquidationThreshold: '6800',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: false,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
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(),
|
2020-06-08 12:03:40 +00:00
|
|
|
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope1: new BigNumber(0.16).multipliedBy(oneRay).toFixed(),
|
|
|
|
stableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
2020-07-27 14:14:21 +00:00
|
|
|
baseLTVAsCollateral: '4800',
|
|
|
|
liquidationThreshold: '6600',
|
|
|
|
liquidationBonus: '11000',
|
2020-06-08 12:03:40 +00:00
|
|
|
borrowingEnabled: false,
|
|
|
|
stableBorrowRateEnabled: false,
|
2020-07-13 08:54:08 +00:00
|
|
|
reserveDecimals: '18',
|
2020-06-08 12:03:40 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
pool
|
|
|
|
);
|
|
|
|
|
|
|
|
export const getFeeDistributionParamsCommon = (
|
|
|
|
receiver: tEthereumAddress
|
|
|
|
): iBasicDistributionParams => {
|
|
|
|
const receivers = [receiver, ZERO_ADDRESS];
|
2020-07-13 08:54:08 +00:00
|
|
|
const percentages = ['2000', '8000'];
|
2020-06-08 12:03:40 +00:00
|
|
|
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
|
|
|
|
);
|