diff --git a/src/constants/dexToZapMapping.ts b/src/constants/dexToZapMapping.ts new file mode 100644 index 00000000..3b99b846 --- /dev/null +++ b/src/constants/dexToZapMapping.ts @@ -0,0 +1,26 @@ +import { ChainId } from '@ape.swap/sdk' +import { LiquidityDex, ZapVersion } from '../types' + +export const dexToZapMapping: Record>> = { + [LiquidityDex.ApeSwapV2]: { + [ChainId.BSC]: ZapVersion.ZapV1, + [ChainId.BSC_TESTNET]: ZapVersion.ZapV1, + [ChainId.MATIC]: ZapVersion.ZapV1, + [ChainId.MATIC_TESTNET]: ZapVersion.ZapV1, + [ChainId.MAINNET]: ZapVersion.ZapV1, + [ChainId.ARBITRUM]: ZapVersion.ZapV1, + [ChainId.TLOS]: ZapVersion.ZapV1, + }, + [LiquidityDex.Algebra]: { + [ChainId.MATIC]: ZapVersion.External, + }, + [LiquidityDex.PancakeSwapV2]: { + [ChainId.BSC]: ZapVersion.External, + [ChainId.MAINNET]: ZapVersion.External, + }, + [LiquidityDex.QuickswapV2]: { + [ChainId.MATIC]: ZapVersion.External, + }, + [LiquidityDex.ApeSwapV3]: {}, + [LiquidityDex.UniswapV3]: {}, +} diff --git a/src/constants/index.ts b/src/constants/index.ts index 3236dd07..e48ebf11 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -10,4 +10,5 @@ export { default as iaos } from './iaos' export { default as zapInputTokens } from './zapInputTokens' export { default as farmsV2 } from './farmsV2' export { default as vaultsV3 } from './vaultsV3' -export { dexFactories, defaultDexFactories } from './dexFactories' +export * from './dexFactories' +export * from './dexToZapMapping' diff --git a/src/types/index.ts b/src/types/index.ts index 21559601..a72b68fd 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -27,6 +27,13 @@ export enum LiquidityDex { UniswapV3 = 'UniswapV3', } +export enum ZapVersion { + External = 'External', //This will redirect users to Token.getLpUrl with get lp button on FE + ZapV1 = 'ZapV1', //First original inhouse built non multicall zap + ZapV2 = 'ZapV2', //Second inhouse built dynamic multicall zap + Wido = 'Wido', //https://www.joinwido.com/ +} + export enum Protocols { Both = 1, V2 = 2, @@ -50,7 +57,8 @@ export interface Token { dontFetch?: boolean lpToken?: boolean price?: number - liquidityDex?: Partial> + liquidityDex?: Partial> //the dex type where most liquidity/actual lp is + getLpUrl?: Partial> //Needed for ZapVersion.External } // Interfaces used in Vaults