aave-protocol-v2/helpers/types.ts

560 lines
18 KiB
TypeScript
Raw Permalink Normal View History

2020-07-13 08:54:08 +00:00
import BigNumber from 'bignumber.js';
2020-08-25 12:15:35 +00:00
export interface SymbolMap<T> {
[symbol: string]: T;
}
2020-05-29 14:55:31 +00:00
export type eNetwork = eEthereumNetwork | ePolygonNetwork | eXDaiNetwork | eAvalancheNetwork;
2020-05-29 14:55:31 +00:00
export enum eEthereumNetwork {
2020-07-13 08:54:08 +00:00
buidlerevm = 'buidlerevm',
kovan = 'kovan',
ropsten = 'ropsten',
main = 'main',
2020-09-14 17:59:00 +00:00
coverage = 'coverage',
2020-11-05 11:18:20 +00:00
hardhat = 'hardhat',
tenderly = 'tenderly',
2021-02-22 09:44:10 +00:00
}
export enum ePolygonNetwork {
2021-02-19 21:44:27 +00:00
matic = 'matic',
mumbai = 'mumbai',
2021-02-22 09:44:10 +00:00
}
export enum eXDaiNetwork {
xdai = 'xdai',
}
export enum eAvalancheNetwork {
avalanche = 'avalanche',
fuji = 'fuji',
}
2020-09-15 15:24:50 +00:00
export enum EthereumNetworkNames {
kovan = 'kovan',
ropsten = 'ropsten',
main = 'main',
matic = 'matic',
mumbai = 'mumbai',
2021-02-22 09:44:10 +00:00
xdai = 'xdai',
avalanche = 'avalanche',
fuji = 'fuji',
}
export enum AavePools {
2020-07-13 08:54:08 +00:00
proto = 'proto',
matic = 'matic',
amm = 'amm',
avalanche = 'avalanche',
2020-05-29 14:55:31 +00:00
}
export enum eContractid {
2020-07-13 08:54:08 +00:00
Example = 'Example',
LendingPoolAddressesProvider = 'LendingPoolAddressesProvider',
MintableERC20 = 'MintableERC20',
2020-11-02 13:44:11 +00:00
MintableDelegationERC20 = 'MintableDelegationERC20',
2020-07-13 08:54:08 +00:00
LendingPoolAddressesProviderRegistry = 'LendingPoolAddressesProviderRegistry',
LendingPoolParametersProvider = 'LendingPoolParametersProvider',
LendingPoolConfigurator = 'LendingPoolConfigurator',
ValidationLogic = 'ValidationLogic',
ReserveLogic = 'ReserveLogic',
GenericLogic = 'GenericLogic',
LendingPool = 'LendingPool',
PriceOracle = 'PriceOracle',
Proxy = 'Proxy',
MockAggregator = 'MockAggregator',
LendingRateOracle = 'LendingRateOracle',
AaveOracle = 'AaveOracle',
2020-07-13 08:54:08 +00:00
DefaultReserveInterestRateStrategy = 'DefaultReserveInterestRateStrategy',
LendingPoolCollateralManager = 'LendingPoolCollateralManager',
2020-07-13 08:54:08 +00:00
InitializableAdminUpgradeabilityProxy = 'InitializableAdminUpgradeabilityProxy',
MockFlashLoanReceiver = 'MockFlashLoanReceiver',
WalletBalanceProvider = 'WalletBalanceProvider',
AToken = 'AToken',
2020-08-10 18:20:08 +00:00
MockAToken = 'MockAToken',
DelegationAwareAToken = 'DelegationAwareAToken',
MockStableDebtToken = 'MockStableDebtToken',
MockVariableDebtToken = 'MockVariableDebtToken',
AaveProtocolDataProvider = 'AaveProtocolDataProvider',
2020-07-13 08:54:08 +00:00
IERC20Detailed = 'IERC20Detailed',
StableDebtToken = 'StableDebtToken',
VariableDebtToken = 'VariableDebtToken',
2020-08-21 15:34:43 +00:00
FeeProvider = 'FeeProvider',
TokenDistributor = 'TokenDistributor',
StableAndVariableTokensHelper = 'StableAndVariableTokensHelper',
ATokensAndRatesHelper = 'ATokensAndRatesHelper',
UiPoolDataProvider = 'UiPoolDataProvider',
UiPoolDataProviderV2 = 'UiPoolDataProviderV2',
2021-12-17 15:23:11 +00:00
UiPoolDataProviderV2V3 = 'UiPoolDataProviderV2V3',
WETHGateway = 'WETHGateway',
WETH = 'WETH',
2020-10-29 11:44:21 +00:00
WETHMocked = 'WETHMocked',
SelfdestructTransferMock = 'SelfdestructTransferMock',
LendingPoolImpl = 'LendingPoolImpl',
LendingPoolConfiguratorImpl = 'LendingPoolConfiguratorImpl',
LendingPoolCollateralManagerImpl = 'LendingPoolCollateralManagerImpl',
2020-10-27 12:18:30 +00:00
MockUniswapV2Router02 = 'MockUniswapV2Router02',
UniswapLiquiditySwapAdapter = 'UniswapLiquiditySwapAdapter',
UniswapRepayAdapter = 'UniswapRepayAdapter',
FlashLiquidationAdapter = 'FlashLiquidationAdapter',
MockParaSwapAugustus = 'MockParaSwapAugustus',
MockParaSwapAugustusRegistry = 'MockParaSwapAugustusRegistry',
ParaSwapLiquiditySwapAdapter = 'ParaSwapLiquiditySwapAdapter',
2021-12-17 15:23:11 +00:00
UiIncentiveDataProviderV2V3 = 'UiIncentiveDataProviderV2V3',
UiIncentiveDataProviderV2 = 'UiIncentiveDataProviderV2',
2020-05-29 14:55:31 +00:00
}
/*
* Error messages prefix glossary:
* - VL = ValidationLogic
* - MATH = Math libraries
* - AT = aToken or DebtTokens
* - LP = LendingPool
* - LPAPR = LendingPoolAddressesProviderRegistry
* - LPC = LendingPoolConfiguration
* - RL = ReserveLogic
* - LPCM = LendingPoolCollateralManager
* - P = Pausable
*/
export enum ProtocolErrors {
2020-11-02 13:44:11 +00:00
//common errors
2020-11-05 11:35:50 +00:00
CALLER_NOT_POOL_ADMIN = '33', // 'The caller must be the pool admin'
2020-11-02 13:44:11 +00:00
//contract specific errors
2020-11-10 13:11:01 +00:00
VL_INVALID_AMOUNT = '1', // 'Amount must be greater than 0'
VL_NO_ACTIVE_RESERVE = '2', // 'Action requires an active reserve'
2020-10-31 12:47:16 +00:00
VL_RESERVE_FROZEN = '3', // 'Action requires an unfrozen reserve'
VL_CURRENT_AVAILABLE_LIQUIDITY_NOT_ENOUGH = '4', // 'The current liquidity is not enough'
VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE = '5', // 'User cannot withdraw more than the available balance'
VL_TRANSFER_NOT_ALLOWED = '6', // 'Transfer cannot be allowed.'
VL_BORROWING_NOT_ENABLED = '7', // 'Borrowing is not enabled'
VL_INVALID_INTEREST_RATE_MODE_SELECTED = '8', // 'Invalid interest rate mode selected'
VL_COLLATERAL_BALANCE_IS_0 = '9', // 'The collateral balance is 0'
VL_HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '10', // 'Health factor is lesser than the liquidation threshold'
VL_COLLATERAL_CANNOT_COVER_NEW_BORROW = '11', // 'There is not enough collateral to cover a new borrow'
VL_STABLE_BORROWING_NOT_ENABLED = '12', // stable borrowing not enabled
2020-10-31 12:10:26 +00:00
VL_COLLATERAL_SAME_AS_BORROWING_CURRENCY = '13', // collateral is (mostly) the same currency that is being borrowed
VL_AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '14', // 'The requested amount is greater than the max loan size in stable rate mode
VL_NO_DEBT_OF_SELECTED_TYPE = '15', // 'for repayment of stable debt, the user needs to have stable debt, otherwise, he needs to have variable debt'
VL_NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '16', // 'To repay on behalf of an user an explicit amount to repay is needed'
VL_NO_STABLE_RATE_LOAN_IN_RESERVE = '17', // 'User does not have a stable rate loan in progress on this reserve'
VL_NO_VARIABLE_RATE_LOAN_IN_RESERVE = '18', // 'User does not have a variable rate loan in progress on this reserve'
VL_UNDERLYING_BALANCE_NOT_GREATER_THAN_0 = '19', // 'The underlying balance needs to be greater than 0'
VL_DEPOSIT_ALREADY_IN_USE = '20', // 'User deposit is already being used as collateral'
LP_NOT_ENOUGH_STABLE_BORROW_BALANCE = '21', // 'User does not have any stable rate loan for this reserve'
LP_INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '22', // 'Interest rate rebalance conditions were not met'
LP_LIQUIDATION_CALL_FAILED = '23', // 'Liquidation call failed'
LP_NOT_ENOUGH_LIQUIDITY_TO_BORROW = '24', // 'There is not enough liquidity available to borrow'
LP_REQUESTED_AMOUNT_TOO_SMALL = '25', // 'The requested amount is too small for a FlashLoan.'
LP_INCONSISTENT_PROTOCOL_ACTUAL_BALANCE = '26', // 'The actual balance of the protocol is inconsistent'
2020-11-05 11:35:50 +00:00
LP_CALLER_NOT_LENDING_POOL_CONFIGURATOR = '27', // 'The caller is not the lending pool configurator'
2020-10-30 12:40:06 +00:00
LP_INCONSISTENT_FLASHLOAN_PARAMS = '28',
2020-11-12 12:54:23 +00:00
CT_CALLER_MUST_BE_LENDING_POOL = '29', // 'The caller of this function must be a lending pool'
CT_CANNOT_GIVE_ALLOWANCE_TO_HIMSELF = '30', // 'User cannot give allowance to himself'
CT_TRANSFER_AMOUNT_NOT_GT_0 = '31', // 'Transferred amount needs to be greater than zero'
2020-10-30 12:40:06 +00:00
RL_RESERVE_ALREADY_INITIALIZED = '32', // 'Reserve has already been initialized'
LPC_RESERVE_LIQUIDITY_NOT_0 = '34', // 'The liquidity of the reserve needs to be 0'
LPC_INVALID_ATOKEN_POOL_ADDRESS = '35', // 'The liquidity of the reserve needs to be 0'
LPC_INVALID_STABLE_DEBT_TOKEN_POOL_ADDRESS = '36', // 'The liquidity of the reserve needs to be 0'
LPC_INVALID_VARIABLE_DEBT_TOKEN_POOL_ADDRESS = '37', // 'The liquidity of the reserve needs to be 0'
LPC_INVALID_STABLE_DEBT_TOKEN_UNDERLYING_ADDRESS = '38', // 'The liquidity of the reserve needs to be 0'
LPC_INVALID_VARIABLE_DEBT_TOKEN_UNDERLYING_ADDRESS = '39', // 'The liquidity of the reserve needs to be 0'
LPC_INVALID_ADDRESSES_PROVIDER_ID = '40', // 'The liquidity of the reserve needs to be 0'
2020-11-05 11:35:50 +00:00
LPC_CALLER_NOT_EMERGENCY_ADMIN = '76', // 'The caller must be the emergencya admin'
2020-10-30 12:40:06 +00:00
LPAPR_PROVIDER_NOT_REGISTERED = '41', // 'Provider is not registered'
LPCM_HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '42', // 'Health factor is not below the threshold'
LPCM_COLLATERAL_CANNOT_BE_LIQUIDATED = '43', // 'The collateral chosen cannot be liquidated'
LPCM_SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER = '44', // 'User did not borrow the specified currency'
LPCM_NOT_ENOUGH_LIQUIDITY_TO_LIQUIDATE = '45', // "There isn't enough liquidity available to liquidate"
LPCM_NO_ERRORS = '46', // 'No errors'
LP_INVALID_FLASHLOAN_MODE = '47', //Invalid flashloan mode selected
MATH_MULTIPLICATION_OVERFLOW = '48',
MATH_ADDITION_OVERFLOW = '49',
MATH_DIVISION_BY_ZERO = '50',
RL_LIQUIDITY_INDEX_OVERFLOW = '51', // Liquidity index overflows uint128
RL_VARIABLE_BORROW_INDEX_OVERFLOW = '52', // Variable borrow index overflows uint128
RL_LIQUIDITY_RATE_OVERFLOW = '53', // Liquidity rate overflows uint128
RL_VARIABLE_BORROW_RATE_OVERFLOW = '54', // Variable borrow rate overflows uint128
RL_STABLE_BORROW_RATE_OVERFLOW = '55', // Stable borrow rate overflows uint128
2020-11-12 12:54:23 +00:00
CT_INVALID_MINT_AMOUNT = '56', //invalid amount to mint
2020-10-30 12:40:06 +00:00
LP_FAILED_REPAY_WITH_COLLATERAL = '57',
2020-11-12 12:54:23 +00:00
CT_INVALID_BURN_AMOUNT = '58', //invalid amount to burn
2020-11-03 11:15:37 +00:00
LP_BORROW_ALLOWANCE_NOT_ENOUGH = '59', // User borrows on behalf, but allowance are too small
2020-10-30 12:40:06 +00:00
LP_FAILED_COLLATERAL_SWAP = '60',
LP_INVALID_EQUAL_ASSETS_TO_SWAP = '61',
LP_REENTRANCY_NOT_ALLOWED = '62',
LP_CALLER_MUST_BE_AN_ATOKEN = '63',
2020-10-31 12:55:19 +00:00
LP_IS_PAUSED = '64', // 'Pool is paused'
2020-10-30 12:40:06 +00:00
LP_NO_MORE_RESERVES_ALLOWED = '65',
LP_INVALID_FLASH_LOAN_EXECUTOR_RETURN = '66',
RC_INVALID_LTV = '67',
RC_INVALID_LIQ_THRESHOLD = '68',
RC_INVALID_LIQ_BONUS = '69',
RC_INVALID_DECIMALS = '70',
RC_INVALID_RESERVE_FACTOR = '71',
LPAPR_INVALID_ADDRESSES_PROVIDER_ID = '72',
// old
2020-07-13 08:54:08 +00:00
INVALID_FROM_BALANCE_AFTER_TRANSFER = 'Invalid from balance after transfer',
INVALID_TO_BALANCE_AFTER_TRANSFER = 'Invalid from balance after transfer',
INVALID_OWNER_REVERT_MSG = 'Ownable: caller is not the owner',
INVALID_HF = 'Invalid health factor',
TRANSFER_AMOUNT_EXCEEDS_BALANCE = 'ERC20: transfer amount exceeds balance',
2020-09-09 19:26:52 +00:00
SAFEERC20_LOWLEVEL_CALL = 'SafeERC20: low-level call failed',
}
2020-05-29 14:55:31 +00:00
export type tEthereumAddress = string;
export type tStringTokenBigUnits = string; // 1 ETH, or 10e6 USDC or 10e18 DAI
export type tBigNumberTokenBigUnits = BigNumber;
export type tStringTokenSmallUnits = string; // 1 wei, or 1 basic unit of USDC, or 1 basic unit of DAI
export type tBigNumberTokenSmallUnits = BigNumber;
export interface iAssetCommon<T> {
[key: string]: T;
}
export interface iAssetBase<T> {
WETH: T;
DAI: T;
TUSD: T;
USDC: T;
USDT: T;
SUSD: T;
AAVE: T;
BAT: T;
MKR: T;
LINK: T;
KNC: T;
WBTC: T;
MANA: T;
ZRX: T;
SNX: T;
BUSD: T;
2020-11-04 10:47:06 +00:00
YFI: T;
UNI: T;
USD: T;
2020-11-04 10:47:06 +00:00
REN: T;
2020-11-04 19:51:45 +00:00
ENJ: T;
2021-02-19 20:50:06 +00:00
UniDAIWETH: T;
UniWBTCWETH: T;
UniAAVEWETH: T;
UniBATWETH: T;
UniDAIUSDC: T;
2021-02-19 20:50:06 +00:00
UniCRVWETH: T;
UniLINKWETH: T;
UniMKRWETH: T;
UniRENWETH: T;
UniSNXWETH: T;
UniUNIWETH: T;
UniUSDCWETH: T;
UniWBTCUSDC: T;
UniYFIWETH: T;
BptWBTCWETH: T;
2021-02-24 22:58:20 +00:00
BptBALWETH: T;
WMATIC: T;
STAKE: T;
2021-02-02 22:06:01 +00:00
xSUSHI: T;
2021-08-27 11:22:07 +00:00
WAVAX: T;
}
2020-07-13 08:54:08 +00:00
export type iAssetsWithoutETH<T> = Omit<iAssetBase<T>, 'ETH'>;
2020-07-13 08:54:08 +00:00
export type iAssetsWithoutUSD<T> = Omit<iAssetBase<T>, 'USD'>;
export type iAavePoolAssets<T> = Pick<
iAssetsWithoutUSD<T>,
2020-07-13 08:54:08 +00:00
| 'DAI'
| 'TUSD'
| 'USDC'
| 'USDT'
| 'SUSD'
| 'AAVE'
2020-07-13 08:54:08 +00:00
| 'BAT'
| 'MKR'
| 'LINK'
| 'KNC'
| 'WBTC'
| 'MANA'
| 'ZRX'
| 'SNX'
| 'BUSD'
| 'WETH'
2020-11-04 10:47:06 +00:00
| 'YFI'
| 'UNI'
| 'REN'
2020-11-04 19:51:45 +00:00
| 'ENJ'
2021-02-02 22:06:01 +00:00
| 'xSUSHI'
>;
export type iLpPoolAssets<T> = Pick<
2020-12-22 23:48:02 +00:00
iAssetsWithoutUSD<T>,
2021-02-19 20:50:06 +00:00
| 'DAI'
| 'USDC'
| 'USDT'
| 'WBTC'
| 'WETH'
| 'UniDAIWETH'
| 'UniWBTCWETH'
| 'UniAAVEWETH'
| 'UniBATWETH'
| 'UniDAIUSDC'
2021-02-19 20:50:06 +00:00
| 'UniCRVWETH'
| 'UniLINKWETH'
| 'UniMKRWETH'
| 'UniRENWETH'
| 'UniSNXWETH'
| 'UniUNIWETH'
| 'UniUSDCWETH'
| 'UniWBTCUSDC'
| 'UniYFIWETH'
| 'BptWBTCWETH'
2021-02-24 22:58:20 +00:00
| 'BptBALWETH'
2020-12-22 23:48:02 +00:00
>;
2021-02-19 22:38:54 +00:00
export type iMaticPoolAssets<T> = Pick<
iAssetsWithoutUSD<T>,
2021-03-29 15:28:20 +00:00
'DAI' | 'USDC' | 'USDT' | 'WBTC' | 'WETH' | 'WMATIC' | 'AAVE'
2021-02-19 22:38:54 +00:00
>;
export type iXDAIPoolAssets<T> = Pick<
iAssetsWithoutUSD<T>,
'DAI' | 'USDC' | 'USDT' | 'WBTC' | 'WETH' | 'STAKE'
>;
export type iAvalanchePoolAssets<T> = Pick<
iAssetsWithoutUSD<T>,
2021-08-27 11:22:07 +00:00
'WETH' | 'DAI' | 'USDT' | 'AAVE' | 'WBTC' | 'WAVAX' | 'USDC'
>;
export type iMultiPoolsAssets<T> = iAssetCommon<T> | iAavePoolAssets<T>;
2020-07-13 08:54:08 +00:00
export type iAavePoolTokens<T> = Omit<iAavePoolAssets<T>, 'ETH'>;
export type iAssetAggregatorBase<T> = iAssetsWithoutETH<T>;
export enum TokenContractId {
2020-07-13 08:54:08 +00:00
DAI = 'DAI',
AAVE = 'AAVE',
2020-07-13 08:54:08 +00:00
TUSD = 'TUSD',
BAT = 'BAT',
WETH = 'WETH',
2020-07-13 08:54:08 +00:00
USDC = 'USDC',
USDT = 'USDT',
SUSD = 'SUSD',
ZRX = 'ZRX',
MKR = 'MKR',
WBTC = 'WBTC',
LINK = 'LINK',
KNC = 'KNC',
MANA = 'MANA',
2020-11-04 10:47:06 +00:00
REN = 'REN',
2020-07-13 08:54:08 +00:00
SNX = 'SNX',
BUSD = 'BUSD',
USD = 'USD',
2020-11-04 10:47:06 +00:00
YFI = 'YFI',
UNI = 'UNI',
2020-11-04 19:51:45 +00:00
ENJ = 'ENJ',
2021-02-19 20:50:06 +00:00
UniDAIWETH = 'UniDAIWETH',
UniWBTCWETH = 'UniWBTCWETH',
UniAAVEWETH = 'UniAAVEWETH',
UniBATWETH = 'UniBATWETH',
UniDAIUSDC = 'UniDAIUSDC',
2021-02-19 20:50:06 +00:00
UniCRVWETH = 'UniCRVWETH',
UniLINKWETH = 'UniLINKWETH',
UniMKRWETH = 'UniMKRWETH',
UniRENWETH = 'UniRENWETH',
UniSNXWETH = 'UniSNXWETH',
UniUNIWETH = 'UniUNIWETH',
UniUSDCWETH = 'UniUSDCWETH',
UniWBTCUSDC = 'UniWBTCUSDC',
UniYFIWETH = 'UniYFIWETH',
BptWBTCWETH = 'BptWBTCWETH',
2021-02-24 22:58:20 +00:00
BptBALWETH = 'BptBALWETH',
WMATIC = 'WMATIC',
STAKE = 'STAKE',
xSUSHI = 'xSUSHI',
2021-08-27 11:22:07 +00:00
WAVAX = 'WAVAX',
}
2020-11-20 11:11:57 +00:00
export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams {
aTokenImpl: eContractid;
reserveFactor: string;
strategy: IInterestRateStrategyParams;
2020-11-20 11:11:57 +00:00
}
export interface IInterestRateStrategyParams {
name: string;
2020-11-19 17:11:53 +00:00
optimalUtilizationRate: string;
baseVariableBorrowRate: string;
variableRateSlope1: string;
variableRateSlope2: string;
stableRateSlope1: string;
stableRateSlope2: string;
}
export interface IReserveBorrowParams {
// optimalUtilizationRate: string;
// baseVariableBorrowRate: string;
// variableRateSlope1: string;
// variableRateSlope2: string;
// stableRateSlope1: string;
// stableRateSlope2: string;
borrowingEnabled: boolean;
stableBorrowRateEnabled: boolean;
reserveDecimals: string;
}
export interface IReserveCollateralParams {
baseLTVAsCollateral: string;
liquidationThreshold: string;
liquidationBonus: string;
}
export interface IMarketRates {
borrowRate: string;
}
2021-02-22 09:44:10 +00:00
export type iParamsPerNetwork<T> =
| iEthereumParamsPerNetwork<T>
| iPolygonParamsPerNetwork<T>
| iXDaiParamsPerNetwork<T>
| iAvalancheParamsPerNetwork<T>;
2021-02-22 09:44:10 +00:00
export interface iParamsPerNetworkAll<T>
extends iEthereumParamsPerNetwork<T>,
iPolygonParamsPerNetwork<T>,
iXDaiParamsPerNetwork<T> {}
2021-02-22 09:44:10 +00:00
export interface iEthereumParamsPerNetwork<T> {
2020-09-14 13:57:11 +00:00
[eEthereumNetwork.coverage]: T;
[eEthereumNetwork.buidlerevm]: T;
[eEthereumNetwork.kovan]: T;
[eEthereumNetwork.ropsten]: T;
[eEthereumNetwork.main]: T;
2020-11-05 11:18:20 +00:00
[eEthereumNetwork.hardhat]: T;
[eEthereumNetwork.tenderly]: T;
2021-02-22 09:44:10 +00:00
}
export interface iPolygonParamsPerNetwork<T> {
[ePolygonNetwork.matic]: T;
[ePolygonNetwork.mumbai]: T;
}
export interface iXDaiParamsPerNetwork<T> {
[eXDaiNetwork.xdai]: T;
}
export interface iAvalancheParamsPerNetwork<T> {
[eAvalancheNetwork.avalanche]: T;
[eAvalancheNetwork.fuji]: T;
}
export interface iParamsPerPool<T> {
[AavePools.proto]: T;
[AavePools.matic]: T;
[AavePools.amm]: T;
[AavePools.avalanche]: T;
}
export interface iBasicDistributionParams {
receivers: string[];
percentages: string[];
}
export enum RateMode {
2020-07-13 08:54:08 +00:00
None = '0',
Stable = '1',
Variable = '2',
}
2020-08-20 15:38:57 +00:00
export interface ObjectString {
[key: string]: string;
}
2020-08-24 14:18:10 +00:00
export interface IProtocolGlobalConfig {
TokenDistributorPercentageBase: string;
MockUsdPriceInWei: string;
UsdAddress: tEthereumAddress;
NilAddress: tEthereumAddress;
OneAddress: tEthereumAddress;
AaveReferral: string;
}
export interface IMocksConfig {
2020-08-25 12:15:35 +00:00
AllAssetsInitialPrices: iAssetBase<string>;
2020-08-24 14:18:10 +00:00
}
export interface ILendingRateOracleRatesCommon {
[token: string]: ILendingRate;
}
export interface ILendingRate {
borrowRate: string;
}
export interface IBaseConfiguration {
2020-11-26 15:11:40 +00:00
MarketId: string;
2021-02-19 20:50:06 +00:00
ATokenNamePrefix: string;
StableDebtTokenNamePrefix: string;
VariableDebtTokenNamePrefix: string;
SymbolPrefix: string;
2020-08-24 14:18:10 +00:00
ProviderId: number;
ProtocolGlobalParams: IProtocolGlobalConfig;
ProviderRegistry: iParamsPerNetwork<tEthereumAddress | undefined>;
ProviderRegistryOwner: iParamsPerNetwork<tEthereumAddress | undefined>;
LendingPoolCollateralManager: iParamsPerNetwork<tEthereumAddress>;
LendingPoolConfigurator: iParamsPerNetwork<tEthereumAddress>;
LendingPool: iParamsPerNetwork<tEthereumAddress>;
2020-08-25 12:15:35 +00:00
LendingRateOracleRatesCommon: iMultiPoolsAssets<IMarketRates>;
2020-08-24 14:18:10 +00:00
LendingRateOracle: iParamsPerNetwork<tEthereumAddress>;
TokenDistributor: iParamsPerNetwork<tEthereumAddress>;
AaveOracle: iParamsPerNetwork<tEthereumAddress>;
2020-08-24 14:18:10 +00:00
FallbackOracle: iParamsPerNetwork<tEthereumAddress>;
ChainlinkAggregator: iParamsPerNetwork<ITokenAddress>;
2020-11-05 11:35:50 +00:00
PoolAdmin: iParamsPerNetwork<tEthereumAddress | undefined>;
PoolAdminIndex: number;
EmergencyAdmin: iParamsPerNetwork<tEthereumAddress | undefined>;
EmergencyAdminIndex: number;
2020-09-15 15:24:50 +00:00
ATokenDomainSeparator: iParamsPerNetwork<string>;
WETH: iParamsPerNetwork<tEthereumAddress>;
WrappedNativeToken: iParamsPerNetwork<tEthereumAddress>;
WethGateway: iParamsPerNetwork<tEthereumAddress>;
ReserveFactorTreasuryAddress: iParamsPerNetwork<tEthereumAddress>;
IncentivesController: iParamsPerNetwork<tEthereumAddress>;
StableDebtTokenImplementation?: iParamsPerNetwork<tEthereumAddress>;
VariableDebtTokenImplementation?: iParamsPerNetwork<tEthereumAddress>;
ReserveAssets: iParamsPerNetwork<SymbolMap<tEthereumAddress>>;
OracleQuoteCurrency: string;
OracleQuoteUnit: string;
}
export interface ICommonConfiguration extends IBaseConfiguration {
ReservesConfig: iMultiPoolsAssets<IReserveParams>;
Mocks: IMocksConfig;
2020-08-24 14:18:10 +00:00
}
export interface IAaveConfiguration extends ICommonConfiguration {
ReservesConfig: iAavePoolAssets<IReserveParams>;
}
2020-12-22 23:48:02 +00:00
export interface IAmmConfiguration extends ICommonConfiguration {
ReservesConfig: iLpPoolAssets<IReserveParams>;
2020-12-22 23:48:02 +00:00
}
2021-02-19 22:38:54 +00:00
export interface IMaticConfiguration extends ICommonConfiguration {
ReservesConfig: iMaticPoolAssets<IReserveParams>;
}
export interface IXDAIConfiguration extends ICommonConfiguration {
ReservesConfig: iXDAIPoolAssets<IReserveParams>;
}
export interface IAvalancheConfiguration extends ICommonConfiguration {
ReservesConfig: iAvalanchePoolAssets<IReserveParams>;
}
export interface ITokenAddress {
[token: string]: tEthereumAddress;
2020-08-24 14:18:10 +00:00
}
export type PoolConfiguration = ICommonConfiguration | IAaveConfiguration;