diff --git a/helpers/constants.ts b/helpers/constants.ts index 708fe98d..a48a3fee 100644 --- a/helpers/constants.ts +++ b/helpers/constants.ts @@ -28,3 +28,43 @@ export const TOKEN_DISTRIBUTOR_PERCENTAGE_BASE = '10000'; export const MOCK_USD_PRICE_IN_WEI = '5848466240000000'; export const USD_ADDRESS = '0x10F7Fc1F91Ba351f9C629c5947AD69bD03C05b96'; export const AAVE_REFERRAL = '0'; + +export const MOCK_CHAINLINK_AGGREGATORS_PRICES = { + AAVE: oneEther.multipliedBy('0.003620948469').toFixed(), + BAT: oneEther.multipliedBy('0.00137893825230').toFixed(), + BUSD: oneEther.multipliedBy('0.00736484').toFixed(), + DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), + ENJ: oneEther.multipliedBy('0.00029560').toFixed(), + KNC: oneEther.multipliedBy('0.001072').toFixed(), + LINK: oneEther.multipliedBy('0.009955').toFixed(), + MANA: oneEther.multipliedBy('0.000158').toFixed(), + MKR: oneEther.multipliedBy('2.508581').toFixed(), + REN: oneEther.multipliedBy('0.00065133').toFixed(), + SNX: oneEther.multipliedBy('0.00442616').toFixed(), + SUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), + TUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), + UNI: oneEther.multipliedBy('0.00536479').toFixed(), + USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), + USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), + WETH: oneEther.toFixed(), + WBTC: oneEther.multipliedBy('47.332685').toFixed(), + YFI: oneEther.multipliedBy('22.407436').toFixed(), + ZRX: oneEther.multipliedBy('0.001151').toFixed(), + UniDAIWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniAAVEWETH: oneEther.multipliedBy('0.003620948469').toFixed(), + UniBATWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUSDCDAI: oneEther.multipliedBy('22.407436').toFixed(), + UniCRVWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniLINKWETH: oneEther.multipliedBy('0.009955').toFixed(), + UniMKRWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniRENWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniSNXWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUNIWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniUSDCWETH: oneEther.multipliedBy('22.407436').toFixed(), + UniWBTCUSDC: oneEther.multipliedBy('22.407436').toFixed(), + UniYFIWETH: oneEther.multipliedBy('22.407436').toFixed(), + BptWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), + MATIC: oneEther.multipliedBy('0.003620948469').toFixed(), + USD: '5848466240000000', +}; diff --git a/helpers/types.ts b/helpers/types.ts index 7e08399b..b7b07980 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -343,6 +343,7 @@ export enum TokenContractId { UniWBTCUSDC = 'UniWBTCUSDC', UniYFIWETH = 'UniYFIWETH', BptWBTCWETH = 'BptWBTCWETH', + MATIC = 'MATIC', } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { @@ -493,3 +494,4 @@ export interface ITokenAddress { } export type PoolConfiguration = ICommonConfiguration | IAaveConfiguration; + diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index 853c252e..efe71af3 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -1,51 +1,7 @@ import BigNumber from 'bignumber.js'; -import { oneEther, oneRay, RAY, ZERO_ADDRESS } from '../../helpers/constants'; +import { oneEther, oneRay, RAY, ZERO_ADDRESS, MOCK_CHAINLINK_AGGREGATORS_PRICES } from '../../helpers/constants'; import { ICommonConfiguration, EthereumNetwork, eEthereumNetwork } from '../../helpers/types'; -const MOCK_CHAINLINK_AGGREGATORS_PRICES = { - AAVE: oneEther.multipliedBy('0.003620948469').toFixed(), - BAT: oneEther.multipliedBy('0.00137893825230').toFixed(), - BUSD: oneEther.multipliedBy('0.00736484').toFixed(), - DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), - ENJ: oneEther.multipliedBy('0.00029560').toFixed(), - KNC: oneEther.multipliedBy('0.001072').toFixed(), - LINK: oneEther.multipliedBy('0.009955').toFixed(), - MANA: oneEther.multipliedBy('0.000158').toFixed(), - MKR: oneEther.multipliedBy('2.508581').toFixed(), - REN: oneEther.multipliedBy('0.00065133').toFixed(), - SNX: oneEther.multipliedBy('0.00442616').toFixed(), - SUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), - TUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), - UNI: oneEther.multipliedBy('0.00536479').toFixed(), - USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), - USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), - WETH: oneEther.toFixed(), - WBTC: oneEther.multipliedBy('47.332685').toFixed(), - YFI: oneEther.multipliedBy('22.407436').toFixed(), - ZRX: oneEther.multipliedBy('0.001151').toFixed(), - // LpDAI: oneEther.multipliedBy('0.00369068412860').toFixed(), - // LpUSDC: oneEther.multipliedBy('0.00367714136416').toFixed(), - // LpUSDT: oneEther.multipliedBy('0.00369068412860').toFixed(), - // LpWBTC: oneEther.multipliedBy('47.332685').toFixed(), - // LpWETH: oneEther.toFixed(), - UniDAIWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniAAVEWETH: oneEther.multipliedBy('0.003620948469').toFixed(), - UniBATWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUSDCDAI: oneEther.multipliedBy('22.407436').toFixed(), - UniCRVWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniLINKWETH: oneEther.multipliedBy('0.009955').toFixed(), - UniMKRWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniRENWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniSNXWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUNIWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUSDCWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniWBTCUSDC: oneEther.multipliedBy('22.407436').toFixed(), - UniYFIWETH: oneEther.multipliedBy('22.407436').toFixed(), - BptWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), - MATIC: oneEther.multipliedBy('0.003620948469').toFixed(), - USD: '5848466240000000', -}; // ---------------- // PROTOCOL GLOBAL PARAMS // ---------------- diff --git a/markets/lp/commons.ts b/markets/lp/commons.ts index 6e1fb16b..8f927258 100644 --- a/markets/lp/commons.ts +++ b/markets/lp/commons.ts @@ -1,51 +1,7 @@ import BigNumber from 'bignumber.js'; -import { oneEther, oneRay, RAY, ZERO_ADDRESS } from '../../helpers/constants'; +import { oneEther, oneRay, RAY, ZERO_ADDRESS, MOCK_CHAINLINK_AGGREGATORS_PRICES } from '../../helpers/constants'; import { ICommonConfiguration, EthereumNetwork, eEthereumNetwork } from '../../helpers/types'; -const MOCK_CHAINLINK_AGGREGATORS_PRICES = { - AAVE: oneEther.multipliedBy('0.003620948469').toFixed(), - BAT: oneEther.multipliedBy('0.00137893825230').toFixed(), - BUSD: oneEther.multipliedBy('0.00736484').toFixed(), - DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), - ENJ: oneEther.multipliedBy('0.00029560').toFixed(), - KNC: oneEther.multipliedBy('0.001072').toFixed(), - LINK: oneEther.multipliedBy('0.009955').toFixed(), - MANA: oneEther.multipliedBy('0.000158').toFixed(), - MKR: oneEther.multipliedBy('2.508581').toFixed(), - REN: oneEther.multipliedBy('0.00065133').toFixed(), - SNX: oneEther.multipliedBy('0.00442616').toFixed(), - SUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), - TUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), - UNI: oneEther.multipliedBy('0.00536479').toFixed(), - USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), - USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), - WETH: oneEther.toFixed(), - WBTC: oneEther.multipliedBy('47.332685').toFixed(), - YFI: oneEther.multipliedBy('22.407436').toFixed(), - ZRX: oneEther.multipliedBy('0.001151').toFixed(), - // DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), - // USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), - // USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), - // WBTC: oneEther.multipliedBy('47.332685').toFixed(), - // WETH: oneEther.toFixed(), - UniDAIWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniAAVEWETH: oneEther.multipliedBy('0.003620948469').toFixed(), - UniBATWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUSDCDAI: oneEther.multipliedBy('22.407436').toFixed(), - UniCRVWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniLINKWETH: oneEther.multipliedBy('0.009955').toFixed(), - UniMKRWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniRENWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniSNXWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUNIWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUSDCWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniWBTCUSDC: oneEther.multipliedBy('22.407436').toFixed(), - UniYFIWETH: oneEther.multipliedBy('22.407436').toFixed(), - BptWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), - MATIC: oneEther.multipliedBy('0.003620948469').toFixed(), - USD: '5848466240000000', -}; // ---------------- // PROTOCOL GLOBAL PARAMS // ---------------- diff --git a/markets/matic/commons.ts b/markets/matic/commons.ts index 74c45f9d..c591556e 100644 --- a/markets/matic/commons.ts +++ b/markets/matic/commons.ts @@ -1,51 +1,7 @@ import BigNumber from 'bignumber.js'; -import { oneEther, oneRay, RAY, ZERO_ADDRESS } from '../../helpers/constants'; +import { oneEther, oneRay, RAY, ZERO_ADDRESS, MOCK_CHAINLINK_AGGREGATORS_PRICES } from '../../helpers/constants'; import { ICommonConfiguration, EthereumNetwork, eEthereumNetwork } from '../../helpers/types'; -const MOCK_CHAINLINK_AGGREGATORS_PRICES = { - AAVE: oneEther.multipliedBy('0.003620948469').toFixed(), - BAT: oneEther.multipliedBy('0.00137893825230').toFixed(), - BUSD: oneEther.multipliedBy('0.00736484').toFixed(), - DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), - ENJ: oneEther.multipliedBy('0.00029560').toFixed(), - KNC: oneEther.multipliedBy('0.001072').toFixed(), - LINK: oneEther.multipliedBy('0.009955').toFixed(), - MANA: oneEther.multipliedBy('0.000158').toFixed(), - MKR: oneEther.multipliedBy('2.508581').toFixed(), - REN: oneEther.multipliedBy('0.00065133').toFixed(), - SNX: oneEther.multipliedBy('0.00442616').toFixed(), - SUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), - TUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), - UNI: oneEther.multipliedBy('0.00536479').toFixed(), - USDC: oneEther.multipliedBy('0.00367714136416').toFixed(), - USDT: oneEther.multipliedBy('0.00369068412860').toFixed(), - WETH: oneEther.toFixed(), - WBTC: oneEther.multipliedBy('47.332685').toFixed(), - YFI: oneEther.multipliedBy('22.407436').toFixed(), - ZRX: oneEther.multipliedBy('0.001151').toFixed(), - // LpDAI: oneEther.multipliedBy('0.00369068412860').toFixed(), - // LpUSDC: oneEther.multipliedBy('0.00367714136416').toFixed(), - // LpUSDT: oneEther.multipliedBy('0.00369068412860').toFixed(), - // LpWBTC: oneEther.multipliedBy('47.332685').toFixed(), - // LpWETH: oneEther.toFixed(), - UniDAIWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniAAVEWETH: oneEther.multipliedBy('0.003620948469').toFixed(), - UniBATWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUSDCDAI: oneEther.multipliedBy('22.407436').toFixed(), - UniCRVWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniLINKWETH: oneEther.multipliedBy('0.009955').toFixed(), - UniMKRWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniRENWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniSNXWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUNIWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniUSDCWETH: oneEther.multipliedBy('22.407436').toFixed(), - UniWBTCUSDC: oneEther.multipliedBy('22.407436').toFixed(), - UniYFIWETH: oneEther.multipliedBy('22.407436').toFixed(), - BptWBTCWETH: oneEther.multipliedBy('22.407436').toFixed(), - MATIC: oneEther.multipliedBy('0.003620948469').toFixed(), - USD: '5848466240000000', -}; // ---------------- // PROTOCOL GLOBAL PARAMS // ---------------- diff --git a/test-suites/test-aave/__setup.spec.ts b/test-suites/test-aave/__setup.spec.ts index 006e0d74..1af7961d 100644 --- a/test-suites/test-aave/__setup.spec.ts +++ b/test-suites/test-aave/__setup.spec.ts @@ -185,6 +185,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { UniWBTCUSDC: mockTokens.UniWBTCUSDC.address, UniYFIWETH: mockTokens.UniYFIWETH.address, BptWBTCWETH: mockTokens.BptWBTCWETH.address, + MATIC: mockTokens.MATIC.address, USD: USD_ADDRESS, }, fallbackOracle diff --git a/test-suites/test-lp/__setup.spec.ts b/test-suites/test-lp/__setup.spec.ts index 09c02efc..cf8d616a 100644 --- a/test-suites/test-lp/__setup.spec.ts +++ b/test-suites/test-lp/__setup.spec.ts @@ -185,6 +185,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { UniWBTCUSDC: mockTokens.UniWBTCUSDC.address, UniYFIWETH: mockTokens.UniYFIWETH.address, BptWBTCWETH: mockTokens.BptWBTCWETH.address, + MATIC: mockTokens.MATIC.address, USD: USD_ADDRESS, }, fallbackOracle