mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Added optimized deployment functionality
This commit is contained in:
parent
4b39c42169
commit
fda95dd318
|
@ -58,16 +58,11 @@ export const initReservesByHelper = async (
|
||||||
|
|
||||||
// Set aTokenAndRatesDeployer as temporal admin
|
// Set aTokenAndRatesDeployer as temporal admin
|
||||||
await waitForTx(await addressProvider.setPoolAdmin(atokenAndRatesDeployer.address));
|
await waitForTx(await addressProvider.setPoolAdmin(atokenAndRatesDeployer.address));
|
||||||
console.log("Got deployer address");
|
|
||||||
// CHUNK CONFIGURATION
|
// CHUNK CONFIGURATION
|
||||||
const tokensChunks = 2;
|
|
||||||
const initChunks = 4;
|
const initChunks = 4;
|
||||||
|
|
||||||
// Initialize variables for future reserves initialization
|
// Initialize variables for future reserves initialization
|
||||||
let deployedStableTokens: string[] = [];
|
|
||||||
let deployedVariableTokens: string[] = [];
|
|
||||||
let deployedATokens: string[] = [];
|
|
||||||
let deployedRates: string[] = [];
|
|
||||||
let reserveTokens: string[] = [];
|
let reserveTokens: string[] = [];
|
||||||
let reserveInitDecimals: string[] = [];
|
let reserveInitDecimals: string[] = [];
|
||||||
let reserveSymbols: string[] = [];
|
let reserveSymbols: string[] = [];
|
||||||
|
@ -100,7 +95,6 @@ export const initReservesByHelper = async (
|
||||||
string,
|
string,
|
||||||
string
|
string
|
||||||
];
|
];
|
||||||
// TEST - replacing with two maps, like a mapping to mapping in solidity
|
|
||||||
let rateStrategies: Record<string, typeof strategyRates> = {};
|
let rateStrategies: Record<string, typeof strategyRates> = {};
|
||||||
let strategyAddresses: Record<string, tEthereumAddress> = {};
|
let strategyAddresses: Record<string, tEthereumAddress> = {};
|
||||||
let strategyAddressPerAsset: Record<string, string> = {};
|
let strategyAddressPerAsset: Record<string, string> = {};
|
||||||
|
@ -109,7 +103,6 @@ export const initReservesByHelper = async (
|
||||||
let aTokenImplementationAddress = "";
|
let aTokenImplementationAddress = "";
|
||||||
let stableDebtTokenImplementationAddress = "";
|
let stableDebtTokenImplementationAddress = "";
|
||||||
let variableDebtTokenImplementationAddress = "";
|
let variableDebtTokenImplementationAddress = "";
|
||||||
// --TEST
|
|
||||||
|
|
||||||
const tx1 = await waitForTx(
|
const tx1 = await waitForTx(
|
||||||
await stableAndVariableDeployer.initDeployment([ZERO_ADDRESS], ["1"])
|
await stableAndVariableDeployer.initDeployment([ZERO_ADDRESS], ["1"])
|
||||||
|
@ -120,12 +113,13 @@ export const initReservesByHelper = async (
|
||||||
rawInsertContractAddressInDb(`stableDebtTokenImpl`, stableDebtTokenImplementationAddress);
|
rawInsertContractAddressInDb(`stableDebtTokenImpl`, stableDebtTokenImplementationAddress);
|
||||||
rawInsertContractAddressInDb(`variableDebtTokenImpl`, variableDebtTokenImplementationAddress);
|
rawInsertContractAddressInDb(`variableDebtTokenImpl`, variableDebtTokenImplementationAddress);
|
||||||
});
|
});
|
||||||
|
//gasUsage = gasUsage.add(tx1.gasUsed);
|
||||||
|
|
||||||
|
|
||||||
const aTokenImplementation = await deployGenericATokenImpl(verify);
|
const aTokenImplementation = await deployGenericATokenImpl(verify);
|
||||||
aTokenImplementationAddress = aTokenImplementation.address;
|
aTokenImplementationAddress = aTokenImplementation.address;
|
||||||
rawInsertContractAddressInDb(`aTokenImpl`, aTokenImplementationAddress);
|
rawInsertContractAddressInDb(`aTokenImpl`, aTokenImplementationAddress);
|
||||||
// Deploy delegated aware reserves tokens
|
|
||||||
const delegatedAwareReserves = Object.entries(reservesParams).filter(
|
const delegatedAwareReserves = Object.entries(reservesParams).filter(
|
||||||
([_, { aTokenImpl }]) => aTokenImpl === eContractid.DelegationAwareAToken
|
([_, { aTokenImpl }]) => aTokenImpl === eContractid.DelegationAwareAToken
|
||||||
) as [string, IReserveParams][];
|
) as [string, IReserveParams][];
|
||||||
|
@ -136,122 +130,28 @@ export const initReservesByHelper = async (
|
||||||
rawInsertContractAddressInDb(`delegationAwareATokenImpl`, delegationAwareATokenImplementationAddress);
|
rawInsertContractAddressInDb(`delegationAwareATokenImpl`, delegationAwareATokenImplementationAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deploy tokens and rates that uses common aToken in chunks
|
const reserves = Object.entries(reservesParams).filter(
|
||||||
const reservesChunks = chunk(
|
([_, { aTokenImpl }]) => aTokenImpl === eContractid.DelegationAwareAToken ||
|
||||||
Object.entries(reservesParams).filter(
|
aTokenImpl === eContractid.AToken
|
||||||
([_, { aTokenImpl }]) => aTokenImpl === eContractid.AToken
|
) as [string, IReserveParams][];
|
||||||
) as [string, IReserveParams][],
|
|
||||||
tokensChunks
|
|
||||||
);
|
|
||||||
|
|
||||||
// const reserves = Object.entries(reservesParams).filter(
|
for (let [symbol, params] of reserves) {
|
||||||
// ([_, { aTokenImpl }]) => aTokenImpl === eContractid.AToken
|
|
||||||
// ) as [string, IReserveParams][];
|
|
||||||
|
|
||||||
|
|
||||||
console.log(
|
|
||||||
`- Token deployments in ${reservesChunks.length * 2} txs instead of ${
|
|
||||||
Object.entries(reservesParams).length * 4
|
|
||||||
} txs`
|
|
||||||
);
|
|
||||||
// All of these use the same aToken implementation
|
|
||||||
// but they might use different rate strategy implementations,
|
|
||||||
// it is better to simply iterate through every reserve instead of chunks later
|
|
||||||
for (let reservesChunk of reservesChunks) {
|
|
||||||
|
|
||||||
// Prepare data
|
|
||||||
const tokens: string[] = [];
|
|
||||||
const symbols: string[] = [];
|
|
||||||
|
|
||||||
const reservesDecimals: string[] = [];
|
|
||||||
|
|
||||||
for (let [assetSymbol, { reserveDecimals }] of reservesChunk) {
|
|
||||||
|
|
||||||
const assetAddressIndex = Object.keys(tokenAddresses).findIndex(
|
|
||||||
(value) => value === assetSymbol
|
|
||||||
);
|
|
||||||
|
|
||||||
const [, tokenAddress] = (Object.entries(tokenAddresses) as [string, string][])[
|
|
||||||
assetAddressIndex
|
|
||||||
];
|
|
||||||
|
|
||||||
const reserveParamIndex = Object.keys(reservesParams).findIndex(
|
|
||||||
(value) => value === assetSymbol
|
|
||||||
);
|
|
||||||
|
|
||||||
const [
|
|
||||||
,
|
|
||||||
{
|
|
||||||
strategy,
|
|
||||||
optimalUtilizationRate,
|
|
||||||
baseVariableBorrowRate,
|
|
||||||
variableRateSlope1,
|
|
||||||
variableRateSlope2,
|
|
||||||
stableRateSlope1,
|
|
||||||
stableRateSlope2,
|
|
||||||
},
|
|
||||||
] = (Object.entries(reservesParams) as [string, IReserveParams][])[reserveParamIndex];
|
|
||||||
// Add to lists
|
|
||||||
|
|
||||||
tokens.push(tokenAddress);
|
|
||||||
symbols.push(assetSymbol);
|
|
||||||
|
|
||||||
if (!strategyAddresses[strategy]) {
|
|
||||||
// Strategy does not exist, create a new one
|
|
||||||
rateStrategies[strategy] = [
|
|
||||||
addressProvider.address,
|
|
||||||
optimalUtilizationRate,
|
|
||||||
baseVariableBorrowRate,
|
|
||||||
variableRateSlope1,
|
|
||||||
variableRateSlope2,
|
|
||||||
stableRateSlope1,
|
|
||||||
stableRateSlope2,
|
|
||||||
];
|
|
||||||
//lastStrategy = strategy;
|
|
||||||
strategyAddresses[strategy] = (await deployDefaultReserveInterestRateStrategy(
|
|
||||||
rateStrategies[strategy],
|
|
||||||
verify
|
|
||||||
)).address;
|
|
||||||
}
|
|
||||||
strategyAddressPerAsset[assetSymbol] = strategyAddresses[strategy];
|
|
||||||
console.log("Strategy address for asset %s: %s", assetSymbol, strategyAddressPerAsset[assetSymbol])
|
|
||||||
|
|
||||||
reservesDecimals.push(reserveDecimals);
|
|
||||||
aTokenType[assetSymbol] = "generic";
|
|
||||||
// inputParams.push({
|
|
||||||
// asset: tokenAddress,
|
|
||||||
// rates: [
|
|
||||||
// optimalUtilizationRate,
|
|
||||||
// baseVariableBorrowRate,
|
|
||||||
// variableRateSlope1,
|
|
||||||
// variableRateSlope2,
|
|
||||||
// stableRateSlope1,
|
|
||||||
// stableRateSlope2
|
|
||||||
// ]
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
reserveInitDecimals = [...reserveInitDecimals, ...reservesDecimals];
|
|
||||||
reserveTokens = [...reserveTokens, ...tokens];
|
|
||||||
reserveSymbols = [...reserveSymbols, ...symbols];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (let [symbol, params] of delegatedAwareReserves) {
|
|
||||||
console.log(` - Deploy ${symbol} delegation aware aToken, debts tokens, and strategy`);
|
|
||||||
const {
|
const {
|
||||||
strategy,
|
strategy,
|
||||||
|
aTokenImpl,
|
||||||
|
reserveDecimals,
|
||||||
|
} = params;
|
||||||
|
const {
|
||||||
optimalUtilizationRate,
|
optimalUtilizationRate,
|
||||||
baseVariableBorrowRate,
|
baseVariableBorrowRate,
|
||||||
variableRateSlope1,
|
variableRateSlope1,
|
||||||
variableRateSlope2,
|
variableRateSlope2,
|
||||||
stableRateSlope1,
|
stableRateSlope1,
|
||||||
stableRateSlope2,
|
stableRateSlope2,
|
||||||
} = params;
|
} = strategy;
|
||||||
|
if (!strategyAddresses[strategy.name]) {
|
||||||
if (!strategyAddresses[strategy]) {
|
|
||||||
// Strategy does not exist, create a new one
|
// Strategy does not exist, create a new one
|
||||||
rateStrategies[strategy] = [
|
rateStrategies[strategy.name] = [
|
||||||
addressProvider.address,
|
addressProvider.address,
|
||||||
optimalUtilizationRate,
|
optimalUtilizationRate,
|
||||||
baseVariableBorrowRate,
|
baseVariableBorrowRate,
|
||||||
|
@ -260,23 +160,28 @@ export const initReservesByHelper = async (
|
||||||
stableRateSlope1,
|
stableRateSlope1,
|
||||||
stableRateSlope2,
|
stableRateSlope2,
|
||||||
];
|
];
|
||||||
//lastStrategy = strategy;
|
strategyAddresses[strategy.name] = (await deployDefaultReserveInterestRateStrategy(
|
||||||
strategyAddresses[strategy] = (await deployDefaultReserveInterestRateStrategy(
|
rateStrategies[strategy.name],
|
||||||
rateStrategies[strategy],
|
|
||||||
verify
|
verify
|
||||||
)).address;
|
)).address;
|
||||||
|
// This causes the last strategy to be printed twice, once under "DefaultReserveInterestRateStrategy"
|
||||||
|
// and once under the actual `strategyASSET` key.
|
||||||
|
rawInsertContractAddressInDb(strategy.name, strategyAddresses[strategy.name]);
|
||||||
}
|
}
|
||||||
strategyAddressPerAsset[symbol] = strategyAddresses[strategy];
|
strategyAddressPerAsset[symbol] = strategyAddresses[strategy.name];
|
||||||
console.log("Strategy address for asset %s: %s", symbol, strategyAddressPerAsset[symbol])
|
console.log("Strategy address for asset %s: %s", symbol, strategyAddressPerAsset[symbol])
|
||||||
|
|
||||||
|
if (aTokenImpl === eContractid.AToken) {
|
||||||
|
aTokenType[symbol] = "generic";
|
||||||
|
} else if (aTokenImpl === eContractid.DelegationAwareAToken) {
|
||||||
aTokenType[symbol] = "delegation aware";
|
aTokenType[symbol] = "delegation aware";
|
||||||
reserveInitDecimals.push(params.reserveDecimals);
|
}
|
||||||
|
|
||||||
|
reserveInitDecimals.push(reserveDecimals);
|
||||||
reserveTokens.push(tokenAddresses[symbol]);
|
reserveTokens.push(tokenAddresses[symbol]);
|
||||||
reserveSymbols.push(symbol);
|
reserveSymbols.push(symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
//gasUsage = gasUsage.add(tx1.gasUsed);
|
|
||||||
|
|
||||||
for (let i = 0; i < reserveSymbols.length; i ++) {
|
for (let i = 0; i < reserveSymbols.length; i ++) {
|
||||||
let aTokenToUse: string;
|
let aTokenToUse: string;
|
||||||
if (aTokenType[reserveSymbols[i]] === 'generic') {
|
if (aTokenType[reserveSymbols[i]] === 'generic') {
|
||||||
|
@ -319,7 +224,7 @@ export const initReservesByHelper = async (
|
||||||
|
|
||||||
console.log(` - Reserve ready for: ${chunkedSymbols[chunkIndex].join(', ')}`);
|
console.log(` - Reserve ready for: ${chunkedSymbols[chunkIndex].join(', ')}`);
|
||||||
console.log(' * gasUsed', tx3.gasUsed.toString());
|
console.log(' * gasUsed', tx3.gasUsed.toString());
|
||||||
gasUsage = gasUsage.add(tx3.gasUsed);
|
//gasUsage = gasUsage.add(tx3.gasUsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -490,7 +395,7 @@ export const initTokenReservesByHelper = async (
|
||||||
let deployedVariableTokens: string[] = [];
|
let deployedVariableTokens: string[] = [];
|
||||||
let deployedATokens: string[] = [];
|
let deployedATokens: string[] = [];
|
||||||
let deployedRates: string[] = [];
|
let deployedRates: string[] = [];
|
||||||
let reserveTokens: string[] = [];
|
//let reserveTokens: string[] = [];
|
||||||
let reserveInitDecimals: string[] = [];
|
let reserveInitDecimals: string[] = [];
|
||||||
let reserveSymbols: string[] = [];
|
let reserveSymbols: string[] = [];
|
||||||
|
|
||||||
|
@ -529,10 +434,19 @@ export const initTokenReservesByHelper = async (
|
||||||
console.log(`- Skipping ${symbol} due already initialized`);
|
console.log(`- Skipping ${symbol} due already initialized`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let stableTokenImpl = await getAddressById(`stableDebt${symbol}`, network);
|
let stableTokenImpl = await getAddressById(`stableDebtTokenImpl`, network);
|
||||||
let variableTokenImpl = await getAddressById(`variableDebt${symbol}`, network);
|
let variableTokenImpl = await getAddressById(`variableDebtTokenImpl`, network);
|
||||||
let aTokenImplementation = await getAddressById(`a${symbol}`, network);
|
let aTokenImplementation: string | undefined = "";
|
||||||
let strategyImpl = await getAddressById(`strategy${symbol}`, network);
|
const [, { aTokenImpl, strategy }] = (Object.entries(reservesParams) as [string, IReserveParams][])[
|
||||||
|
reserveParamIndex
|
||||||
|
];
|
||||||
|
if (aTokenImpl === eContractid.AToken) {
|
||||||
|
aTokenImplementation = await getAddressById(`aTokenImpl`, network);
|
||||||
|
} else if (aTokenImpl === eContractid.DelegationAwareAToken) {
|
||||||
|
aTokenImplementation = await getAddressById(`delegationAwareATokenImpl`, network);
|
||||||
|
}
|
||||||
|
|
||||||
|
let strategyImpl = await getAddressById(strategy.name, network);
|
||||||
|
|
||||||
if (!stableTokenImpl) {
|
if (!stableTokenImpl) {
|
||||||
const stableDebt = await deployStableDebtToken(
|
const stableDebt = await deployStableDebtToken(
|
||||||
|
@ -582,14 +496,17 @@ export const initTokenReservesByHelper = async (
|
||||||
const [
|
const [
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
|
strategy
|
||||||
|
},
|
||||||
|
] = (Object.entries(reservesParams) as [string, IReserveParams][])[reserveParamIndex];
|
||||||
|
const {
|
||||||
optimalUtilizationRate,
|
optimalUtilizationRate,
|
||||||
baseVariableBorrowRate,
|
baseVariableBorrowRate,
|
||||||
variableRateSlope1,
|
variableRateSlope1,
|
||||||
variableRateSlope2,
|
variableRateSlope2,
|
||||||
stableRateSlope1,
|
stableRateSlope1,
|
||||||
stableRateSlope2,
|
stableRateSlope2,
|
||||||
},
|
} = strategy;
|
||||||
] = (Object.entries(reservesParams) as [string, IReserveParams][])[reserveParamIndex];
|
|
||||||
const rates = await deployDefaultReserveInterestRateStrategy(
|
const rates = await deployDefaultReserveInterestRateStrategy(
|
||||||
[
|
[
|
||||||
tokenAddresses[symbol],
|
tokenAddresses[symbol],
|
||||||
|
@ -604,19 +521,19 @@ export const initTokenReservesByHelper = async (
|
||||||
);
|
);
|
||||||
strategyImpl = rates.address;
|
strategyImpl = rates.address;
|
||||||
}
|
}
|
||||||
const symbols = [`a${symbol}`, `variableDebt${symbol}`, `stableDebt${symbol}`];
|
// --- REMOVED BECAUSE WE NOW USE THE SAME IMPLEMENTATIONS ---
|
||||||
const tokens = [aTokenImplementation, variableTokenImpl, stableTokenImpl];
|
// const symbols = [`a${symbol}`, `variableDebt${symbol}`, `stableDebt${symbol}`];
|
||||||
for (let index = 0; index < symbols.length; index++) {
|
// const tokens = [aTokenImplementation, variableTokenImpl, stableTokenImpl];
|
||||||
if (!(await isErc20SymbolCorrect(tokens[index], symbols[index]))) {
|
// for (let index = 0; index < symbols.length; index++) {
|
||||||
console.error(`${symbol} and implementation does not match: ${tokens[index]}`);
|
// if (!(await isErc20SymbolCorrect(tokens[index], symbols[index]))) {
|
||||||
throw Error('Symbol does not match implementation.');
|
// console.error(`${symbol} and implementation does not match: ${tokens[index]}`);
|
||||||
}
|
// throw Error('Symbol does not match implementation.');
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
console.log(`- Added ${symbol} to the initialize batch`);
|
console.log(`- Added ${symbol} to the initialize batch`);
|
||||||
deployedStableTokens.push(stableTokenImpl);
|
deployedStableTokens.push(stableTokenImpl);
|
||||||
deployedVariableTokens.push(variableTokenImpl);
|
deployedVariableTokens.push(variableTokenImpl);
|
||||||
deployedATokens.push(aTokenImplementation);
|
deployedATokens.push(aTokenImplementation);
|
||||||
reserveTokens.push();
|
|
||||||
deployedRates.push(strategyImpl);
|
deployedRates.push(strategyImpl);
|
||||||
reserveInitDecimals.push(decimals.toString());
|
reserveInitDecimals.push(decimals.toString());
|
||||||
reserveSymbols.push(symbol);
|
reserveSymbols.push(symbol);
|
||||||
|
|
|
@ -329,16 +329,26 @@ export enum TokenContractId {
|
||||||
export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams {
|
export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams {
|
||||||
aTokenImpl: eContractid;
|
aTokenImpl: eContractid;
|
||||||
reserveFactor: string;
|
reserveFactor: string;
|
||||||
strategy: string;
|
strategy: IInterestRateStrategyParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReserveBorrowParams {
|
export interface IInterestRateStrategyParams {
|
||||||
|
name: string,
|
||||||
optimalUtilizationRate: string;
|
optimalUtilizationRate: string;
|
||||||
baseVariableBorrowRate: string;
|
baseVariableBorrowRate: string;
|
||||||
variableRateSlope1: string;
|
variableRateSlope1: string;
|
||||||
variableRateSlope2: string;
|
variableRateSlope2: string;
|
||||||
stableRateSlope1: string;
|
stableRateSlope1: string;
|
||||||
stableRateSlope2: string;
|
stableRateSlope2: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IReserveBorrowParams {
|
||||||
|
// optimalUtilizationRate: string;
|
||||||
|
// baseVariableBorrowRate: string;
|
||||||
|
// variableRateSlope1: string;
|
||||||
|
// variableRateSlope2: string;
|
||||||
|
// stableRateSlope1: string;
|
||||||
|
// stableRateSlope2: string;
|
||||||
borrowingEnabled: boolean;
|
borrowingEnabled: boolean;
|
||||||
stableBorrowRateEnabled: boolean;
|
stableBorrowRateEnabled: boolean;
|
||||||
reserveDecimals: string;
|
reserveDecimals: string;
|
||||||
|
|
91
markets/aave/rateStrategies.ts
Normal file
91
markets/aave/rateStrategies.ts
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
import BigNumber from 'bignumber.js';
|
||||||
|
import { oneRay } from '../../helpers/constants';
|
||||||
|
import { IInterestRateStrategyParams } from '../../helpers/types';
|
||||||
|
|
||||||
|
// BUSD SUSD
|
||||||
|
export const rateStrategyStableOne: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyStableOne",
|
||||||
|
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(1).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope1: '0',
|
||||||
|
stableRateSlope2: '0',
|
||||||
|
};
|
||||||
|
|
||||||
|
// DAI TUSD
|
||||||
|
export const rateStrategyStableTwo: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyStableTwo",
|
||||||
|
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(),
|
||||||
|
}
|
||||||
|
|
||||||
|
// USDC USDT
|
||||||
|
export const rateStrategyStableThree: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyStableThree",
|
||||||
|
optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(),
|
||||||
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(),
|
||||||
|
}
|
||||||
|
|
||||||
|
// WETH
|
||||||
|
export const rateStrategyWETH: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyWETH",
|
||||||
|
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
||||||
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
||||||
|
}
|
||||||
|
|
||||||
|
// AAVE
|
||||||
|
export const rateStrategyAAVE: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyAAVE",
|
||||||
|
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
||||||
|
baseVariableBorrowRate: '0',
|
||||||
|
variableRateSlope1: '0',
|
||||||
|
variableRateSlope2: '0',
|
||||||
|
stableRateSlope1: '0',
|
||||||
|
stableRateSlope2: '0',
|
||||||
|
}
|
||||||
|
|
||||||
|
// BAT ENJ LINK MANA MKR REN YFI ZRX
|
||||||
|
export const rateStrategyVolatileOne: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyVolatileOne",
|
||||||
|
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
||||||
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
||||||
|
}
|
||||||
|
|
||||||
|
// KNC WBTC
|
||||||
|
export const rateStrategyVolatileTwo: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyVolatileTwo",
|
||||||
|
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
||||||
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
||||||
|
}
|
||||||
|
|
||||||
|
// SNX
|
||||||
|
export const rateStrategyVolatileThree: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyVolatileThree",
|
||||||
|
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
||||||
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
||||||
|
}
|
|
@ -1,15 +1,19 @@
|
||||||
import BigNumber from 'bignumber.js';
|
// import BigNumber from 'bignumber.js';
|
||||||
import { oneRay } from '../../helpers/constants';
|
// import { oneRay } from '../../helpers/constants';
|
||||||
import { eContractid, IReserveParams } from '../../helpers/types';
|
import { eContractid, IReserveParams } from '../../helpers/types';
|
||||||
|
import {
|
||||||
|
rateStrategyStableOne,
|
||||||
|
rateStrategyStableTwo,
|
||||||
|
rateStrategyStableThree,
|
||||||
|
rateStrategyWETH,
|
||||||
|
rateStrategyAAVE,
|
||||||
|
rateStrategyVolatileOne,
|
||||||
|
rateStrategyVolatileTwo,
|
||||||
|
rateStrategyVolatileThree,
|
||||||
|
} from './rateStrategies';
|
||||||
|
|
||||||
export const strategyBUSD: IReserveParams = {
|
export const strategyBUSD: IReserveParams = {
|
||||||
strategy: "busd",
|
strategy: rateStrategyStableOne,
|
||||||
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(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '0',
|
baseLTVAsCollateral: '0',
|
||||||
liquidationThreshold: '0',
|
liquidationThreshold: '0',
|
||||||
liquidationBonus: '0',
|
liquidationBonus: '0',
|
||||||
|
@ -21,13 +25,7 @@ export const strategyBUSD: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyDAI: IReserveParams = {
|
export const strategyDAI: IReserveParams = {
|
||||||
strategy: "dai",
|
strategy: rateStrategyStableTwo,
|
||||||
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: '7500',
|
baseLTVAsCollateral: '7500',
|
||||||
liquidationThreshold: '8000',
|
liquidationThreshold: '8000',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -39,13 +37,7 @@ export const strategyDAI: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategySUSD: IReserveParams = {
|
export const strategySUSD: IReserveParams = {
|
||||||
strategy: "susd",
|
strategy: rateStrategyStableOne,
|
||||||
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(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '0',
|
baseLTVAsCollateral: '0',
|
||||||
liquidationThreshold: '0',
|
liquidationThreshold: '0',
|
||||||
liquidationBonus: '0',
|
liquidationBonus: '0',
|
||||||
|
@ -57,13 +49,7 @@ export const strategySUSD: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyTUSD: IReserveParams = {
|
export const strategyTUSD: IReserveParams = {
|
||||||
strategy: "tusd",
|
strategy: rateStrategyStableTwo,
|
||||||
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: '7500',
|
baseLTVAsCollateral: '7500',
|
||||||
liquidationThreshold: '8000',
|
liquidationThreshold: '8000',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -75,13 +61,7 @@ export const strategyTUSD: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyUSDC: IReserveParams = {
|
export const strategyUSDC: IReserveParams = {
|
||||||
strategy: "usdc",
|
strategy: rateStrategyStableThree,
|
||||||
optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '8000',
|
baseLTVAsCollateral: '8000',
|
||||||
liquidationThreshold: '8500',
|
liquidationThreshold: '8500',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -93,13 +73,7 @@ export const strategyUSDC: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyUSDT: IReserveParams = {
|
export const strategyUSDT: IReserveParams = {
|
||||||
strategy: "usdt",
|
strategy: rateStrategyStableThree,
|
||||||
optimalUtilizationRate: new BigNumber(0.9).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(0.60).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '8000',
|
baseLTVAsCollateral: '8000',
|
||||||
liquidationThreshold: '8500',
|
liquidationThreshold: '8500',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -111,13 +85,7 @@ export const strategyUSDT: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyAAVE: IReserveParams = {
|
export const strategyAAVE: IReserveParams = {
|
||||||
strategy: "aave",
|
strategy: rateStrategyAAVE,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: '0',
|
|
||||||
variableRateSlope1: '0',
|
|
||||||
variableRateSlope2: '0',
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '5000',
|
baseLTVAsCollateral: '5000',
|
||||||
liquidationThreshold: '6500',
|
liquidationThreshold: '6500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -129,13 +97,7 @@ export const strategyAAVE: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyBAT: IReserveParams = {
|
export const strategyBAT: IReserveParams = {
|
||||||
strategy: "bat",
|
strategy: rateStrategyVolatileOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '7000',
|
baseLTVAsCollateral: '7000',
|
||||||
liquidationThreshold: '7500',
|
liquidationThreshold: '7500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -147,13 +109,7 @@ export const strategyBAT: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyENJ: IReserveParams = {
|
export const strategyENJ: IReserveParams = {
|
||||||
strategy: "enj",
|
strategy: rateStrategyVolatileOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '5500',
|
baseLTVAsCollateral: '5500',
|
||||||
liquidationThreshold: '6000',
|
liquidationThreshold: '6000',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -165,13 +121,7 @@ export const strategyENJ: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyWETH: IReserveParams = {
|
export const strategyWETH: IReserveParams = {
|
||||||
strategy: "weth",
|
strategy: rateStrategyWETH,
|
||||||
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '8000',
|
baseLTVAsCollateral: '8000',
|
||||||
liquidationThreshold: '8250',
|
liquidationThreshold: '8250',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -183,13 +133,7 @@ export const strategyWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyKNC: IReserveParams = {
|
export const strategyKNC: IReserveParams = {
|
||||||
strategy: "knc",
|
strategy: rateStrategyVolatileTwo,
|
||||||
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '6500',
|
liquidationThreshold: '6500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -201,13 +145,7 @@ export const strategyKNC: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyLINK: IReserveParams = {
|
export const strategyLINK: IReserveParams = {
|
||||||
strategy: "link",
|
strategy: rateStrategyVolatileOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '7000',
|
baseLTVAsCollateral: '7000',
|
||||||
liquidationThreshold: '7500',
|
liquidationThreshold: '7500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -219,13 +157,7 @@ export const strategyLINK: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyMANA: IReserveParams = {
|
export const strategyMANA: IReserveParams = {
|
||||||
strategy: "mana",
|
strategy: rateStrategyVolatileOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '6500',
|
liquidationThreshold: '6500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -237,13 +169,7 @@ export const strategyMANA: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyMKR: IReserveParams = {
|
export const strategyMKR: IReserveParams = {
|
||||||
strategy: "mkr",
|
strategy: rateStrategyVolatileOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '6500',
|
liquidationThreshold: '6500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -255,13 +181,7 @@ export const strategyMKR: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyREN: IReserveParams = {
|
export const strategyREN: IReserveParams = {
|
||||||
strategy: "ren",
|
strategy: rateStrategyVolatileOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '5500',
|
baseLTVAsCollateral: '5500',
|
||||||
liquidationThreshold: '6000',
|
liquidationThreshold: '6000',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -273,13 +193,7 @@ export const strategyREN: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategySNX: IReserveParams = {
|
export const strategySNX: IReserveParams = {
|
||||||
strategy: "snx",
|
strategy: rateStrategyVolatileThree,
|
||||||
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.12).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '1500',
|
baseLTVAsCollateral: '1500',
|
||||||
liquidationThreshold: '4000',
|
liquidationThreshold: '4000',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -290,14 +204,9 @@ export const strategySNX: IReserveParams = {
|
||||||
reserveFactor: '3500'
|
reserveFactor: '3500'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Invalid borrow rates in params currently, replaced with snx params
|
||||||
export const strategyUNI: IReserveParams = {
|
export const strategyUNI: IReserveParams = {
|
||||||
strategy: "uni",
|
strategy: rateStrategyVolatileThree,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: '0',
|
|
||||||
variableRateSlope1: '0',
|
|
||||||
variableRateSlope2: '0',
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '6500',
|
liquidationThreshold: '6500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -309,13 +218,7 @@ export const strategyUNI: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyWBTC: IReserveParams = {
|
export const strategyWBTC: IReserveParams = {
|
||||||
strategy: "wbtc",
|
strategy: rateStrategyVolatileTwo,
|
||||||
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: '0',
|
|
||||||
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '7000',
|
baseLTVAsCollateral: '7000',
|
||||||
liquidationThreshold: '7500',
|
liquidationThreshold: '7500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -327,13 +230,7 @@ export const strategyWBTC: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyYFI: IReserveParams = {
|
export const strategyYFI: IReserveParams = {
|
||||||
strategy: "yfi",
|
strategy: rateStrategyVolatileOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: '0',
|
|
||||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '4000',
|
baseLTVAsCollateral: '4000',
|
||||||
liquidationThreshold: '5500',
|
liquidationThreshold: '5500',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -345,13 +242,7 @@ export const strategyYFI: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyZRX: IReserveParams = {
|
export const strategyZRX: IReserveParams = {
|
||||||
strategy: "zrx",
|
strategy: rateStrategyVolatileOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: '0',
|
|
||||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '6500',
|
liquidationThreshold: '6500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
|
36
markets/lp/rateStrategies.ts
Normal file
36
markets/lp/rateStrategies.ts
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import BigNumber from 'bignumber.js';
|
||||||
|
import { oneRay } from '../../helpers/constants';
|
||||||
|
import { IInterestRateStrategyParams } from '../../helpers/types';
|
||||||
|
|
||||||
|
// DAIWETH WBTCWETH AAVEWETH BATWETH USDCDAI CRVWETH LINKWETH MKRWETH RENWETH SNXWETH UNIWETH USDCWETH WBTCUSDC YFIWETH
|
||||||
|
export const rateStrategyLpBase: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyLpBase",
|
||||||
|
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
||||||
|
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope1: '0',
|
||||||
|
stableRateSlope2: '0',
|
||||||
|
}
|
||||||
|
|
||||||
|
// WETH WBTC
|
||||||
|
export const rateStrategyBaseOne: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyBaseOne",
|
||||||
|
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
||||||
|
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
||||||
|
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
||||||
|
stableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
||||||
|
}
|
||||||
|
|
||||||
|
// DAI USDC USDT
|
||||||
|
export const rateStrategyStable: IInterestRateStrategyParams = {
|
||||||
|
name: "rateStrategyStable",
|
||||||
|
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.60).multipliedBy(oneRay).toFixed(),
|
||||||
|
}
|
|
@ -1,15 +1,13 @@
|
||||||
import BigNumber from 'bignumber.js';
|
|
||||||
import { oneRay } from '../../helpers/constants';
|
|
||||||
import { eContractid, IReserveParams} from '../../helpers/types';
|
import { eContractid, IReserveParams} from '../../helpers/types';
|
||||||
|
import {
|
||||||
|
rateStrategyLpBase,
|
||||||
|
rateStrategyStable,
|
||||||
|
rateStrategyBaseOne,
|
||||||
|
} from './rateStrategies';
|
||||||
|
|
||||||
|
|
||||||
export const strategyWETH: IReserveParams = {
|
export const strategyWETH: IReserveParams = {
|
||||||
strategy: 'WETH and WBTC',
|
strategy: rateStrategyBaseOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '8000',
|
baseLTVAsCollateral: '8000',
|
||||||
liquidationThreshold: '8250',
|
liquidationThreshold: '8250',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -21,13 +19,7 @@ export const strategyWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyWBTC: IReserveParams = {
|
export const strategyWBTC: IReserveParams = {
|
||||||
strategy: 'WETH and WBTC',
|
strategy: rateStrategyBaseOne,
|
||||||
optimalUtilizationRate: new BigNumber(0.65).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: new BigNumber(0.1).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '7000',
|
baseLTVAsCollateral: '7000',
|
||||||
liquidationThreshold: '7500',
|
liquidationThreshold: '7500',
|
||||||
liquidationBonus: '11000',
|
liquidationBonus: '11000',
|
||||||
|
@ -39,13 +31,7 @@ export const strategyWBTC: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyDAI: IReserveParams = {
|
export const strategyDAI: IReserveParams = {
|
||||||
strategy: 'stablecoin',
|
strategy: rateStrategyStable,
|
||||||
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.60).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '7500',
|
baseLTVAsCollateral: '7500',
|
||||||
liquidationThreshold: '8000',
|
liquidationThreshold: '8000',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -57,13 +43,7 @@ export const strategyDAI: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyUSDC: IReserveParams = {
|
export const strategyUSDC: IReserveParams = {
|
||||||
strategy: 'stablecoin',
|
strategy: rateStrategyStable,
|
||||||
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.60).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '8000',
|
baseLTVAsCollateral: '8000',
|
||||||
liquidationThreshold: '8500',
|
liquidationThreshold: '8500',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -75,13 +55,7 @@ export const strategyUSDC: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyUSDT: IReserveParams = {
|
export const strategyUSDT: IReserveParams = {
|
||||||
strategy: 'stablecoin',
|
strategy: rateStrategyStable,
|
||||||
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.60).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseLTVAsCollateral: '-1',
|
baseLTVAsCollateral: '-1',
|
||||||
liquidationThreshold: '8500',
|
liquidationThreshold: '8500',
|
||||||
liquidationBonus: '10500',
|
liquidationBonus: '10500',
|
||||||
|
@ -93,13 +67,7 @@ export const strategyUSDT: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyDAIWETH: IReserveParams = {
|
export const strategyDAIWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -111,13 +79,7 @@ export const strategyDAIWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyWBTCWETH: IReserveParams = {
|
export const strategyWBTCWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -129,13 +91,7 @@ export const strategyWBTCWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyAAVEWETH: IReserveParams = {
|
export const strategyAAVEWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -147,13 +103,7 @@ export const strategyAAVEWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyBATWETH: IReserveParams = {
|
export const strategyBATWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -165,13 +115,7 @@ export const strategyBATWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyUSDCDAI: IReserveParams = {
|
export const strategyUSDCDAI: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -183,13 +127,7 @@ export const strategyUSDCDAI: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyCRVWETH: IReserveParams = {
|
export const strategyCRVWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '5000',
|
baseLTVAsCollateral: '5000',
|
||||||
liquidationThreshold: '6000',
|
liquidationThreshold: '6000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -201,13 +139,7 @@ export const strategyCRVWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyLINKWETH: IReserveParams = {
|
export const strategyLINKWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -219,13 +151,7 @@ export const strategyLINKWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyMKRWETH: IReserveParams = {
|
export const strategyMKRWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -237,13 +163,7 @@ export const strategyMKRWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyRENWETH: IReserveParams = {
|
export const strategyRENWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -255,13 +175,7 @@ export const strategyRENWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategySNXWETH: IReserveParams = {
|
export const strategySNXWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '4000',
|
baseLTVAsCollateral: '4000',
|
||||||
liquidationThreshold: '6000',
|
liquidationThreshold: '6000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -273,13 +187,7 @@ export const strategySNXWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyUNIWETH: IReserveParams = {
|
export const strategyUNIWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -291,13 +199,7 @@ export const strategyUNIWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyUSDCWETH: IReserveParams = {
|
export const strategyUSDCWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -309,13 +211,7 @@ export const strategyUSDCWETH: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyWBTCUSDC: IReserveParams = {
|
export const strategyWBTCUSDC: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '6000',
|
baseLTVAsCollateral: '6000',
|
||||||
liquidationThreshold: '7000',
|
liquidationThreshold: '7000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
@ -327,13 +223,7 @@ export const strategyWBTCUSDC: IReserveParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const strategyYFIWETH: IReserveParams = {
|
export const strategyYFIWETH: IReserveParams = {
|
||||||
strategy: 'uniswap LP base',
|
strategy: rateStrategyLpBase,
|
||||||
optimalUtilizationRate: new BigNumber(0.45).multipliedBy(oneRay).toFixed(),
|
|
||||||
baseVariableBorrowRate: new BigNumber(0.03).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope1: new BigNumber(0.10).multipliedBy(oneRay).toFixed(),
|
|
||||||
variableRateSlope2: new BigNumber(3.00).multipliedBy(oneRay).toFixed(),
|
|
||||||
stableRateSlope1: '0',
|
|
||||||
stableRateSlope2: '0',
|
|
||||||
baseLTVAsCollateral: '5000',
|
baseLTVAsCollateral: '5000',
|
||||||
liquidationThreshold: '6000',
|
liquidationThreshold: '6000',
|
||||||
liquidationBonus: '11500',
|
liquidationBonus: '11500',
|
||||||
|
|
|
@ -52,7 +52,7 @@ task('verify:tokens', 'Deploy oracles for dev enviroment')
|
||||||
variableRateSlope2,
|
variableRateSlope2,
|
||||||
stableRateSlope1,
|
stableRateSlope1,
|
||||||
stableRateSlope2,
|
stableRateSlope2,
|
||||||
} = tokenConfig[1];
|
} = tokenConfig[1].strategy;
|
||||||
|
|
||||||
console.log;
|
console.log;
|
||||||
// Proxy Stable Debt
|
// Proxy Stable Debt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user