Skip to content

Commit

Permalink
feat: external lp url
Browse files Browse the repository at this point in the history
  • Loading branch information
Doublo54 committed Aug 3, 2023
1 parent 9fd607c commit bc63944
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
26 changes: 26 additions & 0 deletions src/constants/dexToZapMapping.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ChainId } from '@ape.swap/sdk'
import { LiquidityDex, ZapVersion } from '../types'

export const dexToZapMapping: Record<LiquidityDex, Partial<Record<ChainId, ZapVersion>>> = {
[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]: {},
}
3 changes: 2 additions & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
10 changes: 9 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -50,7 +57,8 @@ export interface Token {
dontFetch?: boolean
lpToken?: boolean
price?: number
liquidityDex?: Partial<Record<ChainId, LiquidityDex>>
liquidityDex?: Partial<Record<ChainId, LiquidityDex>> //the dex type where most liquidity/actual lp is
getLpUrl?: Partial<Record<ChainId, string>> //Needed for ZapVersion.External
}

// Interfaces used in Vaults
Expand Down

0 comments on commit bc63944

Please sign in to comment.