import { Percent } from "@uniswap/sdk-core"; import { BigNumber } from "@ethersproject/bignumber"; import JSBI from "jsbi"; export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; export const GENERIC_GAS_LIMIT_ORDER_EXECUTION = BigNumber.from(400000); export const NetworkContextName = "NETWORK"; // 30 minutes, denominated in seconds export const DEFAULT_DEADLINE_FROM_NOW = 60 * 30; // used for rewards deadlines export const BIG_INT_SECONDS_IN_WEEK = JSBI.BigInt(60 * 60 * 24 * 7); export const BIG_INT_ZERO = JSBI.BigInt(0); // one basis JSBI.BigInt export const ONE_BIPS = new Percent(JSBI.BigInt(1), JSBI.BigInt(10000)); export const BIPS_BASE = JSBI.BigInt(10000); // used for warning states export const ALLOWED_PRICE_IMPACT_LOW: Percent = new Percent( JSBI.BigInt(100), BIPS_BASE ); // 1% export const ALLOWED_PRICE_IMPACT_MEDIUM: Percent = new Percent( JSBI.BigInt(300), BIPS_BASE ); // 3% export const ALLOWED_PRICE_IMPACT_HIGH: Percent = new Percent( JSBI.BigInt(500), BIPS_BASE ); // 5% // if the price slippage exceeds this number, force the user to type 'confirm' to execute export const PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN: Percent = new Percent( JSBI.BigInt(1000), BIPS_BASE ); // 10% // for non expert mode disable swaps above this export const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent = new Percent( JSBI.BigInt(1500), BIPS_BASE ); // 15% // used to ensure the user doesn't send so much ETH so they end up with <.01 export const MIN_ETH: JSBI = JSBI.exponentiate( JSBI.BigInt(10), JSBI.BigInt(16) ); // .01 ETH export const BETTER_TRADE_LESS_HOPS_THRESHOLD = new Percent( JSBI.BigInt(50), JSBI.BigInt(10000) ); export const ZERO_PERCENT = new Percent("0"); export const ONE_HUNDRED_PERCENT = new Percent("1"); /** * The default factory enabled fee amounts, denominated in hundredths of bips. */ export enum FeeAmount { LOWEST = 100, LOW = 500, MEDIUM = 3000, HIGH = 10000, } export const MAX_FEE_AMOUNTS: { [chainId: number]: number; } = { [1]: 0, [5]: 0, [56]: 0, [137]: 1000000000000000000, // 1.0 MATIC };