diff --git a/apps/web/src/hooks/useFarm.ts b/apps/web/src/hooks/useFarm.ts index c15b702790d6d..9183c4aad7d4b 100644 --- a/apps/web/src/hooks/useFarm.ts +++ b/apps/web/src/hooks/useFarm.ts @@ -1,12 +1,18 @@ -import { ComputedFarmConfigV3, createFarmFetcherV3, fetchTokenUSDValues } from '@pancakeswap/farms' +import { + ComputedFarmConfigV3, + createFarmFetcherV3, + defineFarmV3ConfigsFromUniversalFarm, + fetchTokenUSDValues, + fetchUniversalFarms, + Protocol, + UniversalFarmConfigV3, +} from '@pancakeswap/farms' import { priceHelperTokens } from '@pancakeswap/farms/constants/common' import { Currency, ERC20Token } from '@pancakeswap/sdk' import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' import { useQuery } from '@tanstack/react-query' -import { useMemo } from 'react' - -import { legacyFarmsV3ConfigChainMap } from '@pancakeswap/farms/constants/v3' import { FAST_INTERVAL } from 'config/constants' +import { useEffect, useMemo, useState } from 'react' import { getViemClients } from 'utils/viem' const farmFetcherV3 = createFarmFetcherV3(getViemClients) @@ -19,18 +25,31 @@ interface FarmParams { export function useFarm({ currencyA, currencyB, feeAmount }: FarmParams) { const chainId = currencyA?.chainId + const [farms, setFarms] = useState([]) + + useEffect(() => { + const fetchFarmV3Config = async () => { + if (chainId) { + const farmsV3 = await fetchUniversalFarms(chainId, Protocol.V3) + setFarms(defineFarmV3ConfigsFromUniversalFarm(farmsV3 as UniversalFarmConfigV3[])) + } + } + + fetchFarmV3Config() + }, [chainId]) + const farmConfig = useMemo(() => { if (!chainId || !currencyA || !currencyB || !feeAmount) { return null } - const farms: ComputedFarmConfigV3[] = legacyFarmsV3ConfigChainMap[chainId] + if (!farms) { return null } const lpAddress = Pool.getAddress(currencyA.wrapped, currencyB.wrapped, feeAmount) const farm = farms.find((f) => f.lpAddress === lpAddress) return farm ?? null - }, [chainId, currencyA, currencyB, feeAmount]) + }, [chainId, currencyA, currencyB, farms, feeAmount]) return useQuery({ queryKey: [chainId, farmConfig?.token0.symbol, farmConfig?.token1.symbol, farmConfig?.feeAmount], diff --git a/apps/web/src/pages/api/configs/farms/v2/[chain].ts b/apps/web/src/pages/api/configs/farms/v2/[chain].ts index 43444c6cc69ee..8bfbf27ff6432 100644 --- a/apps/web/src/pages/api/configs/farms/v2/[chain].ts +++ b/apps/web/src/pages/api/configs/farms/v2/[chain].ts @@ -1,5 +1,9 @@ -import { ChainId, chainNameToChainId, chainNames } from '@pancakeswap/chains' -import { UNIVERSAL_FARMS_WITH_TESTNET, formatUniversalFarmToSerializedFarm } from '@pancakeswap/farms' +import { ChainId, chainNames, chainNameToChainId } from '@pancakeswap/chains' +import { + fetchAllUniversalFarms, + formatUniversalFarmToSerializedFarm, + UNIVERSAL_FARMS_WITH_TESTNET, +} from '@pancakeswap/farms' import { NextApiHandler } from 'next' import { stringify } from 'viem' import { enum as enum_, nativeEnum } from 'zod' @@ -24,7 +28,8 @@ const handler: NextApiHandler = async (req, res) => { } try { - const farmConfig = UNIVERSAL_FARMS_WITH_TESTNET.filter((farm) => farm.chainId === chainId) + const fetchFarmConfig = await fetchAllUniversalFarms() + const farmConfig = [...fetchFarmConfig, ...UNIVERSAL_FARMS_WITH_TESTNET].filter((farm) => farm.chainId === chainId) const legacyFarmConfig = formatUniversalFarmToSerializedFarm(farmConfig) // cache for long time, it should revalidate on every deployment res.setHeader('Cache-Control', `max-age=10800, s-maxage=31536000`) diff --git a/apps/web/src/pages/api/configs/farms/v2/index.ts b/apps/web/src/pages/api/configs/farms/v2/index.ts index 723fb0d4d528a..84f3ea9dca9d3 100644 --- a/apps/web/src/pages/api/configs/farms/v2/index.ts +++ b/apps/web/src/pages/api/configs/farms/v2/index.ts @@ -1,12 +1,16 @@ -import { UNIVERSAL_FARMS, UNIVERSAL_FARMS_WITH_TESTNET, formatUniversalFarmToSerializedFarm } from '@pancakeswap/farms' +import { + UNIVERSAL_FARMS_WITH_TESTNET, + fetchAllUniversalFarms, + formatUniversalFarmToSerializedFarm, +} from '@pancakeswap/farms' import { NextApiHandler } from 'next' import { stringify } from 'viem' const handler: NextApiHandler = async (req, res) => { - const includeTestnet = !!req.query.includeTestnet - try { - const farmConfig = includeTestnet ? UNIVERSAL_FARMS_WITH_TESTNET : UNIVERSAL_FARMS + const fetchFarmConfig = await fetchAllUniversalFarms() + const includeTestnet = !!req.query.includeTestnet + const farmConfig = includeTestnet ? [...fetchFarmConfig, ...UNIVERSAL_FARMS_WITH_TESTNET] : fetchFarmConfig const legacyFarmConfig = formatUniversalFarmToSerializedFarm(farmConfig) // cache for long time, it should revalidate on every deployment res.setHeader('Cache-Control', `max-age=10800, s-maxage=31536000`) diff --git a/apps/web/src/pages/api/v3/[chainId]/farms/index.ts b/apps/web/src/pages/api/v3/[chainId]/farms/index.ts index 797d41031defc..2dad0428df0d2 100644 --- a/apps/web/src/pages/api/v3/[chainId]/farms/index.ts +++ b/apps/web/src/pages/api/v3/[chainId]/farms/index.ts @@ -1,7 +1,13 @@ import { ChainId } from '@pancakeswap/chains' -import { createFarmFetcherV3, fetchCommonTokenUSDValue } from '@pancakeswap/farms' +import { + createFarmFetcherV3, + defineFarmV3ConfigsFromUniversalFarm, + fetchCommonTokenUSDValue, + fetchUniversalFarms, + Protocol, + UniversalFarmConfigV3, +} from '@pancakeswap/farms' import { priceHelperTokens } from '@pancakeswap/farms/constants/common' -import { legacyFarmsV3ConfigChainMap } from '@pancakeswap/farms/constants/v3' import { NextApiHandler } from 'next' import { getViemClients } from 'utils/viem.server' import { nativeEnum as zNativeEnum } from 'zod' @@ -22,7 +28,9 @@ const handler: NextApiHandler = async (req, res) => { if (!farmFetcherV3.isChainSupported(chainId)) { return res.status(400).json({ error: 'Chain not supported' }) } - const farms = legacyFarmsV3ConfigChainMap[chainId] + + const fetchFarmsV3 = await fetchUniversalFarms(chainId, Protocol.V3) + const farms = defineFarmV3ConfigsFromUniversalFarm(fetchFarmsV3 as UniversalFarmConfigV3[]) const commonPrice = await fetchCommonTokenUSDValue(priceHelperTokens[chainId]) diff --git a/apps/web/src/state/farmsV3/hooks.ts b/apps/web/src/state/farmsV3/hooks.ts index c1b2c4143a969..db5eee58d32d9 100644 --- a/apps/web/src/state/farmsV3/hooks.ts +++ b/apps/web/src/state/farmsV3/hooks.ts @@ -6,13 +6,16 @@ import { FarmsV3Response, IPendingCakeByTokenId, PositionDetails, + Protocol, SerializedFarmsV3Response, + UniversalFarmConfigV3, bCakeSupportedChainId, createFarmFetcherV3, + defineFarmV3ConfigsFromUniversalFarm, + fetchUniversalFarms, supportedChainIdV3, } from '@pancakeswap/farms' import { priceHelperTokens } from '@pancakeswap/farms/constants/common' -import { legacyFarmsV3ConfigChainMap } from '@pancakeswap/farms/constants/v3' import { bCakeFarmBoosterVeCakeABI } from '@pancakeswap/farms/constants/v3/abi/bCakeFarmBoosterVeCake' import { TvlMap, fetchCommonTokenUSDValue } from '@pancakeswap/farms/src/fetchFarmsV3' import { deserializeToken } from '@pancakeswap/token-lists' @@ -83,8 +86,8 @@ export const useFarmsV3Public = () => { } // direct copy from api routes, the client side fetch is preventing cache due to migration phase we want fresh data - const farms = legacyFarmsV3ConfigChainMap[chainId as ChainId] - + const fetchFarmsV3 = await fetchUniversalFarms(chainId, Protocol.V3) + const farms = defineFarmV3ConfigsFromUniversalFarm(fetchFarmsV3 as UniversalFarmConfigV3[]) const commonPrice = await fetchCommonTokenUSDValue(priceHelperTokens[chainId ?? -1]) try { diff --git a/apps/web/src/state/farmsV4/state/accountPositions/fetcher.ts b/apps/web/src/state/farmsV4/state/accountPositions/fetcher.ts index 4ba7ce7060505..46d74191d3603 100644 --- a/apps/web/src/state/farmsV4/state/accountPositions/fetcher.ts +++ b/apps/web/src/state/farmsV4/state/accountPositions/fetcher.ts @@ -1,7 +1,8 @@ -import { BCakeWrapperFarmConfig, Protocol, UNIVERSAL_FARMS, UNIVERSAL_FARMS_MAP } from '@pancakeswap/farms' +import { BCakeWrapperFarmConfig, Protocol, fetchAllUniversalFarms, fetchAllUniversalFarmsMap } from '@pancakeswap/farms' import { CurrencyAmount, ERC20Token, Pair, Token, pancakePairV2ABI } from '@pancakeswap/sdk' import { LegacyStableSwapPair } from '@pancakeswap/smart-router/legacy-router' import { deserializeToken } from '@pancakeswap/token-lists' +import { getBalanceNumber } from '@pancakeswap/utils/formatBalance' import BigNumber from 'bignumber.js' import { infoStableSwapABI } from 'config/abi/infoStableSwap' import { v2BCakeWrapperABI } from 'config/abi/v2BCakeWrapper' @@ -12,7 +13,6 @@ import { AppState } from 'state' import { safeGetAddress } from 'utils' import { publicClient } from 'utils/viem' import { Address, erc20Abi, zeroAddress } from 'viem' -import { getBalanceNumber } from '@pancakeswap/utils/formatBalance' import { StablePoolInfo, V2PoolInfo } from '../type' import { StableLPDetail, V2LPDetail } from './type' @@ -67,18 +67,20 @@ type ITokenPair = [ERC20Token, ERC20Token] // for v2 pools, we cannot fetch all positions from one contract // so we simple get the most used pairs for fetch LP position export const getTrackedV2LpTokens = memoize( - ( + async ( chainId: number, presetTokens: { [address: Address]: ERC20Token }, userSavedPairs: AppState['user']['pairs'], - ): [ERC20Token, ERC20Token][] => { + ): Promise<[ERC20Token, ERC20Token][]> => { const pairTokens: ITokenPair[] = [] + const fetchFarmConfig = await fetchAllUniversalFarms() + // from farms - UNIVERSAL_FARMS.filter( - (farm) => farm.protocol === 'v2' && farm.bCakeWrapperAddress && farm.chainId === chainId, - ).forEach((farm) => { - pairTokens.push(farm.token0.sortsBefore(farm.token1) ? [farm.token0, farm.token1] : [farm.token1, farm.token0]) - }) + fetchFarmConfig + .filter((farm) => farm.protocol === 'v2' && farm.bCakeWrapperAddress && farm.chainId === chainId) + .forEach((farm) => { + pairTokens.push(farm.token0.sortsBefore(farm.token1) ? [farm.token0, farm.token1] : [farm.token1, farm.token0]) + }) // from pinned pairs if (PINNED_PAIRS[chainId]) { PINNED_PAIRS[chainId].forEach((tokens: ITokenPair) => { @@ -114,11 +116,10 @@ export const getTrackedV2LpTokens = memoize( `${chainId}:${Object.keys(presetTokens).length}:${Object.values(userSavedPairs).length}`, ) -const V2_UNIVERSAL_FARMS = UNIVERSAL_FARMS.filter((farm) => farm.protocol === Protocol.V2) -const STABLE_UNIVERSAL_FARMS = UNIVERSAL_FARMS.filter((farm) => farm.protocol === Protocol.STABLE) +export const getBCakeWrapperAddress = async (lpAddress: Address, chainId: number) => { + const fetchUniversalFarmsMap = await fetchAllUniversalFarmsMap() -export const getBCakeWrapperAddress = (lpAddress: Address, chainId: number) => { - const f = UNIVERSAL_FARMS_MAP[`${chainId}:${lpAddress}`] as V2PoolInfo | StablePoolInfo | undefined + const f = fetchUniversalFarmsMap[`${chainId}:${lpAddress}`] as V2PoolInfo | StablePoolInfo | undefined return f?.bCakeWrapperAddress ?? '0x' } @@ -137,7 +138,13 @@ export const getAccountV2LpDetails = async ( const validLpTokens = lpTokens.filter((token) => token.chainId === chainId) - const bCakeWrapperAddresses = validLpTokens.map((token) => getBCakeWrapperAddress(token.address, chainId)) + const bCakeWrapperAddresses = await Promise.all( + validReserveTokens.map(async (tokens) => { + const lpAddress = getV2LiquidityToken(tokens).address + const bCakeWrapperAddress = await getBCakeWrapperAddress(lpAddress, chainId) + return bCakeWrapperAddress + }), + ) const balanceCalls = validLpTokens.map((token) => { return { @@ -207,6 +214,10 @@ export const getAccountV2LpDetails = async ( } return acc }, [] as Array) + + const farmConfig = await fetchAllUniversalFarms() + const V2_UNIVERSAL_FARMS = farmConfig.filter((farm) => farm.protocol === Protocol.V2) + return balances .map((result, index) => { const { result: _balance = 0n, status } = result @@ -275,10 +286,11 @@ export const getStablePairDetails = async ( if (!account || !client || !validStablePairs.length) return [] - const bCakeWrapperAddresses = validStablePairs.reduce((acc, pair) => { - acc.push(getBCakeWrapperAddress(pair.lpAddress, chainId)) - return acc - }, [] as Array
) + const bCakeWrapperAddresses = await Promise.all( + validStablePairs.reduce((acc, pair) => { + return [...acc, getBCakeWrapperAddress(pair.lpAddress, chainId)] + }, [] as Array>), + ) const balanceCalls = validStablePairs.map((pair) => { return { @@ -366,6 +378,8 @@ export const getStablePairDetails = async ( .then((res) => res.map((item) => item.result ?? [0n, 0n])), ]) + const farmConfig = await fetchAllUniversalFarms() + const result = validStablePairs.map((pair, index) => { const nativeBalance = CurrencyAmount.fromRawAmount(pair.liquidityToken, balances[index]) const farmingInfo = farming[index] @@ -388,6 +402,7 @@ export const getStablePairDetails = async ( const farmingDeposited0 = CurrencyAmount.fromRawAmount(token0.wrapped, farmingToken0Amount.toString()) const farmingDeposited1 = CurrencyAmount.fromRawAmount(token1.wrapped, farmingToken1Amount.toString()) + const STABLE_UNIVERSAL_FARMS = farmConfig.filter((farm) => farm.protocol === Protocol.STABLE) const isStaked = !!STABLE_UNIVERSAL_FARMS.find((farm) => farm.lpAddress === pair.lpAddress) return { diff --git a/apps/web/src/state/farmsV4/state/accountPositions/hooks/useAccountV2LpDetails.ts b/apps/web/src/state/farmsV4/state/accountPositions/hooks/useAccountV2LpDetails.ts index 61ec4ccb7fe2c..bca1ca148df2f 100644 --- a/apps/web/src/state/farmsV4/state/accountPositions/hooks/useAccountV2LpDetails.ts +++ b/apps/web/src/state/farmsV4/state/accountPositions/hooks/useAccountV2LpDetails.ts @@ -2,7 +2,7 @@ import { ERC20Token } from '@pancakeswap/sdk' import { useQueries, UseQueryOptions, UseQueryResult } from '@tanstack/react-query' import { SLOW_INTERVAL } from 'config/constants' import { useOfficialsAndUserAddedTokensByChainIds } from 'hooks/Tokens' -import { useCallback, useMemo } from 'react' +import { useCallback, useEffect, useMemo, useState } from 'react' import { useSelector } from 'react-redux' import { AppState } from 'state' import { Address } from 'viem' @@ -13,18 +13,33 @@ import { useLatestTxReceipt } from './useLatestTxReceipt' export const useAccountV2LpDetails = (chainIds: number[], account?: Address | null) => { const tokens = useOfficialsAndUserAddedTokensByChainIds(chainIds) const userSavedPairs = useSelector(({ user: { pairs } }) => pairs) - const lpTokensByChain = useMemo(() => { - const result: Record = {} - chainIds.forEach((chainId) => { - const lpTokens = getTrackedV2LpTokens(chainId, tokens[chainId], userSavedPairs) - if (lpTokens && lpTokens.length > 0) { - result[chainId] = lpTokens - } - }) - return result + const [lpTokensByChain, setLpTokensByChain] = useState | null>(null) + + useEffect(() => { + const fetchLpTokens = async () => { + const result: Record = {} + + await Promise.all( + chainIds.map(async (chainId) => { + const lpTokens = await getTrackedV2LpTokens(chainId, tokens[chainId], userSavedPairs) + if (lpTokens && lpTokens.length > 0) { + result[chainId] = lpTokens + } + }), + ) + + setLpTokensByChain(result) + } + + fetchLpTokens() }, [chainIds, tokens, userSavedPairs]) + const [latestTxReceipt] = useLatestTxReceipt() const queries = useMemo(() => { + if (!lpTokensByChain) { + return [] + } + return Object.entries(lpTokensByChain).map(([chainId, lpTokens]) => { return { queryKey: ['accountV2LpDetails', account, chainId, lpTokens.length, latestTxReceipt?.blockHash], diff --git a/apps/web/src/state/farmsV4/state/extendPools/fetcher.ts b/apps/web/src/state/farmsV4/state/extendPools/fetcher.ts index 97184327ae155..20d179e09522a 100644 --- a/apps/web/src/state/farmsV4/state/extendPools/fetcher.ts +++ b/apps/web/src/state/farmsV4/state/extendPools/fetcher.ts @@ -1,5 +1,5 @@ import { getChainNameInKebabCase } from '@pancakeswap/chains' -import { UNIVERSAL_FARMS, UNIVERSAL_FARMS_MAP } from '@pancakeswap/farms' +import { fetchAllUniversalFarms, fetchAllUniversalFarmsMap } from '@pancakeswap/farms' import set from 'lodash/set' import { chainIdToExplorerInfoChainName, explorerApiClient } from 'state/info/api/client' import { PoolInfo, StablePoolInfo, V2PoolInfo } from '../type' @@ -33,9 +33,10 @@ export const fetchExplorerPoolsList = async (query: Required, } const { rows, endCursor, startCursor, hasNextPage, hasPrevPage } = resp.data + const pools = await parseFarmPools(rows) return { - pools: parseFarmPools(rows), + pools, endCursor, startCursor, hasNextPage, @@ -43,10 +44,11 @@ export const fetchExplorerPoolsList = async (query: Required, } } -const composeFarmConfig = (farm: PoolInfo) => { +const composeFarmConfig = async (farm: PoolInfo) => { if (farm.protocol !== 'stable' && farm.protocol !== 'v2') return farm - const localFarm = UNIVERSAL_FARMS_MAP[`${farm.chainId}:${farm.lpAddress}`] as V2PoolInfo | StablePoolInfo | undefined + const farmConfig = await fetchAllUniversalFarmsMap() + const localFarm = farmConfig[`${farm.chainId}:${farm.lpAddress}`] as V2PoolInfo | StablePoolInfo | undefined if (!localFarm) { return farm @@ -78,7 +80,10 @@ export const fetchExplorerPoolInfo = async ( } // @ts-ignore resp.data.chainId = chainId - const isFarming = UNIVERSAL_FARMS.some((farm) => farm.lpAddress === poolAddress) + const farmConfig = await fetchAllUniversalFarms() + const isFarming = farmConfig.some((farm) => farm.lpAddress.toLowerCase() === poolAddress.toLowerCase()) + const farm = await parseFarmPools([resp.data], { isFarming }) + const data = await composeFarmConfig(farm[0]) - return composeFarmConfig(parseFarmPools([resp.data], { isFarming })[0]) as TPoolType + return data as TPoolType } diff --git a/apps/web/src/state/farmsV4/state/extendPools/hooks.ts b/apps/web/src/state/farmsV4/state/extendPools/hooks.ts index 6b09922f9eb3c..c718cf82916ff 100644 --- a/apps/web/src/state/farmsV4/state/extendPools/hooks.ts +++ b/apps/web/src/state/farmsV4/state/extendPools/hooks.ts @@ -100,7 +100,10 @@ export const usePoolInfo = ({ }): TPoolType | undefined | null => { const { data: poolInfo } = useQuery({ queryKey: ['poolInfo', chainId, poolAddress], - queryFn: () => fetchExplorerPoolInfo(poolAddress ?? '', chainId), + queryFn: async () => { + const result = await fetchExplorerPoolInfo(poolAddress ?? '', chainId) + return result + }, enabled: !!poolAddress && !!chainId, }) diff --git a/apps/web/src/state/farmsV4/state/farmPools/fetcher.ts b/apps/web/src/state/farmsV4/state/farmPools/fetcher.ts index 7a7a5ed2a3a48..82d68bd2e4cb2 100644 --- a/apps/web/src/state/farmsV4/state/farmPools/fetcher.ts +++ b/apps/web/src/state/farmsV4/state/farmPools/fetcher.ts @@ -2,7 +2,7 @@ import { ChainId, getChainNameInKebabCase } from '@pancakeswap/chains' import { FarmV4SupportedChainId, Protocol, - UNIVERSAL_FARMS, + fetchAllUniversalFarms, masterChefV3Addresses, supportedChainIdV4, } from '@pancakeswap/farms' @@ -14,9 +14,9 @@ import utc from 'dayjs/plugin/utc' import { GraphQLClient, gql } from 'graphql-request' import groupBy from 'lodash/groupBy' import { explorerApiClient } from 'state/info/api/client' +import { isAddressEqual } from 'utils' import { v3Clients } from 'utils/graphql' import { publicClient } from 'utils/viem' -import { isAddressEqual } from 'utils' import { type Address } from 'viem' import { PoolInfo } from '../type' import { parseFarmPools } from '../utils' @@ -198,7 +198,9 @@ export const fetchFarmPools = async ( } console.error('Failed to fetch remote pools', error) } - const localPools = UNIVERSAL_FARMS.filter((farm) => { + + const fetchFarmConfig = await fetchAllUniversalFarms() + const localPools = fetchFarmConfig.filter((farm) => { return ( args.protocols?.includes(farm.protocol) && (Array.isArray(args.chainId) ? args.chainId.includes(farm.chainId) : farm.chainId === args.chainId) diff --git a/apps/web/src/state/farmsV4/state/farmPools/hooks.ts b/apps/web/src/state/farmsV4/state/farmPools/hooks.ts index 30b2ee4989352..81f66d4c2d4b7 100644 --- a/apps/web/src/state/farmsV4/state/farmPools/hooks.ts +++ b/apps/web/src/state/farmsV4/state/farmPools/hooks.ts @@ -1,5 +1,5 @@ import { ChainId } from '@pancakeswap/chains' -import { Protocol, UNIVERSAL_FARMS, UniversalFarmConfig, masterChefV3Addresses } from '@pancakeswap/farms' +import { Protocol, UniversalFarmConfig, fetchAllUniversalFarms, masterChefV3Addresses } from '@pancakeswap/farms' import { masterChefAddresses } from '@pancakeswap/farms/src/const' import { masterChefV3ABI } from '@pancakeswap/v3-sdk' import { UseQueryResult, useQueries, useQuery } from '@tanstack/react-query' @@ -9,7 +9,7 @@ import dayjs from 'dayjs' import { useAtom } from 'jotai' import groupBy from 'lodash/groupBy' import keyBy from 'lodash/keyBy' -import { useCallback, useMemo } from 'react' +import { useCallback, useEffect, useMemo, useState } from 'react' import { publicClient } from 'utils/viem' import { zeroAddress } from 'viem' import { Address } from 'viem/accounts' @@ -23,6 +23,7 @@ type ArrayItemType = T extends Array ? U : T export const useFarmPools = () => { const [pools, setPools] = useAtom(farmPoolsAtom) + const [farmConfig, setFarmConfig] = useState([]) const { isLoading } = useQuery({ queryKey: ['fetchFarmPools'], @@ -35,11 +36,20 @@ export const useFarmPools = () => { refetchOnWindowFocus: false, }) - const { data: poolsStatus, pending: isPoolStatusPending } = useMultiChainV3PoolsStatus(UNIVERSAL_FARMS) - const { data: poolsTimeFrame, pending: isPoolsTimeFramePending } = useMultiChainPoolsTimeFrame(UNIVERSAL_FARMS) + useEffect(() => { + const fetchFarmConfig = async () => { + const response: UniversalFarmConfig[] = await fetchAllUniversalFarms() + setFarmConfig(response) + } + + fetchFarmConfig() + }, []) + + const { data: poolsStatus, pending: isPoolStatusPending } = useMultiChainV3PoolsStatus(farmConfig) + const { data: poolsTimeFrame, pending: isPoolsTimeFramePending } = useMultiChainPoolsTimeFrame(farmConfig) const poolsWithStatus: ((PoolInfo | UniversalFarmConfig) & { isActiveFarm?: boolean })[] = useMemo(() => { - const farms = pools.length ? pools : UNIVERSAL_FARMS + const farms = pools.length ? pools : farmConfig return farms.map((f: PoolInfo | UniversalFarmConfig) => { if (f.protocol === Protocol.V3) { return { @@ -58,7 +68,7 @@ export const useFarmPools = () => { } return f }) - }, [pools, poolsStatus, isPoolStatusPending, poolsTimeFrame, isPoolsTimeFramePending]) + }, [pools, farmConfig, isPoolStatusPending, poolsStatus, isPoolsTimeFramePending, poolsTimeFrame]) return { loaded: !isLoading, data: poolsWithStatus } } diff --git a/apps/web/src/state/farmsV4/state/utils.ts b/apps/web/src/state/farmsV4/state/utils.ts index 071b633b3d6a6..76a26eb5e3616 100644 --- a/apps/web/src/state/farmsV4/state/utils.ts +++ b/apps/web/src/state/farmsV4/state/utils.ts @@ -1,4 +1,4 @@ -import { Protocol, UNIVERSAL_FARMS } from '@pancakeswap/farms' +import { Protocol, fetchAllUniversalFarms } from '@pancakeswap/farms' import { LegacyRouter } from '@pancakeswap/smart-router/legacy-router' import { Token } from '@pancakeswap/swap-sdk-core' import { getTokenByAddress } from '@pancakeswap/tokens' @@ -8,13 +8,15 @@ import { safeGetAddress } from 'utils' import { Address } from 'viem' import { PoolInfo } from './type' -export const parseFarmPools = ( +export const parseFarmPools = async ( data: | paths['/cached/pools/farming']['get']['responses']['200']['content']['application/json'] | paths['/cached/pools/list']['get']['responses']['200']['content']['application/json']['rows'] | paths['/cached/pools/{chainName}/{id}']['get']['responses']['200']['content']['application/json'][], options: { isFarming?: boolean } = {}, -): PoolInfo[] => { +): Promise => { + const fetchFarmConfig = await fetchAllUniversalFarms() + return data.map((pool) => { let stableSwapAddress: Address | undefined let lpAddress = safeGetAddress(pool.id)! @@ -29,7 +31,7 @@ export const parseFarmPools = ( feeTier = stableConfig.stableTotalFee * 1000000 } } - const localFarm = UNIVERSAL_FARMS.find( + const localFarm = fetchFarmConfig.find( (farm) => safeGetAddress(farm.lpAddress) === safeGetAddress(lpAddress) && farm.chainId === pool.chainId, ) let pid: number | undefined diff --git a/apps/web/src/views/AddLiquidityV3/formViews/V3FormView/components/FeeSelector.tsx b/apps/web/src/views/AddLiquidityV3/formViews/V3FormView/components/FeeSelector.tsx index c172712846d5d..7138e852e444a 100644 --- a/apps/web/src/views/AddLiquidityV3/formViews/V3FormView/components/FeeSelector.tsx +++ b/apps/web/src/views/AddLiquidityV3/formViews/V3FormView/components/FeeSelector.tsx @@ -1,5 +1,10 @@ -import { ChainId } from '@pancakeswap/chains' -import { legacyFarmsV3ConfigChainMap } from '@pancakeswap/farms/constants/v3' +import { + ComputedFarmConfigV3, + defineFarmV3ConfigsFromUniversalFarm, + fetchUniversalFarms, + Protocol, + UniversalFarmConfigV3, +} from '@pancakeswap/farms' import { useTranslation } from '@pancakeswap/localization' import { Currency } from '@pancakeswap/sdk' import { AtomBox, AutoColumn, Button, CircleLoader, Text } from '@pancakeswap/uikit' @@ -37,7 +42,18 @@ export default function FeeSelector({ }) { const { t } = useTranslation() const { chainId } = useActiveChainId() - const farmV3Config = legacyFarmsV3ConfigChainMap[currencyA?.chainId as ChainId] + const [farmV3Config, setFarmV3Config] = useState([]) + + useEffect(() => { + const fetchFarmV3Config = async () => { + if (currencyA?.chainId) { + const farms = await fetchUniversalFarms(currencyA?.chainId, Protocol.V3) + setFarmV3Config(defineFarmV3ConfigsFromUniversalFarm(farms as UniversalFarmConfigV3[])) + } + } + + fetchFarmV3Config() + }, [currencyA]) const farmV3 = useMemo(() => { if (currencyA && currencyB) { diff --git a/apps/web/src/views/Home/components/Banners/hooks/useIsRenderUserBanner.ts b/apps/web/src/views/Home/components/Banners/hooks/useIsRenderUserBanner.ts index 683e2bb95b033..7f347ab24e83f 100644 --- a/apps/web/src/views/Home/components/Banners/hooks/useIsRenderUserBanner.ts +++ b/apps/web/src/views/Home/components/Banners/hooks/useIsRenderUserBanner.ts @@ -1,5 +1,4 @@ -import { getLegacyFarmConfig } from '@pancakeswap/farms' -import { legacyFarmsV3ConfigChainMap } from '@pancakeswap/farms/constants/v3' +import { fetchUniversalFarms, getLegacyFarmConfig, Protocol } from '@pancakeswap/farms' import { useQuery } from '@tanstack/react-query' import BigNumber from 'bignumber.js' import useActiveWeb3React from 'hooks/useActiveWeb3React' @@ -16,7 +15,8 @@ const useIsRenderUserBanner = () => { queryKey: ['shouldRenderUserBanner', account], queryFn: async () => { const v2FarmsConfigSize = (await getLegacyFarmConfig(chainId))?.length || 0 - const v3FarmsConfigSize = legacyFarmsV3ConfigChainMap[chainId]?.length || 0 + const farmsV3 = await fetchUniversalFarms(chainId, Protocol.V3) + const v3FarmsConfigSize = farmsV3?.length || 0 const totalFarmSize = v2FarmsConfigSize + v3FarmsConfigSize return Boolean(totalFarmSize) }, diff --git a/apps/web/src/views/Migration/components/bCake/MigrationFarmStep.tsx b/apps/web/src/views/Migration/components/bCake/MigrationFarmStep.tsx index cc0d175d9ac7d..1462bc7c8986b 100644 --- a/apps/web/src/views/Migration/components/bCake/MigrationFarmStep.tsx +++ b/apps/web/src/views/Migration/components/bCake/MigrationFarmStep.tsx @@ -1,3 +1,4 @@ +import { ChainId } from '@pancakeswap/chains' import { DeserializedFarm, FarmWithStakedValue } from '@pancakeswap/farms' import { useTranslation } from '@pancakeswap/localization' import BigNumber from 'bignumber.js' @@ -25,7 +26,10 @@ const MigrationFarmStep: React.FC> = ( const userDataReady = !account || (!!account && userDataLoaded) const stakedOrHasTokenBalance = useMemo(() => { - const farms = farmsLP.filter((farm) => farm.pid !== 0).filter((farm) => Boolean(farm?.bCakeWrapperAddress)) + const farms = farmsLP + .filter((farm) => farm.pid !== 0) + .filter((farm) => Boolean(farm?.bCakeWrapperAddress)) + .filter((farm) => farm.pid !== 11 && farm.token.serialize.chainId !== ChainId.ETHEREUM) return farms.filter((farm) => { return ( diff --git a/apps/web/src/views/PoolDetail/components/PoolInfo.tsx b/apps/web/src/views/PoolDetail/components/PoolInfo.tsx index 594e93322ad7b..1cf8a127d8f04 100644 --- a/apps/web/src/views/PoolDetail/components/PoolInfo.tsx +++ b/apps/web/src/views/PoolDetail/components/PoolInfo.tsx @@ -29,11 +29,13 @@ export const PoolInfo = () => { const poolInfo = usePoolInfoByQuery() const chainId = useChainIdByQuery() const networkName = useChainNameByQuery() + const [currency0, currency1] = useMemo(() => { if (!poolInfo) return [undefined, undefined] const { token0, token1 } = poolInfo return [token0.wrapped, token1.wrapped] }, [poolInfo]) + const fee = useMemo(() => { return new Percent(poolInfo?.feeTier ?? 0n, poolInfo?.feeTierBase) }, [poolInfo?.feeTier, poolInfo?.feeTierBase]) diff --git a/apps/web/src/views/Swap/components/HotTokenList/SwapTokenTable.tsx b/apps/web/src/views/Swap/components/HotTokenList/SwapTokenTable.tsx deleted file mode 100644 index c418756734611..0000000000000 --- a/apps/web/src/views/Swap/components/HotTokenList/SwapTokenTable.tsx +++ /dev/null @@ -1,449 +0,0 @@ -import { useTranslation } from '@pancakeswap/localization' -import { Currency, Token } from '@pancakeswap/sdk' -import { - ArrowBackIcon, - ArrowForwardIcon, - Box, - Button, - Flex, - MoreIcon, - Skeleton, - SortArrowIcon, - Text, - useMatchBreakpoints, -} from '@pancakeswap/uikit' - -import { NextLinkFromReactRouter } from '@pancakeswap/widgets-internal' -import { useActiveChainId } from 'hooks/useActiveChainId' -import useTheme from 'hooks/useTheme' -import orderBy from 'lodash/orderBy' -import { Fragment, useCallback, useEffect, useMemo, useState } from 'react' -import { MultiChainName, multiChainName } from 'state/info/constant' -import { useStableSwapPath } from 'state/info/hooks' -import { InfoDataSource } from 'state/info/types' -import { getTokenInfoPath } from 'state/info/utils' -import { styled } from 'styled-components' -import { safeGetAddress } from 'utils' -import { logGTMClickTokenHighLightTradeEvent } from 'utils/customGTMEventTracking' -import { formatAmount } from 'utils/formatInfoNumbers' -import { getTokenNameAlias, getTokenSymbolAlias } from 'utils/getTokenAlias' -import { CurrencyLogo } from 'views/Info/components/CurrencyLogo' -import { Arrow, Break, ClickableColumnHeader, PageButtons, TableWrapper } from 'views/Info/components/InfoTables/shared' -import Percent from 'views/Info/components/Percent' - -import TradingRewardIcon from 'views/Swap/components/HotTokenList/TradingRewardIcon' - -import { TokenHighlightData } from './types' - -/** - * Columns on different layouts - * 6 = | # | Name | Price | Price Change | Volume 24H | TVL | - * 5 = | # | Name | Price | | Volume 24H | TVL | - * 4 = | # | Name | Price | | Volume 24H | | - * 2 = | | Name | | | Volume 24H | | - * On smallest screen Name is reduced to just symbol - */ - -type TableType = 'priceChange' | 'volume' | 'liquidity' - -const ResponsiveGrid = styled.div` - display: grid; - grid-gap: 1em; - align-items: center; - - padding: 0 24px; - - grid-template-columns: 4fr 1fr 1fr 2fr; - - @media screen and (max-width: 900px) { - grid-template-columns: 2fr repeat(3, 1fr); - } - - @media screen and (max-width: 800px) { - grid-template-columns: 2fr repeat(3, 1fr); - & :nth-child(6) { - display: none; - } - } - - @media screen and (max-width: 670px) { - grid-template-columns: 2fr 1fr 1fr 2fr; - } -` -const TableRowWrapper = styled(Flex)` - width: 100%; - flex-direction: column; - gap: 16px; - background-color: ${({ theme }) => theme.card.background}; - border: 1px solid ${({ theme }) => theme.colors.cardBorder}; - - @media screen and (max-width: 575px) { - max-height: 450px; - overflow-y: auto; - } -` - -const LinkWrapper = styled(NextLinkFromReactRouter)` - text-decoration: none; - &:hover { - cursor: pointer; - opacity: 0.7; - } -` - -const ResponsiveLogo = styled(CurrencyLogo)` - border-radius: 50%; - width: 24px; - height: 24px; - @media screen and (max-width: 670px) { - width: 16px; - height: 16px; - } -` -const StyledClickableColumnHeader = styled(ClickableColumnHeader)` - display: flex; - align-items: center; - gap: 5px; -` - -const SortButton = styled(Button)` - padding: 4px 8px; - border-radius: 8px; - width: 25px; - height: 25px; - margin-left: 3px; - border-color: ${({ theme }) => theme.colors.cardBorder}; - background: ${({ theme }) => (theme.isDark ? theme.colors.backgroundDisabled : theme.colors.input)}; - path { - fill: ${({ theme }) => (theme.isDark ? 'rgba(255, 255, 255, 0.2)' : '#B4ACCF')}; - } - &.is-asc { - background: ${({ theme }) => (theme.isDark ? theme.colors.input : theme.colors.textSubtle)}; - path:first-child { - fill: rgba(255, 255, 255, 1); - } - path:last-child { - fill: rgba(255, 255, 255, 0.3); - } - } - &.is-desc { - background: ${({ theme }) => (theme.isDark ? theme.colors.input : theme.colors.textSubtle)}; - path:first-child { - fill: rgba(255, 255, 255, 0.3); - } - path:last-child { - fill: rgba(255, 255, 255, 1); - } - } -` - -const TableLoader: React.FC = () => { - const loadingRow = ( - - - - - - - - - - - - ) - return ( - <> - {loadingRow} - {loadingRow} - {loadingRow} - - ) -} - -const DataRow: React.FC< - React.PropsWithChildren<{ - dataSource: InfoDataSource - tokenData: TokenHighlightData - index: number - type: TableType - handleOutputSelect: (newCurrencyOutput: Currency) => void - }> -> = ({ tokenData, type, handleOutputSelect, dataSource }) => { - const { t } = useTranslation() - const { theme } = useTheme() - const { isXs, isSm } = useMatchBreakpoints() - const stableSwapPath = useStableSwapPath() - const { chainId } = useActiveChainId() - const address = safeGetAddress(tokenData.address) - const chainName = multiChainName[chainId ?? ''] as MultiChainName - const currencyFromAddress = useMemo( - () => (address && chainId ? new Token(chainId, address, tokenData.decimals, tokenData.symbol) : undefined), - [tokenData, chainId, address], - ) - const tokenInfoLink = useMemo( - () => getTokenInfoPath(chainId, tokenData.address, dataSource, stableSwapPath), - [dataSource, tokenData.address, stableSwapPath, chainId], - ) - if (!address) return null - - const isTradeRewardToken = dataSource === InfoDataSource.V3 && (tokenData?.pairs?.length ?? 0) > 0 - const tokenSymbol = getTokenSymbolAlias(address, chainId, tokenData?.symbol) - const tokenName = getTokenNameAlias(address, chainId, tokenData?.name) - - return ( - - - - - {(isXs || isSm) && {tokenData.symbol}} - {!isXs && !isSm && ( - - {tokenName} - ({tokenSymbol}) - - )} - - {(type === 'priceChange' || type === 'liquidity') && ( - - ${formatAmount(tokenData.priceUSD, { notation: 'standard' })} - - )} - {type !== 'liquidity' && ( - - - - - - )} - {type === 'volume' && ${formatAmount(tokenData.volumeUSD)}} - {type === 'liquidity' && ${formatAmount(tokenData.tvlUSD)}} - - {isTradeRewardToken && } - - - | - - - - - - ) -} - -const SORT_FIELD = { - name: 'name', - volumeUSD: 'volumeUSD', - liquidityUSD: 'liquidityUSD', - priceUSD: 'priceUSD', - priceUSDChange: 'priceUSDChange', - priceUSDChangeWeek: 'priceUSDChangeWeek', -} - -const MAX_ITEMS = 10 - -const TokenTable: React.FC< - React.PropsWithChildren<{ - dataSource: InfoDataSource - tokenDatas: TokenHighlightData[] | undefined - maxItems?: number - defaultSortField?: string - type: TableType - handleOutputSelect: (newCurrencyOutput: Currency) => void - }> -> = ({ - tokenDatas, - maxItems = MAX_ITEMS, - defaultSortField = SORT_FIELD.volumeUSD, - type, - handleOutputSelect, - dataSource, -}) => { - const [sortField, setSortField] = useState(SORT_FIELD[defaultSortField]) - const { isMobile } = useMatchBreakpoints() - useEffect(() => { - if (defaultSortField) { - setSortField(defaultSortField) - setPage(1) - } - }, [defaultSortField]) - - const [sortDirection, setSortDirection] = useState(true) - const { t } = useTranslation() - - const [page, setPage] = useState(1) - const [maxPage, setMaxPage] = useState(1) - useEffect(() => { - let extraPages = 1 - if (tokenDatas) { - if (tokenDatas.length % maxItems === 0) { - extraPages = 0 - } - setMaxPage(Math.floor(tokenDatas.length / maxItems) + extraPages) - } - }, [maxItems, tokenDatas]) - - const sortedTokens = useMemo(() => { - return tokenDatas - ? orderBy( - tokenDatas, - (tokenData) => tokenData[sortField as keyof TokenHighlightData], - sortDirection ? 'desc' : 'asc', - ).slice(maxItems * (page - 1), page * maxItems) - : [] - }, [tokenDatas, maxItems, page, sortDirection, sortField]) - - const handleSort = useCallback( - (newField: string) => { - setSortField(newField) - setSortDirection(sortField !== newField ? true : !sortDirection) - }, - [sortDirection, sortField], - ) - - const arrowClassName = useCallback( - (field: string) => { - const directionArrow = !sortDirection ? 'is-asc' : 'is-desc' - return sortField === field ? directionArrow : '' - }, - [sortDirection, sortField], - ) - - if (!tokenDatas) { - return - } - return ( - - - handleSort(SORT_FIELD.name)} - textTransform="uppercase" - > - {t('Token Name')} - - {(type === 'priceChange' || type === 'liquidity') && ( - handleSort(SORT_FIELD.priceUSD)} - textTransform="uppercase" - > - {t('Price')}{' '} - - - - - )} - - {type !== 'liquidity' && ( - handleSort(SORT_FIELD.priceUSDChange)} - textTransform="uppercase" - > - {t('Change')}{' '} - - - - - )} - {type === 'liquidity' && ( - handleSort(SORT_FIELD.liquidityUSD)} - textTransform="uppercase" - > - {t('Liquidity')} - - - - - )} - {type === 'volume' && ( - handleSort(SORT_FIELD.volumeUSD)} - textTransform="uppercase" - > - {t('Volume 24H')}{' '} - - - - - )} - - - - {sortedTokens.length > 0 ? ( - <> - {sortedTokens.map((data, i) => { - if (data) { - return ( - - - - - ) - } - return null - })} - {!isMobile && ( - - { - setPage(page === 1 ? page : page - 1) - }} - > - - - {t('Page %page% of %maxPage%', { page, maxPage })} - { - setPage(page === maxPage ? page : page + 1) - }} - > - - - - )} - - ) : ( - <> - - - - )} - - - ) -} - -export default TokenTable diff --git a/apps/web/src/views/Swap/components/HotTokenList/TradingRewardIcon.tsx b/apps/web/src/views/Swap/components/HotTokenList/TradingRewardIcon.tsx deleted file mode 100644 index 87862c63898dc..0000000000000 --- a/apps/web/src/views/Swap/components/HotTokenList/TradingRewardIcon.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { Flex, Box, Text, useTooltip } from '@pancakeswap/uikit' -import { useTranslation } from '@pancakeswap/localization' -import Image from 'next/image' -import { useRouter } from 'next/router' -import { ComputedFarmConfigV3 } from '@pancakeswap/farms' - -interface TradingRewardIconProps { - pairs: ComputedFarmConfigV3[] -} - -const TradingRewardIcon = ({ pairs }: TradingRewardIconProps) => { - const { t } = useTranslation() - const router = useRouter() - - const handleClick = (e) => { - e.stopPropagation() - e.preventDefault() - router.push('/trading-reward') - } - - const { targetRef, tooltip, tooltipVisible } = useTooltip( - - {t('This token contains trading pair(s) eligible for earning CAKE by trading:')} - - {pairs.map((pair) => ( - {`${pair.lpSymbol} - ${pair.feeAmount / 10000}%`} - ))} - - - - {t('Trade now or check out the campaign page to learn more')} - - - {t('learn more')} - - - , - { - placement: 'top', - }, - ) - - return ( - - token-reward-icon - {tooltipVisible && tooltip} - - ) -} - -export default TradingRewardIcon diff --git a/apps/web/src/views/Swap/components/HotTokenList/constants.ts b/apps/web/src/views/Swap/components/HotTokenList/constants.ts deleted file mode 100644 index 9508a88af9372..0000000000000 --- a/apps/web/src/views/Swap/components/HotTokenList/constants.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TokenHighlightData } from './types' - -export const BSC_PROMOTION_TOKENS: TokenHighlightData[] = [ - { - name: 'Arbitrum', - symbol: 'ARB', - address: '0xa050FFb3eEb8200eEB7F61ce34FF644420FD3522', - tvlUSD: 0, - tvlUSDChange: 0, - priceUSD: 0, - priceUSDChange: 0, - volumeUSD: 0, - decimals: 18, - }, -] diff --git a/apps/web/src/views/Swap/components/HotTokenList/index.tsx b/apps/web/src/views/Swap/components/HotTokenList/index.tsx deleted file mode 100644 index 3df8ce02e7bbd..0000000000000 --- a/apps/web/src/views/Swap/components/HotTokenList/index.tsx +++ /dev/null @@ -1,191 +0,0 @@ -import { ChainId } from '@pancakeswap/chains' -import { useTranslation } from '@pancakeswap/localization' -import { Currency } from '@pancakeswap/sdk' -import { ButtonMenu, ButtonMenuItem, Checkbox, Flex, Text, useMatchBreakpoints } from '@pancakeswap/uikit' -import { useActiveChainId } from 'hooks/useActiveChainId' -import { useRouter } from 'next/router' -import { memo, useEffect, useMemo, useState } from 'react' -import { styled } from 'styled-components' - -import { TabToggle, TabToggleGroup } from 'components/TabToggle' -import { InfoDataSource as DataSourceType } from 'state/info/types' - -import useTradingRewardTokenList from '../../hooks/useTradingRewardTokenList' -import TokenTable from './SwapTokenTable' -import { useTokenHighLightList } from './useList' - -const StyledFlex = styled(Flex)` - border: 1px solid ${({ theme }) => theme.colors.cardBorder}; - overflow: hidden; - border-radius: 32px; - > div:first-child { - min-height: 56px; - } - > div:first-child > div { - background: ${({ theme }) => (theme.isDark ? `rgba(55, 47, 71,0.5)` : `rgba(238, 234, 244, 0.5)`)}; - overflow: hidden; - } -` - -const StyledTabToggle = styled(TabToggle)` - cursor: pointer; - background-color: ${({ theme, isActive }) => - isActive ? (theme.isDark ? 'rgb(45,48,72)' : '#ffffff') : 'transparent'}; - ${({ theme }) => theme.mediaQueries.sm} { - background-color: ${({ theme, isActive }) => - isActive ? (theme.isDark ? 'rgb(45,48,72)' : '#f4fdff') : 'transparent'}; - } -` - -const Wrapper = styled.div` - padding-top: 10px; - ${({ theme }) => theme.mediaQueries.lg} { - width: 725px; - padding: 24px; - box-sizing: border-box; - background: ${({ theme }) => (theme.isDark ? 'rgba(39, 38, 44, 0.5)' : 'rgba(255, 255, 255, 0.5)')}; - border-top: none; - border-radius: 0px 0px 32px 32px; - } -` -const MenuWrapper = styled.div` - padding: 0px 24px 12px; - ${({ theme }) => theme.mediaQueries.lg} { - padding: 0px 0px 12px; - margin-bottom: 24px; - } -` - -const LIQUIDITY_FILTER = { [ChainId.BSC]: 100000, [ChainId.ETHEREUM]: 50000 } -const HotTokenList: React.FC<{ handleOutputSelect: (newCurrencyOutput: Currency) => void }> = ({ - handleOutputSelect, -}) => { - const { query } = useRouter() - const { chainId } = useActiveChainId() - const { v2Tokens, v3Tokens } = useTokenHighLightList() - const [dataSource, setDataSource] = useState(DataSourceType.V3) - const [index, setIndex] = useState(0) - const { isMobile } = useMatchBreakpoints() - const [confirmed, setConfirmed] = useState(false) - const { tokenPairs } = useTradingRewardTokenList() - - useEffect(() => { - if (query.showTradingReward) { - setConfirmed(true) - } - }, [query, setConfirmed]) - - const formattedTokens = useMemo( - () => - v2Tokens - .filter( - (t) => - t.priceUSD !== 0 && t.priceUSDChange !== 0 && t.volumeUSD !== 0 && t.tvlUSD >= LIQUIDITY_FILTER[chainId!], - ) - .map((i) => { - const tokenAddress = i?.address?.toLowerCase() - const pairs = tokenPairs?.filter( - (pair) => - pair?.token?.address?.toLowerCase() === tokenAddress || - pair?.quoteToken?.address?.toLowerCase() === tokenAddress, - ) - return { - ...i, - pairs, - } - }), - [v2Tokens, chainId, tokenPairs], - ) - - const formattedV3Tokens = useMemo( - () => - v3Tokens - .filter( - (t) => - t.priceUSD !== 0 && t.priceUSDChange !== 0 && t.volumeUSD !== 0 && t.tvlUSD >= LIQUIDITY_FILTER[chainId!], - ) - .map((i) => { - const tokenAddress = i?.address?.toLowerCase() - const pairs = tokenPairs?.filter( - (pair) => - pair?.token?.address?.toLowerCase() === tokenAddress || - pair?.quoteToken?.address?.toLowerCase() === tokenAddress, - ) - return { - ...i, - pairs, - } - }), - [v3Tokens, chainId, tokenPairs], - ) - - const filterFormattedV3Tokens = useMemo(() => { - if (confirmed) { - return formattedV3Tokens.filter((token) => token.pairs.length > 0) - } - return formattedV3Tokens - }, [confirmed, formattedV3Tokens]) - - const { t } = useTranslation() - return ( - - - setDataSource(DataSourceType.V3)}> - {t('V3')} - - setDataSource(DataSourceType.V2)}> - {t('V2')} - - - - - - {chainId === ChainId.BSC ? t('Price Change') : t('Liquidity')} - {t('Volume (24H)')} - - - {dataSource === DataSourceType.V3 && tokenPairs.length > 0 && ( - setConfirmed(!confirmed)} - style={{ cursor: 'pointer' }} - > - setConfirmed(!confirmed)} - /> - - {t('Show pairs with trading rewards')} - - - )} - {index === 0 ? ( - - ) : ( - - )} - - - ) -} - -export default memo(HotTokenList) diff --git a/apps/web/src/views/Swap/components/HotTokenList/types.ts b/apps/web/src/views/Swap/components/HotTokenList/types.ts deleted file mode 100644 index 4571a61c8aeab..0000000000000 --- a/apps/web/src/views/Swap/components/HotTokenList/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Token } from '@pancakeswap/swap-sdk-core' -import { FeeAmount } from '@pancakeswap/v3-sdk' -import { Address } from 'viem' - -export type ComputedFarmConfigV3 = { - pid: number - lpSymbol: string - lpAddress: Address - boosted?: boolean - - token: Token - quoteToken: Token - feeAmount: FeeAmount - - token0: Token - token1: Token - isCommunity?: boolean -} - -export type TokenHighlightData = { - name: string - symbol: string - address: string - tvlUSD: number - tvlUSDChange: number - priceUSD: number - priceUSDChange: number - volumeUSD: number - pairs?: ComputedFarmConfigV3[] - decimals: number -} diff --git a/apps/web/src/views/Swap/components/HotTokenList/useList.tsx b/apps/web/src/views/Swap/components/HotTokenList/useList.tsx deleted file mode 100644 index 765dde8e27e31..0000000000000 --- a/apps/web/src/views/Swap/components/HotTokenList/useList.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { ChainId } from '@pancakeswap/chains' -import { PANCAKE_EXTENDED } from 'config/constants/lists' -import { useActiveChainId } from 'hooks/useActiveChainId' -import { useAtomValue } from 'jotai' -import { useMemo } from 'react' -import { multiChainName } from 'state/info/constant' -import { useAllTokenHighLight, useTokenDatasQuery } from 'state/info/hooks' -import { selectorByUrlsAtom } from 'state/lists/hooks' -import { useTokensData } from 'views/V3Info/hooks' -import { parseV2TokenData, parseV3TokenData } from './utils' - -export const useChainWhiteList = (chainId?: number) => { - const listsByUrl = useAtomValue(selectorByUrlsAtom) - const whiteList = useMemo(() => { - const list = listsByUrl[PANCAKE_EXTENDED]?.current - return list ? list.tokens.map((t) => t.address.toLowerCase()) : [] - }, [listsByUrl]) - if (chainId !== ChainId.BSC) return null - return whiteList -} - -export const useTokenHighLightList = () => { - const { chainId } = useActiveChainId() - const chainWhiteList = useChainWhiteList(chainId) - const allTokensFromWhiteList = useTokenDatasQuery(chainWhiteList || [], false) - const allTokensFromChain = useAllTokenHighLight({ - enable: Boolean(!chainWhiteList && chainId), - targetChainName: chainId ? multiChainName[chainId] : undefined, - }) - const tokenAddresses: string[] = useMemo( - () => allTokensFromChain?.map(({ address }) => address) || [], - [allTokensFromChain], - ) - const allV3TokensFromV3 = useTokensData(chainWhiteList || tokenAddresses, chainId) - - const tokens = useMemo(() => { - return { - v2Tokens: (allTokensFromWhiteList || allTokensFromChain)?.map(parseV2TokenData), - v3Tokens: allV3TokensFromV3?.map(parseV3TokenData) ?? [], - } - }, [allTokensFromWhiteList, allTokensFromChain, allV3TokensFromV3]) - - return tokens -} diff --git a/apps/web/src/views/Swap/components/HotTokenList/utils.ts b/apps/web/src/views/Swap/components/HotTokenList/utils.ts deleted file mode 100644 index 781d3f9373ff5..0000000000000 --- a/apps/web/src/views/Swap/components/HotTokenList/utils.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { TokenData as TokenDataV2 } from 'state/info/types' -import { TokenData as TokenDataV3 } from 'views/V3Info/types' - -import { TokenHighlightData } from './types' - -export const parseV2TokenData = (tokenData: TokenDataV2): TokenHighlightData => { - const { - name, - symbol, - address, - decimals, - priceUSD, - priceUSDChange, - volumeUSD, - pairs, - liquidityUSD, - liquidityUSDChange, - } = tokenData - return { - name, - symbol, - address, - tvlUSD: liquidityUSD, - tvlUSDChange: liquidityUSDChange, - priceUSD, - priceUSDChange, - volumeUSD, - pairs, - decimals, - } -} - -export const parseV3TokenData = (tokenData: TokenDataV3): TokenHighlightData => { - const { name, symbol, decimals, address, priceUSD, priceUSDChange, volumeUSD, tvlUSD, tvlUSDChange } = tokenData - return { - name, - symbol, - address, - decimals, - tvlUSD, - tvlUSDChange, - priceUSD, - priceUSDChange, - volumeUSD, - } -} diff --git a/apps/web/src/views/Swap/hooks/useTradingRewardTokenList.tsx b/apps/web/src/views/Swap/hooks/useTradingRewardTokenList.tsx index 6cb01e68bad4e..3b8a2e7d86d81 100644 --- a/apps/web/src/views/Swap/hooks/useTradingRewardTokenList.tsx +++ b/apps/web/src/views/Swap/hooks/useTradingRewardTokenList.tsx @@ -1,16 +1,34 @@ -import { ChainId } from '@pancakeswap/chains' -import { legacyFarmsV3ConfigChainMap } from '@pancakeswap/farms/constants/v3' +import { + ComputedFarmConfigV3, + defineFarmV3ConfigsFromUniversalFarm, + fetchUniversalFarms, + Protocol, + UniversalFarmConfigV3, +} from '@pancakeswap/farms' import { useActiveChainId } from 'hooks/useActiveChainId' -import { useMemo } from 'react' +import { useEffect, useMemo, useState } from 'react' import useAllTradingRewardPair, { RewardStatus, RewardType } from 'views/TradingReward/hooks/useAllTradingRewardPair' const useTradingRewardTokenList = () => { const { chainId } = useActiveChainId() + const [farms, setFarms] = useState([]) + const { data } = useAllTradingRewardPair({ status: RewardStatus.ALL, type: RewardType.CAKE_STAKERS, }) + useEffect(() => { + const fetchFarmV3Config = async () => { + if (chainId) { + const farmsV3 = await fetchUniversalFarms(chainId, Protocol.V3) + setFarms(defineFarmV3ConfigsFromUniversalFarm(farmsV3 as UniversalFarmConfigV3[])) + } + } + + fetchFarmV3Config() + }, [chainId]) + const uniqueAddressList = useMemo(() => { const currentTime = Date.now() / 1000 @@ -42,13 +60,12 @@ const useTradingRewardTokenList = () => { uniqueAddressList // eslint-disable-next-line array-callback-return, consistent-return .map((list) => { - const farms = legacyFarmsV3ConfigChainMap[chainId as ChainId] const pair = farms.find((farm) => farm.lpAddress.toLowerCase() === (list as string).toLowerCase()) if (pair) return pair }) .filter((i) => Boolean(i)) ) - }, [uniqueAddressList, chainId]) + }, [uniqueAddressList, farms]) return { tokenPairs, diff --git a/apps/web/src/views/Swap/index.tsx b/apps/web/src/views/Swap/index.tsx index 4e4b64f0bbb0b..9b0a4a02b3855 100644 --- a/apps/web/src/views/Swap/index.tsx +++ b/apps/web/src/views/Swap/index.tsx @@ -19,16 +19,9 @@ import { SwapType } from './types' export default function Swap() { const { query } = useRouter() const { isDesktop } = useMatchBreakpoints() - const { - isChartExpanded, - isChartDisplayed, - setIsChartDisplayed, - setIsChartExpanded, - isChartSupported, - // isHotTokenSupported, - } = useContext(SwapFeaturesContext) + const { isChartExpanded, isChartDisplayed, setIsChartDisplayed, setIsChartExpanded, isChartSupported } = + useContext(SwapFeaturesContext) const [isSwapHotTokenDisplay, setIsSwapHotTokenDisplay] = useSwapHotTokenDisplay() - // const { t } = useTranslation() const [firstTime, setFirstTime] = useState(true) useEffect(() => { @@ -98,27 +91,6 @@ export default function Swap() { setIsOpen={(isOpen) => setIsChartDisplayed?.(isOpen)} /> )} - {/* {isDesktop && isSwapHotTokenDisplay && isHotTokenSupported && ( - - )} */} - {/* setIsSwapHotTokenDisplay(false)} - > - setIsSwapHotTokenDisplay(false)} - bodyPadding="0px" - > - { - handleOutputSelect(newCurrencyOutput) - setIsSwapHotTokenDisplay(false) - }} - /> - - */} diff --git a/apps/web/src/views/TradingReward/config/pairs/index.tsx b/apps/web/src/views/TradingReward/config/pairs/index.tsx index b92804558f846..1dc46272fb087 100644 --- a/apps/web/src/views/TradingReward/config/pairs/index.tsx +++ b/apps/web/src/views/TradingReward/config/pairs/index.tsx @@ -2,16 +2,6 @@ import { ChainId } from '@pancakeswap/chains' import { ComputedFarmConfigV3, FarmV3SupportedChainId } from '@pancakeswap/farms/src' // Edge Case Farms -import { legacyV3ArbFarmConfig } from '@pancakeswap/farms/src/farms/arb' -import { legacyV3BaseFarmConfig } from '@pancakeswap/farms/src/farms/base' -import { legacyV3BscFarmConfig } from '@pancakeswap/farms/src/farms/bsc' -import { legacyV3BscTestnetFarmConfig } from '@pancakeswap/farms/src/farms/bscTestnet' -import { legacyV3EthereumFarmConfig } from '@pancakeswap/farms/src/farms/eth' -import { legacyV3LineaFarmConfig } from '@pancakeswap/farms/src/farms/linea' -import { legacyV3OpBNBFarmConfig } from '@pancakeswap/farms/src/farms/opBNB' -import { legacyV3OpBNBTestnetFarmConfig } from '@pancakeswap/farms/src/farms/opBnbTestnet' -import { legacyV3PolygonZkEVMFarmConfig } from '@pancakeswap/farms/src/farms/polygonZkEVM' -import { legacyV3ZkSyncFarmConfig } from '@pancakeswap/farms/src/farms/zkSync' import { tradingRewardBaseV3Pair } from './edgeCasesFarms/baseFarm' import { tradingRewardBscV3Pair } from './edgeCasesFarms/bscFarm' import { tradingRewardLineaV3Pair } from './edgeCasesFarms/lineaFarm' @@ -19,16 +9,16 @@ import { tradingRewardZkEvmV3Pair } from './edgeCasesFarms/zkEVMFarm' import { tradingRewardZkSyncV3Pair } from './edgeCasesFarms/zkSyncFarm' export const tradingRewardPairConfigChainMap: Record = { - [ChainId.ETHEREUM]: legacyV3EthereumFarmConfig, - [ChainId.BSC]: [...legacyV3BscFarmConfig, ...tradingRewardBscV3Pair], - [ChainId.BSC_TESTNET]: legacyV3BscTestnetFarmConfig, - [ChainId.POLYGON_ZKEVM]: [...legacyV3PolygonZkEVMFarmConfig, ...tradingRewardZkEvmV3Pair], + [ChainId.ETHEREUM]: [], + [ChainId.BSC]: [...tradingRewardBscV3Pair], + [ChainId.BSC_TESTNET]: [], + [ChainId.POLYGON_ZKEVM]: [...tradingRewardZkEvmV3Pair], [ChainId.POLYGON_ZKEVM_TESTNET]: [], - [ChainId.ZKSYNC]: [...legacyV3ZkSyncFarmConfig, ...tradingRewardZkSyncV3Pair], + [ChainId.ZKSYNC]: [...tradingRewardZkSyncV3Pair], [ChainId.ZKSYNC_TESTNET]: [], - [ChainId.ARBITRUM_ONE]: legacyV3ArbFarmConfig, - [ChainId.LINEA]: [...legacyV3LineaFarmConfig, ...tradingRewardLineaV3Pair], - [ChainId.BASE]: [...legacyV3BaseFarmConfig, ...tradingRewardBaseV3Pair], - [ChainId.OPBNB_TESTNET]: legacyV3OpBNBTestnetFarmConfig, - [ChainId.OPBNB]: legacyV3OpBNBFarmConfig, + [ChainId.ARBITRUM_ONE]: [], + [ChainId.LINEA]: [...tradingRewardLineaV3Pair], + [ChainId.BASE]: [...tradingRewardBaseV3Pair], + [ChainId.OPBNB_TESTNET]: [], + [ChainId.OPBNB]: [], } diff --git a/apps/web/src/views/universalFarms/components/PositionActions/V2PositionActions.tsx b/apps/web/src/views/universalFarms/components/PositionActions/V2PositionActions.tsx index 918ec5e6db0d5..2c191f5febaee 100644 --- a/apps/web/src/views/universalFarms/components/PositionActions/V2PositionActions.tsx +++ b/apps/web/src/views/universalFarms/components/PositionActions/V2PositionActions.tsx @@ -8,7 +8,7 @@ import useAccountActiveChain from 'hooks/useAccountActiveChain' import { useCakePrice } from 'hooks/useCakePrice' import useCatchTxError from 'hooks/useCatchTxError' import { useTokenAllowanceByChainId } from 'hooks/useTokenAllowance' -import React, { useCallback, useMemo } from 'react' +import React, { useCallback, useEffect, useMemo, useState } from 'react' import { usePoolApr } from 'state/farmsV4/hooks' import { getBCakeWrapperAddress } from 'state/farmsV4/state/accountPositions/fetcher' import { useAccountV2PendingCakeReward } from 'state/farmsV4/state/accountPositions/hooks/useAccountV2PendingCakeReward' @@ -75,7 +75,17 @@ const useDepositModal = (props: V2PositionActionsProps) => { return sumApr(lpApr, cakeApr.value, merklApr) }, [lpApr, cakeApr.value, merklApr]) - const bCakeAddress = getBCakeWrapperAddress(lpAddress, chainId) + const [bCakeAddress, setBCakeAddress] = useState
() + + useEffect(() => { + const fetchBCakeAddress = async () => { + const address = await getBCakeWrapperAddress(lpAddress, chainId) + setBCakeAddress(address) + } + + fetchBCakeAddress() + }, [lpAddress, chainId]) + const { allowance } = useTokenAllowanceByChainId({ chainId, token: data.pair.liquidityToken, diff --git a/packages/farms/config/endpoint.ts b/packages/farms/config/endpoint.ts new file mode 100644 index 0000000000000..47c053f4dc59a --- /dev/null +++ b/packages/farms/config/endpoint.ts @@ -0,0 +1 @@ +export const FARMS_API = 'https://configs.pancakeswap.com/api/data/cached/farms' diff --git a/packages/farms/constants/v3/index.ts b/packages/farms/constants/v3/index.ts index a31113981d8a6..b07a9e9636e83 100644 --- a/packages/farms/constants/v3/index.ts +++ b/packages/farms/constants/v3/index.ts @@ -1,35 +1,5 @@ import { ChainId } from '@pancakeswap/chains' import { Address } from 'viem' -import { FarmV3SupportedChainId } from '../../src' -import { legacyV3ArbFarmConfig } from '../../src/farms/arb' -import { legacyV3BaseFarmConfig } from '../../src/farms/base' -import { legacyV3BscFarmConfig } from '../../src/farms/bsc' -import { legacyV3BscTestnetFarmConfig } from '../../src/farms/bscTestnet' -import { legacyV3EthereumFarmConfig } from '../../src/farms/eth' -import { legacyV3LineaFarmConfig } from '../../src/farms/linea' -import { legacyV3OpBNBFarmConfig } from '../../src/farms/opBNB' -import { legacyV3OpBNBTestnetFarmConfig } from '../../src/farms/opBnbTestnet' -import { legacyV3PolygonZkEVMFarmConfig } from '../../src/farms/polygonZkEVM' -import { legacyV3PolygonZkEVMTestnetFarmConfig } from '../../src/farms/polygonZkEVMTestnet' -import { legacyV3ZkSyncFarmConfig } from '../../src/farms/zkSync' -import { legacyV3ZkSyncTestnetFarmConfig } from '../../src/farms/zkSyncTestnet' -import { ComputedFarmConfigV3 } from '../../src/types' - -/** @deprecated */ -export const legacyFarmsV3ConfigChainMap: Record = { - [ChainId.ETHEREUM]: legacyV3EthereumFarmConfig, - [ChainId.BSC]: legacyV3BscFarmConfig, - [ChainId.BSC_TESTNET]: legacyV3BscTestnetFarmConfig, - [ChainId.ZKSYNC_TESTNET]: legacyV3ZkSyncTestnetFarmConfig, - [ChainId.POLYGON_ZKEVM]: legacyV3PolygonZkEVMFarmConfig, - [ChainId.POLYGON_ZKEVM_TESTNET]: legacyV3PolygonZkEVMTestnetFarmConfig, - [ChainId.ZKSYNC]: legacyV3ZkSyncFarmConfig, - [ChainId.ARBITRUM_ONE]: legacyV3ArbFarmConfig, - [ChainId.LINEA]: legacyV3LineaFarmConfig, - [ChainId.BASE]: legacyV3BaseFarmConfig, - [ChainId.OPBNB_TESTNET]: legacyV3OpBNBTestnetFarmConfig, - [ChainId.OPBNB]: legacyV3OpBNBFarmConfig, -} export type Addresses = { [chainId in ChainId]?: Address diff --git a/packages/farms/index.test.ts b/packages/farms/index.test.ts index e70810dacd9fb..d2dd93b75119a 100644 --- a/packages/farms/index.test.ts +++ b/packages/farms/index.test.ts @@ -8,9 +8,12 @@ test('exports', () => { "getPositionFarmApr", "getPositionFarmAprFactor", "FARM_AUCTION_HOSTING_IN_SECONDS", - "UNIVERSAL_FARMS", - "UNIVERSAL_FARMS_MAP", + "defineFarmV3Configs", + "defineFarmV3ConfigsFromUniversalFarm", + "fetchAllUniversalFarms", + "fetchAllUniversalFarmsMap", "UNIVERSAL_FARMS_WITH_TESTNET", + "fetchUniversalFarms", "getLegacyFarmConfig", "isStableFarm", "Protocol", diff --git a/packages/farms/scripts/build.ts b/packages/farms/scripts/build.ts index 77bce8bf13e40..c3cbfa817c9aa 100644 --- a/packages/farms/scripts/build.ts +++ b/packages/farms/scripts/build.ts @@ -1,19 +1,15 @@ /* eslint-disable no-await-in-loop */ /* eslint-disable no-restricted-syntax */ +import { ChainId } from '@pancakeswap/chains' import fs from 'fs' import path from 'path' -import bscFarms from '../src/farms/bsc' -import bscTestnetFarms from '../src/farms/bscTestnet' -import ethFarms from '../src/farms/eth' - import lpHelpers1 from '../constants/priceHelperLps/1' import lpHelpers56 from '../constants/priceHelperLps/56' -import lpHelpers97 from '../constants/priceHelperLps/97' +import { fetchUniversalFarms } from '../src/fetchUniversalFarms' const chains = [ - [1, ethFarms, lpHelpers1], - [56, bscFarms, lpHelpers56], - [97, bscTestnetFarms, lpHelpers97], + [1, fetchUniversalFarms(ChainId.ETHEREUM), lpHelpers1], + [56, fetchUniversalFarms(ChainId.BSC), lpHelpers56], ] export const saveList = async () => { @@ -24,12 +20,15 @@ export const saveList = async () => { } catch (error) { // } - for (const [chain, farm, lpHelper] of chains) { + + for (const [chain, farmPromise, lpHelper] of chains) { console.info('Starting build farm config', chain) + const farm = await farmPromise const farmListPath = `${path.resolve()}/lists/${chain}.json` const stringifiedList = JSON.stringify(farm, null, 2) fs.writeFileSync(farmListPath, stringifiedList) console.info('Farm list saved to ', farmListPath) + const lpPriceHelperListPath = `${path.resolve()}/lists/priceHelperLps/${chain}.json` const stringifiedHelperList = JSON.stringify(lpHelper, null, 2) fs.writeFileSync(lpPriceHelperListPath, stringifiedHelperList) diff --git a/packages/farms/src/farms/arb.ts b/packages/farms/src/farms/arb.ts index f5ef24f4938c2..30fd3690422df 100644 --- a/packages/farms/src/farms/arb.ts +++ b/packages/farms/src/farms/arb.ts @@ -1,897 +1,4 @@ -import { ChainId } from '@pancakeswap/chains' -import { arbitrumTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [ - { - pid: 43, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 42, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 2, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.usdt, FeeAmount.LOW), - }, - { - pid: 1, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.usdc, FeeAmount.LOW), - }, -] - -export const arbFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 95, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.wbtc, - token1: arbitrumTokens.fbtc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.wbtc, arbitrumTokens.fbtc, FeeAmount.MEDIUM), - }, - { - pid: 94, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.mBtc, arbitrumTokens.wbtc, FeeAmount.LOWEST), - token0: arbitrumTokens.mBtc, - token1: arbitrumTokens.wbtc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 93, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.egp, arbitrumTokens.weth, FeeAmount.HIGH), - token0: arbitrumTokens.egp, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.HIGH, - }, - { - pid: 92, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.usdplus, arbitrumTokens.usdt, FeeAmount.LOWEST), - token0: arbitrumTokens.usdplus, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 91, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.gusdc, FeeAmount.LOWEST), - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.gusdc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 90, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.pendle, arbitrumTokens.weth, FeeAmount.LOW), - token0: arbitrumTokens.pendle, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOW, - }, - { - pid: 89, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.seed, FeeAmount.MEDIUM), - token0: arbitrumTokens.weth, - token1: arbitrumTokens.seed, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 88, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.usde, arbitrumTokens.usdc, FeeAmount.LOWEST), - token0: arbitrumTokens.usde, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 87, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.solvbtcbbn, arbitrumTokens.solvbtc, FeeAmount.LOW), - token0: arbitrumTokens.solvbtcbbn, - token1: arbitrumTokens.solvbtc, - feeAmount: FeeAmount.LOW, - }, - { - pid: 86, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.wbtc, arbitrumTokens.solvbtc, FeeAmount.LOW), - token0: arbitrumTokens.wbtc, - token1: arbitrumTokens.solvbtc, - feeAmount: FeeAmount.LOW, - }, - { - pid: 85, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.dai, arbitrumTokens.usdt, FeeAmount.LOWEST), - token0: arbitrumTokens.dai, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 84, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.wstETH, arbitrumTokens.mstETH, FeeAmount.LOW), - token0: arbitrumTokens.wstETH, - token1: arbitrumTokens.mstETH, - feeAmount: FeeAmount.LOW, - }, - { - pid: 83, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.grt, FeeAmount.LOW), - token0: arbitrumTokens.weth, - token1: arbitrumTokens.grt, - feeAmount: FeeAmount.LOW, - }, - { - pid: 82, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.ethPlus, arbitrumTokens.weth, FeeAmount.LOWEST), - token0: arbitrumTokens.ethPlus, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 81, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.tap, arbitrumTokens.weth, FeeAmount.MEDIUM), - token0: arbitrumTokens.tap, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 80, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.usde, arbitrumTokens.usdt, FeeAmount.LOWEST), - token0: arbitrumTokens.usde, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 79, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.pendle, arbitrumTokens.weth, FeeAmount.LOWEST), - token0: arbitrumTokens.pendle, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 78, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.zro, arbitrumTokens.weth, FeeAmount.LOW), - token0: arbitrumTokens.zro, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOW, - }, - { - pid: 77, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.wstETH, arbitrumTokens.usdce, FeeAmount.LOWEST), - token0: arbitrumTokens.wstETH, - token1: arbitrumTokens.usdce, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 76, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.wbtc, arbitrumTokens.usdce, FeeAmount.LOWEST), - token0: arbitrumTokens.wbtc, - token1: arbitrumTokens.usdce, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 75, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(arbitrumTokens.wbtc, arbitrumTokens.usdt, FeeAmount.LOWEST), - token0: arbitrumTokens.wbtc, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 74, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.sqd, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(arbitrumTokens.sqd, arbitrumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 73, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.solvBTC, - token1: arbitrumTokens.solvBTCena, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.solvBTC, arbitrumTokens.solvBTCena, FeeAmount.LOW), - }, - { - pid: 72, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.zro, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.zro, arbitrumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 71, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.fusdc, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.fusdc, arbitrumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 70, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.usdce, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.usdce, FeeAmount.LOWEST), - }, - { - pid: 69, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.wbtc, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.wbtc, arbitrumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 68, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdt, - token1: arbitrumTokens.usdce, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdt, arbitrumTokens.usdce, FeeAmount.LOWEST), - }, - { - pid: 67, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.usdce, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.usdce, FeeAmount.LOWEST), - }, - { - pid: 66, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.arb, - token1: arbitrumTokens.usdce, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.arb, arbitrumTokens.usdce, FeeAmount.LOWEST), - }, - { - pid: 65, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.mim, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.mim, FeeAmount.LOWEST), - }, - { - pid: 64, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.woo, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.woo, FeeAmount.LOW), - }, - { - pid: 63, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.tia, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.tia, FeeAmount.MEDIUM), - }, - { - pid: 62, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.magic, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.magic, arbitrumTokens.weth, FeeAmount.LOW), - }, - { - pid: 61, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdv, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.usdv, arbitrumTokens.weth, FeeAmount.LOW), - }, - { - pid: 60, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.fly, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.fly, arbitrumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 59, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.axlUSDC, - token1: arbitrumTokens.usdce, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.axlUSDC, arbitrumTokens.usdce, FeeAmount.LOWEST), - }, - { - pid: 58, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weETH, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weETH, arbitrumTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 57, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.ezETH, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.ezETH, arbitrumTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 56, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.ethX, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.ethX, FeeAmount.LOWEST), - }, - { - pid: 55, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.rsETH, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.rsETH, arbitrumTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 54, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.grai, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.grai, FeeAmount.MEDIUM), - }, - { - pid: 53, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdv, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdv, arbitrumTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 52, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdv, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdv, arbitrumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 51, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.usdplus, FeeAmount.LOWEST), - }, - { - pid: 50, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.arb, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.arb, arbitrumTokens.usdplus, FeeAmount.LOWEST), - }, - { - pid: 49, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.usdplus, FeeAmount.LOWEST), - }, - { - pid: 48, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.wbtc, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.wbtc, arbitrumTokens.usdc, FeeAmount.LOW), - }, - { - pid: 47, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.arb, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.arb, arbitrumTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 46, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.arb, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.arb, arbitrumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 45, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.arb, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.arb, FeeAmount.LOWEST), - }, - { - pid: 44, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.wbtc, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.wbtc, arbitrumTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 41, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdv, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdv, arbitrumTokens.usdplus, FeeAmount.LOWEST), - }, - { - pid: 40, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdtplus, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.usdtplus, arbitrumTokens.usdplus, FeeAmount.LOW), - }, - { - pid: 39, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.usdplus, FeeAmount.LOW), - }, - { - pid: 38, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 37, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.ovn, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(arbitrumTokens.ovn, arbitrumTokens.usdplus, FeeAmount.HIGH), - }, - { - pid: 36, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.ethplus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.ethplus, FeeAmount.LOWEST), - }, - { - pid: 35, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdplus, - token1: arbitrumTokens.usdce, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdplus, arbitrumTokens.usdce, FeeAmount.LOWEST), - }, - { - pid: 34, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.ethplus, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.ethplus, arbitrumTokens.usdplus, FeeAmount.MEDIUM), - }, - { - pid: 33, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdtplus, - token1: arbitrumTokens.usdplus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdtplus, arbitrumTokens.usdplus, FeeAmount.LOWEST), - }, - { - pid: 32, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.xai, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.xai, arbitrumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 3, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.arb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.arb, FeeAmount.LOW), - }, - { - pid: 4, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 5, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.cake, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.cake, arbitrumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 6, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.lvl, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.lvl, FeeAmount.MEDIUM), - }, - { - pid: 7, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.mgp, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.mgp, FeeAmount.MEDIUM), - }, - { - pid: 8, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.arb, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.arb, arbitrumTokens.usdc, FeeAmount.LOW), - }, - { - pid: 9, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.arb, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.arb, arbitrumTokens.usdt, FeeAmount.LOW), - }, - { - pid: 10, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.pendle, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.pendle, arbitrumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 11, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.gmx, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.gmx, FeeAmount.MEDIUM), - }, - { - pid: 12, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.link, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.link, FeeAmount.MEDIUM), - }, - { - pid: 13, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.kuji, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.kuji, arbitrumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 14, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.link, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.link, FeeAmount.MEDIUM), - }, - { - pid: 15, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.eqb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.eqb, FeeAmount.MEDIUM), - }, - { - pid: 16, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.axlUSDC, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.axlUSDC, FeeAmount.LOWEST), - }, - { - pid: 17, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.wbtc, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.wbtc, arbitrumTokens.weth, FeeAmount.LOW), - }, - { - pid: 18, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.usdc, - token1: arbitrumTokens.dai, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.usdc, arbitrumTokens.dai, FeeAmount.LOWEST), - }, - { - pid: 19, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.axlUSDC, - token1: arbitrumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.axlUSDC, arbitrumTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 20, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.stg, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.stg, arbitrumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 21, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.stg, - token1: arbitrumTokens.arb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.stg, arbitrumTokens.arb, FeeAmount.MEDIUM), - }, - { - pid: 22, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.stg, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.stg, arbitrumTokens.usdc, FeeAmount.MEDIUM), - }, - { - pid: 23, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.rdnt, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.rdnt, arbitrumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 24, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.magic, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.magic, arbitrumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 25, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.wstETH, - token1: arbitrumTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.wstETH, arbitrumTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 26, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.rETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.rETH, FeeAmount.LOWEST), - }, - { - pid: 27, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.stEUR, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.stEUR, arbitrumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 28, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.kuji, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.kuji, arbitrumTokens.usdc, FeeAmount.MEDIUM), - }, - { - pid: 29, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.dmt, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(arbitrumTokens.dmt, arbitrumTokens.usdc, FeeAmount.MEDIUM), - }, - { - pid: 30, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.grai, - token1: arbitrumTokens.usdc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(arbitrumTokens.grai, arbitrumTokens.usdc, FeeAmount.LOW), - }, - { - pid: 31, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.V3, - token0: arbitrumTokens.weth, - token1: arbitrumTokens.swETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(arbitrumTokens.weth, arbitrumTokens.swETH, FeeAmount.LOWEST), - }, - { - pid: 2, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.STABLE, - token0: arbitrumTokens.dlp, - token1: arbitrumTokens.mdlp, - lpAddress: '0x0db5e247ab73FBaE16d9301f2977f974EC0AA336', - stableSwapAddress: '0xd0f0be815a76eFE677c92b07b39a5e972BAf22bD', - bCakeWrapperAddress: '0xC6B6926ef8B7218F054d64B52Ac455aEd22D690B', - }, - { - pid: 178, - chainId: ChainId.ARBITRUM_ONE, - protocol: Protocol.STABLE, - token0: arbitrumTokens.pendle, - token1: arbitrumTokens.mpendle, - lpAddress: '0x1A2329546f11e4fE55b853D98Bba2c4678E3105A', - stableSwapAddress: '0x73ed25e04Aa673ddf7411441098fC5ae19976CE0', - bCakeWrapperAddress: '0x7Fa4536b3E78643E027Dc34bB5A055517B4D9096', - }, -] - -export default arbFarmConfig - -/** @deprecated */ -export const legacyV3ArbFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - arbFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [] diff --git a/packages/farms/src/farms/base.ts b/packages/farms/src/farms/base.ts index dd0134c86a3d9..30fd3690422df 100644 --- a/packages/farms/src/farms/base.ts +++ b/packages/farms/src/farms/base.ts @@ -1,520 +1,4 @@ -import { ChainId } from '@pancakeswap/chains' -import { baseTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [ - { - pid: 10, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 9, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.usdbc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.usdbc, FeeAmount.LOWEST), - }, - { - pid: 5, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.usdc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.usdc, FeeAmount.LOW), - }, - { - pid: 1, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.usdbc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.usdbc, FeeAmount.LOW), - }, - { - pid: 6, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.usdc, - token1: baseTokens.usdbc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.usdc, baseTokens.usdbc, FeeAmount.LOWEST), - }, - { - pid: 12, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.cbETH, - token1: baseTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.cbETH, baseTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 2, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.cbETH, - token1: baseTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(baseTokens.cbETH, baseTokens.weth, FeeAmount.LOW), - }, -] - -export const baseFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 55, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0xEa34EA0D44b035ce1B7D87D47a77E3B251013b06', - token0: baseTokens.usdc, - token1: baseTokens.aero, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 54, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0xe80fd412AA92E0Ee8B86b419107616E05c00b77a', - token0: baseTokens.weth, - token1: baseTokens.degen, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 53, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0xa46179462f33b2c85134e5ec9Cac87073742560a', - token0: baseTokens.weth, - token1: baseTokens.brett, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 52, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0xb57BdfDb5FE848f999B45A868131a50b2EBE1755', - token0: baseTokens.weth, - token1: baseTokens.eurc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 51, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0x1Ca42C7219F0cB1B67927e26502320cB98F725bd', - token0: baseTokens.eurc, - token1: baseTokens.usdc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 50, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0xB593f062D5F235862643fF0DBAb743d7316B5b9F', - token0: baseTokens.lava, - token1: baseTokens.weth, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 49, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0x55B40f8911402568414ec6e7e0d2D87c3D19e65C', - token0: baseTokens.cbBTC, - token1: baseTokens.usdbc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 48, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0xb94b22332ABf5f89877A14Cc88f2aBC48c34B3Df', - token0: baseTokens.usdc, - token1: baseTokens.cbBTC, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 47, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: '0xC211e1f853A898Bd1302385CCdE55f33a8C4B3f3', - token0: baseTokens.weth, - token1: baseTokens.cbBTC, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 46, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.usdc, baseTokens.eUsd, FeeAmount.LOWEST), - token0: baseTokens.usdc, - token1: baseTokens.eUsd, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 45, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.mog, baseTokens.weth, FeeAmount.MEDIUM), - token0: baseTokens.mog, - token1: baseTokens.weth, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 44, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.ovn, baseTokens.usdPlus, FeeAmount.MEDIUM), - token0: baseTokens.ovn, - token1: baseTokens.usdPlus, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 43, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.ezEth, baseTokens.weth, FeeAmount.LOWEST), - token0: baseTokens.ezEth, - token1: baseTokens.weth, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 42, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.usdc, FeeAmount.MEDIUM), - token0: baseTokens.weth, - token1: baseTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 41, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.aero, FeeAmount.MEDIUM), - token0: baseTokens.weth, - token1: baseTokens.aero, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 40, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.usdc, baseTokens.aero, FeeAmount.MEDIUM), - token0: baseTokens.usdc, - token1: baseTokens.aero, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 39, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.dola, baseTokens.usdc, FeeAmount.MEDIUM), - token0: baseTokens.dola, - token1: baseTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 38, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.wif, baseTokens.weth, FeeAmount.MEDIUM), - token0: baseTokens.wif, - token1: baseTokens.weth, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 37, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.miggles, FeeAmount.MEDIUM), - token0: baseTokens.weth, - token1: baseTokens.miggles, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 36, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.degen, FeeAmount.MEDIUM), - token0: baseTokens.weth, - token1: baseTokens.degen, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 35, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.brett, FeeAmount.MEDIUM), - token0: baseTokens.weth, - token1: baseTokens.brett, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 34, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.usdz, baseTokens.weth, FeeAmount.LOWEST), - token0: baseTokens.usdz, - token1: baseTokens.weth, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 33, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.usdz, baseTokens.usdc, FeeAmount.LOWEST), - token0: baseTokens.usdz, - token1: baseTokens.usdc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 32, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.usdPlus, baseTokens.usdbc, FeeAmount.LOWEST), - token0: baseTokens.usdPlus, - token1: baseTokens.usdbc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 31, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.usdc, baseTokens.usdPlus, FeeAmount.LOWEST), - token0: baseTokens.usdc, - token1: baseTokens.usdPlus, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 30, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.usdc, baseTokens.aero, FeeAmount.LOW), - token0: baseTokens.usdc, - token1: baseTokens.aero, - feeAmount: FeeAmount.LOW, - }, - { - pid: 29, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.usdc, baseTokens.usdt, FeeAmount.LOWEST), - token0: baseTokens.usdc, - token1: baseTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 28, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.miggles, FeeAmount.LOW), - token0: baseTokens.weth, - token1: baseTokens.miggles, - feeAmount: FeeAmount.LOW, - }, - { - pid: 27, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weeth, baseTokens.weth, FeeAmount.LOWEST), - token0: baseTokens.weeth, - token1: baseTokens.weth, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 26, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.aero, FeeAmount.LOW), - token0: baseTokens.weth, - token1: baseTokens.aero, - feeAmount: FeeAmount.LOW, - }, - { - pid: 25, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.degen, FeeAmount.LOW), - token0: baseTokens.weth, - token1: baseTokens.degen, - feeAmount: FeeAmount.LOW, - }, - { - pid: 24, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.usdt, FeeAmount.LOWEST), - token0: baseTokens.weth, - token1: baseTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 23, - chainId: ChainId.BASE, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.brett, FeeAmount.LOW), - token0: baseTokens.weth, - token1: baseTokens.brett, - feeAmount: FeeAmount.LOW, - }, - { - pid: 22, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.zro, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.zro, FeeAmount.MEDIUM), - }, - { - pid: 15, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.usdPlus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.usdPlus, FeeAmount.LOWEST), - }, - { - pid: 16, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.usdPlus, - token1: baseTokens.wstETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.usdPlus, baseTokens.wstETH, FeeAmount.LOWEST), - }, - { - pid: 17, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.cbETH, - token1: baseTokens.usdPlus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.cbETH, baseTokens.usdPlus, FeeAmount.LOWEST), - }, - { - pid: 18, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.brett, - token1: baseTokens.usdPlus, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(baseTokens.brett, baseTokens.usdPlus, FeeAmount.LOW), - }, - { - pid: 19, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.degen, - token1: baseTokens.usdPlus, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(baseTokens.degen, baseTokens.usdPlus, FeeAmount.LOW), - }, - { - pid: 20, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.aero, - token1: baseTokens.usdPlus, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(baseTokens.aero, baseTokens.usdPlus, FeeAmount.LOW), - }, - { - pid: 21, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.ovn, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.ovn, FeeAmount.HIGH), - }, - { - pid: 14, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.wstETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.wstETH, FeeAmount.LOWEST), - }, - { - pid: 13, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.cake, - token1: baseTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(baseTokens.cake, baseTokens.weth, FeeAmount.HIGH), - }, - - { - pid: 11, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.usdbc, - token1: baseTokens.axlusdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.usdbc, baseTokens.axlusdc, FeeAmount.LOWEST), - }, - - { - pid: 8, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.tbtc, - token1: baseTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(baseTokens.tbtc, baseTokens.weth, FeeAmount.LOW), - }, - { - pid: 7, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.dai, - token1: baseTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.dai, baseTokens.usdc, FeeAmount.LOWEST), - }, - - { - pid: 4, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.weth, - token1: baseTokens.dai, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(baseTokens.weth, baseTokens.dai, FeeAmount.LOW), - }, - { - pid: 3, - chainId: ChainId.BASE, - protocol: Protocol.V3, - token0: baseTokens.dai, - token1: baseTokens.usdbc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(baseTokens.dai, baseTokens.usdbc, FeeAmount.LOWEST), - }, -] - -export default baseFarmConfig - -/** @deprecated */ -export const legacyV3BaseFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - baseFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [] diff --git a/packages/farms/src/farms/bsc.ts b/packages/farms/src/farms/bsc.ts index 057a5236a55ce..51dd7bab01f14 100644 --- a/packages/farms/src/farms/bsc.ts +++ b/packages/farms/src/farms/bsc.ts @@ -1,1867 +1,7 @@ -import { ChainId } from '@pancakeswap/chains' -import { Pair } from '@pancakeswap/sdk' import { bscTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' import { getAddress } from 'viem' import { CAKE_BNB_LP_MAINNET } from '../../constants/common' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [ - { - pid: 137, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.usdt, FeeAmount.LOWEST), - token0: bscTokens.usdt, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 5, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.wbnb, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.wbnb, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, - { - pid: 149, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.usdc, bscTokens.wbnb, FeeAmount.LOWEST), - token0: bscTokens.usdc, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 148, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.usdc, bscTokens.wbnb, FeeAmount.LOW), - token0: bscTokens.usdc, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.LOW, - }, - { - pid: 7, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.btcb, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.btcb, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, - { - pid: 54, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.wbnb, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.wbnb, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, - { - pid: 97, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.usdt, FeeAmount.LOW), - token0: bscTokens.eth, - token1: bscTokens.usdt, - feeAmount: FeeAmount.LOW, - }, - { - pid: 1, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cake, - token1: bscTokens.wbnb, - lpAddress: Pool.getAddress(bscTokens.cake, bscTokens.wbnb, FeeAmount.MEDIUM), - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 4, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.busd, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.busd, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, -] - -export const bscFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 190, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.ynbnb, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.ynbnb, bscTokens.wbnb, FeeAmount.LOW), - }, - { - pid: 187, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.btcb, - token1: bscTokens.mBtc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.btcb, bscTokens.mBtc, FeeAmount.LOWEST), - }, - { - pid: 186, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.pufETH, FeeAmount.LOW), - token0: bscTokens.eth, - token1: bscTokens.pufETH, - feeAmount: FeeAmount.LOW, - }, - { - pid: 185, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.wBTC, bscTokens.usdt, FeeAmount.MEDIUM), - token0: bscTokens.wBTC, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 184, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.uniBtc, bscTokens.btcb, FeeAmount.LOW), - token0: bscTokens.uniBtc, - token1: bscTokens.btcb, - feeAmount: FeeAmount.LOW, - }, - { - pid: 183, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.btcb, FeeAmount.LOWEST), - token0: bscTokens.usdt, - token1: bscTokens.btcb, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 182, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.usdt, FeeAmount.LOWEST), - token0: bscTokens.eth, - token1: bscTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 181, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.wbnb, FeeAmount.LOWEST), - token0: bscTokens.eth, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 180, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.btcb, bscTokens.kbtc, FeeAmount.LOW), - token0: bscTokens.btcb, - token1: bscTokens.kbtc, - feeAmount: FeeAmount.LOW, - }, - { - pid: 179, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.wstETH, bscTokens.wbnb, FeeAmount.LOW), - token0: bscTokens.wstETH, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.LOW, - }, - { - pid: 178, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.wstETH, bscTokens.btcb, FeeAmount.LOW), - token0: bscTokens.wstETH, - token1: bscTokens.btcb, - feeAmount: FeeAmount.LOW, - }, - { - pid: 177, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.wstETH, FeeAmount.LOWEST), - token0: bscTokens.eth, - token1: bscTokens.wstETH, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 176, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.btcb, bscTokens.stbtc, FeeAmount.LOWEST), - token0: bscTokens.btcb, - token1: bscTokens.stbtc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 175, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.solvbtcbbn, bscTokens.solvbtc, FeeAmount.LOW), - token0: bscTokens.solvbtcbbn, - token1: bscTokens.solvbtc, - feeAmount: FeeAmount.LOW, - }, - { - pid: 174, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.wsi, FeeAmount.MEDIUM), - token0: bscTokens.usdt, - token1: bscTokens.wsi, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 173, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.dexeTkn, bscTokens.boxy, FeeAmount.LOWEST), - token0: bscTokens.dexeTkn, - token1: bscTokens.boxy, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 172, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.solvbtc, bscTokens.solvBTCena, FeeAmount.LOW), - token0: bscTokens.solvbtc, - token1: bscTokens.solvBTCena, - feeAmount: FeeAmount.LOW, - }, - { - pid: 171, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.lista, FeeAmount.MEDIUM), - token0: bscTokens.usdt, - token1: bscTokens.lista, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 170, - chainId: ChainId.BSC, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(bscTokens.zro, bscTokens.wbnb, FeeAmount.HIGH), - token0: bscTokens.zro, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - }, - { - pid: 169, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.lista, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.lista, FeeAmount.HIGH), - }, - { - pid: 168, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.axlSTARS, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.axlSTARS, FeeAmount.HIGH), - }, - { - pid: 167, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.fury, - token1: bscTokens.usdt, - lpAddress: Pool.getAddress(bscTokens.fury, bscTokens.usdt, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, - { - pid: 166, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.bnb, - token1: bscTokens.busd, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.bnb, bscTokens.busd, FeeAmount.LOWEST), - }, - { - pid: 165, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.stone, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.stone, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, - { - pid: 164, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.solvbtc, - token1: bscTokens.btcb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.solvbtc, bscTokens.btcb, FeeAmount.LOW), - }, - { - pid: 163, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.weEth, - token1: bscTokens.eth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.weEth, bscTokens.eth, FeeAmount.LOWEST), - }, - { - pid: 162, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.masa, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.masa, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 161, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.sdt, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.sdt, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 160, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.nmt, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.nmt, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 2, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cake, - token1: bscTokens.busd, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.cake, bscTokens.busd, FeeAmount.MEDIUM), - }, - { - pid: 3, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cake, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.cake, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 159, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.ego, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.ego, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 158, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.mc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.mc, FeeAmount.MEDIUM), - }, - { - pid: 157, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.mb4, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.mb4, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 156, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.chat, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.chat, FeeAmount.HIGH), - }, - { - pid: 155, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.pepe, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.pepe, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 154, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.octavia, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.octavia, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 153, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.pxETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.pxETH, FeeAmount.LOW), - }, - { - pid: 152, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.ezETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.ezETH, FeeAmount.LOW), - }, - { - pid: 151, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.fil, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.fil, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 150, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.trump, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.trump, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 147, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.fet, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.fet, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 146, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.pxETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.pxETH, FeeAmount.LOWEST), - }, - { - pid: 145, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.bnx, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.bnx, FeeAmount.LOW), - }, - { - pid: 144, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.osak, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.osak, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 143, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.xrgb, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.xrgb, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 142, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.dmail, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.dmail, FeeAmount.HIGH), - }, - { - pid: 141, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.sol, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.sol, FeeAmount.MEDIUM), - }, - { - pid: 140, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.sol, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.sol, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 139, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.gtai, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.gtai, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 138, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.aitech, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.aitech, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 136, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.rbnb, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.rbnb, FeeAmount.LOWEST), - }, - { - pid: 135, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.manta, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.manta, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 134, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.ovn, - token1: bscTokens.usdt, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.ovn, bscTokens.usdt, FeeAmount.HIGH), - }, - { - pid: 133, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.wrose, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.wrose, FeeAmount.LOW), - }, - { - pid: 132, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.anyInu, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.anyInu, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 131, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.huahua, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.huahua, FeeAmount.HIGH), - }, - { - pid: 130, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.irl, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.irl, FeeAmount.HIGH), - }, - { - pid: 129, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdc, - token1: bscTokens.fdusd, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.usdc, bscTokens.fdusd, FeeAmount.LOWEST), - }, - { - pid: 128, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.bnb, - token1: bscTokens.fdusd, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.bnb, bscTokens.fdusd, FeeAmount.LOW), - }, - { - pid: 127, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cake, - token1: bscTokens.fdusd, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.cake, bscTokens.fdusd, FeeAmount.MEDIUM), - }, - { - pid: 126, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.fdusd, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.fdusd, FeeAmount.LOW), - }, - { - pid: 125, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.btcb, - token1: bscTokens.fdusd, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.btcb, bscTokens.fdusd, FeeAmount.LOW), - }, - { - pid: 124, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.insp, - token1: bscTokens.bnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.insp, bscTokens.bnb, FeeAmount.HIGH), - }, - { - pid: 123, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.wrose, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.wrose, FeeAmount.MEDIUM), - }, - { - pid: 122, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.cgpt, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.cgpt, FeeAmount.LOW), - }, - { - pid: 121, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.ckp, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.ckp, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 120, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.pnp, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.pnp, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 119, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cake, - token1: bscTokens.sdcake, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.cake, bscTokens.sdcake, FeeAmount.MEDIUM), - }, - { - pid: 118, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.mubi, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.mubi, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 117, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.ordi, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.ordi, FeeAmount.MEDIUM), - }, - { - pid: 116, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.nfp, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.nfp, FeeAmount.MEDIUM), - }, - { - pid: 115, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.mubi, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.mubi, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 114, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.ordi, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.ordi, FeeAmount.HIGH), - }, - { - pid: 113, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.sats, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.sats, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 112, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.rdp, - token1: bscTokens.bnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.rdp, bscTokens.bnb, FeeAmount.MEDIUM), - }, - { - pid: 111, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.vai, - token1: bscTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.vai, bscTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 110, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.vai, - token1: bscTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.vai, bscTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 109, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.stg, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.stg, FeeAmount.MEDIUM), - }, - { - pid: 108, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.stg, - token1: bscTokens.busd, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.stg, bscTokens.busd, FeeAmount.MEDIUM), - }, - { - pid: 107, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdv, - token1: bscTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.usdv, bscTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 106, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdv, - token1: bscTokens.bnb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.usdv, bscTokens.bnb, FeeAmount.LOW), - }, - { - pid: 105, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.esRDNT, - token1: bscTokens.rdnt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.esRDNT, bscTokens.rdnt, FeeAmount.MEDIUM), - }, - { - pid: 104, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.ace, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.ace, FeeAmount.MEDIUM), - }, - { - pid: 103, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.aioz, - token1: bscTokens.bnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.aioz, bscTokens.bnb, FeeAmount.MEDIUM), - }, - { - pid: 102, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.bonk, - token1: bscTokens.bnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.bonk, bscTokens.bnb, FeeAmount.HIGH), - }, - { - pid: 101, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.bonk, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.bonk, FeeAmount.HIGH), - }, - { - pid: 100, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.kuji, - token1: bscTokens.bnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.kuji, bscTokens.bnb, FeeAmount.HIGH), - }, - { - pid: 99, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.btcb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.btcb, FeeAmount.LOW), - }, - { - pid: 98, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.fdusd, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.fdusd, FeeAmount.LOWEST), - }, - { - pid: 96, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.twt, - token1: bscTokens.bnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.twt, bscTokens.bnb, FeeAmount.MEDIUM), - }, - { - pid: 95, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.chess, - token1: bscTokens.usdt, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.chess, bscTokens.usdt, FeeAmount.HIGH), - }, - { - pid: 94, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.alpaca, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.alpaca, FeeAmount.HIGH), - }, - { - pid: 93, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.btt, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.btt, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 92, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.bnb, - token1: bscTokens.xvs, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.bnb, bscTokens.xvs, FeeAmount.MEDIUM), - }, - { - pid: 91, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.trxv2, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.trxv2, FeeAmount.MEDIUM), - }, - { - pid: 90, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.axs, - token1: bscTokens.bnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.axs, bscTokens.bnb, FeeAmount.MEDIUM), - }, - { - pid: 89, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.wom, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.wom, FeeAmount.HIGH), - }, - { - pid: 87, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.rdnt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.rdnt, FeeAmount.MEDIUM), - }, - { - pid: 88, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.mbox, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.mbox, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 86, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.ltc, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.ltc, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 85, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.sfp, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.sfp, FeeAmount.MEDIUM), - }, - { - pid: 45, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.play, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.play, FeeAmount.HIGH), - }, - { - pid: 84, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.xcad, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.xcad, FeeAmount.MEDIUM), - }, - { - pid: 83, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.mbx, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.mbx, FeeAmount.HIGH), - }, - { - pid: 82, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.mbx, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.mbx, FeeAmount.HIGH), - }, - { - pid: 81, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wncg, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.wncg, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 80, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.hay, - token1: bscTokens.usdt, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.hay, bscTokens.usdt, FeeAmount.LOW), - }, - { - pid: 79, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.chr, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.chr, FeeAmount.HIGH), - }, - { - pid: 78, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.hft, - token1: bscTokens.usdt, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.hft, bscTokens.usdt, FeeAmount.HIGH), - }, - { - pid: 77, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.arv, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.arv, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 76, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.high, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.high, FeeAmount.HIGH), - }, - { - pid: 75, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.raca, - token1: bscTokens.usdt, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.raca, bscTokens.usdt, FeeAmount.HIGH), - }, - { - pid: 74, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.sfund, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.sfund, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 73, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.lvl, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.lvl, FeeAmount.HIGH), - }, - { - pid: 72, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.gmt, - token1: bscTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.gmt, bscTokens.usdc, FeeAmount.MEDIUM), - }, - { - pid: 71, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cyber, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.cyber, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 70, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.unshETH, - token1: bscTokens.eth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.unshETH, bscTokens.eth, FeeAmount.LOW), - }, - { - pid: 69, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.dar, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.dar, bscTokens.wbnb, FeeAmount.HIGH), - }, - { - pid: 68, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.wmx, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.wmx, FeeAmount.HIGH), - }, - { - pid: 67, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.ole, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.ole, FeeAmount.HIGH), - }, - { - pid: 66, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.doge, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.doge, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 65, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.dck, - token1: bscTokens.busd, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.dck, bscTokens.busd, FeeAmount.MEDIUM), - }, - { - pid: 64, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.planet, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.planet, FeeAmount.HIGH), - }, - { - pid: 63, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.snbnb, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.snbnb, bscTokens.wbnb, FeeAmount.LOW), - }, - { - pid: 62, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.hay, - token1: bscTokens.eth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.hay, bscTokens.eth, FeeAmount.MEDIUM), - }, - { - pid: 61, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.hay, - token1: bscTokens.btcb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.hay, bscTokens.btcb, FeeAmount.MEDIUM), - }, - { - pid: 60, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.hay, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.hay, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 59, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.tusd, - token1: bscTokens.busd, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.tusd, bscTokens.busd, FeeAmount.LOWEST), - }, - { - pid: 58, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.uni, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.uni, FeeAmount.MEDIUM), - }, - { - pid: 57, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 56, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.btcb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.btcb, FeeAmount.MEDIUM), - }, - { - pid: 55, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.btcb, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.btcb, bscTokens.wbnb, FeeAmount.LOW), - }, - { - pid: 53, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eqb, - token1: bscTokens.bnb, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.eqb, bscTokens.bnb, FeeAmount.HIGH), - }, - { - pid: 52, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.axlusdc, - token1: bscTokens.usdt, - lpAddress: Pool.getAddress(bscTokens.axlusdc, bscTokens.usdt, FeeAmount.LOWEST), - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 51, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.pendle, - token1: bscTokens.wbnb, - lpAddress: Pool.getAddress(bscTokens.pendle, bscTokens.wbnb, FeeAmount.HIGH), - feeAmount: FeeAmount.HIGH, - }, - { - pid: 50, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.xalgo, - token1: bscTokens.wbnb, - lpAddress: Pool.getAddress(bscTokens.xalgo, bscTokens.wbnb, FeeAmount.MEDIUM), - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 49, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cgpt, - token1: bscTokens.busd, - lpAddress: Pool.getAddress(bscTokens.cgpt, bscTokens.busd, FeeAmount.MEDIUM), - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 48, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.tusd, - token1: bscTokens.usdt, - lpAddress: Pool.getAddress(bscTokens.tusd, bscTokens.usdt, FeeAmount.LOWEST), - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 43, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.csix, - token1: bscTokens.cake, - lpAddress: Pool.getAddress(bscTokens.csix, bscTokens.cake, FeeAmount.MEDIUM), - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 23, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.axl, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.axl, FeeAmount.MEDIUM), - }, - { - pid: 46, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.aog, - token1: bscTokens.busd, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.aog, bscTokens.busd, FeeAmount.HIGH), - }, - { - pid: 47, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cgpt, - token1: bscTokens.busd, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.cgpt, bscTokens.busd, FeeAmount.HIGH), - }, - { - pid: 44, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eura, - token1: bscTokens.usdt, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.eura, bscTokens.usdt, FeeAmount.LOW), - }, - { - pid: 42, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.pepe, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.pepe, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 41, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.c98, - token1: bscTokens.bnb, - lpAddress: Pool.getAddress(bscTokens.c98, bscTokens.bnb, FeeAmount.MEDIUM), - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 40, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.ush, - token1: bscTokens.bnb, - lpAddress: Pool.getAddress(bscTokens.ush, bscTokens.bnb, FeeAmount.HIGH), - feeAmount: FeeAmount.HIGH, - }, - { - pid: 39, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.id, - token1: bscTokens.usdt, - lpAddress: Pool.getAddress(bscTokens.id, bscTokens.usdt, FeeAmount.MEDIUM), - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 38, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.bnb, - token1: bscTokens.gal, - lpAddress: Pool.getAddress(bscTokens.gal, bscTokens.bnb, FeeAmount.MEDIUM), - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 37, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.bnbx, - token1: bscTokens.bnb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.bnbx, bscTokens.bnb, FeeAmount.LOW), - }, - { - pid: 36, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.peel, - token1: bscTokens.busd, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.peel, bscTokens.busd, FeeAmount.MEDIUM), - }, - { - pid: 35, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.revv, - token1: bscTokens.edu, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.revv, bscTokens.edu, FeeAmount.MEDIUM), - }, - { - pid: 34, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.edu, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.edu, FeeAmount.MEDIUM), - }, - { - pid: 33, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.edu, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.edu, FeeAmount.MEDIUM), - }, - { - pid: 32, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.wbeth, - lpAddress: Pool.getAddress(bscTokens.wbeth, bscTokens.eth, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, - { - pid: 31, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cake, - token1: bscTokens.zbc, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.cake, bscTokens.zbc, FeeAmount.HIGH), - }, - { - pid: 30, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.champ, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.champ, FeeAmount.HIGH), - }, - { - pid: 29, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.unshETH, - token1: bscTokens.ush, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.unshETH, bscTokens.ush, FeeAmount.MEDIUM), - }, - { - pid: 28, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.unshETH, - token1: bscTokens.usdt, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.unshETH, bscTokens.usdt, FeeAmount.MEDIUM), - }, - { - pid: 27, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.cake, - token1: bscTokens.pstake, - lpAddress: Pool.getAddress(bscTokens.pstake, bscTokens.cake, FeeAmount.MEDIUM), - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 26, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.stkbnb, - lpAddress: Pool.getAddress(bscTokens.stkbnb, bscTokens.wbnb, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, - { - pid: 25, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.unw, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.unw, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 24, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.mgp, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.mgp, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 22, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.gq, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.gq, FeeAmount.MEDIUM), - }, - { - pid: 20, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.ankrETH, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.ankrETH, FeeAmount.LOW), - feeAmount: FeeAmount.LOW, - }, - { - pid: 21, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.ankrbnb, - token1: bscTokens.bnb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.ankrbnb, bscTokens.bnb, FeeAmount.LOW), - }, - { - pid: 6, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.btcb, - token1: bscTokens.busd, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.btcb, bscTokens.busd, FeeAmount.LOW), - }, - { - pid: 8, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.btcb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.btcb, FeeAmount.MEDIUM), - }, - { - pid: 9, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.btcb, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.btcb, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 10, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 11, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.eth, - token1: bscTokens.usdc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(bscTokens.eth, bscTokens.usdc, FeeAmount.LOW), - }, - { - pid: 12, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 13, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdc, - token1: bscTokens.busd, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.usdc, bscTokens.busd, FeeAmount.LOWEST), - }, - { - pid: 14, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.usdt, - token1: bscTokens.busd, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(bscTokens.usdt, bscTokens.busd, FeeAmount.LOWEST), - }, - { - pid: 15, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.wbnb, - token1: bscTokens.link, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.wbnb, bscTokens.link, FeeAmount.MEDIUM), - }, - { - pid: 16, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.xrp, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.xrp, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 17, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.trx, - token1: bscTokens.busd, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.trx, bscTokens.busd, FeeAmount.MEDIUM), - }, - { - pid: 18, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.ada, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.ada, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 19, - chainId: ChainId.BSC, - protocol: Protocol.V3, - token0: bscTokens.dot, - token1: bscTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(bscTokens.dot, bscTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 2, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.cake, - token1: bscTokens.wbnb, - lpAddress: Pair.getAddress(bscTokens.cake, bscTokens.wbnb), - bCakeWrapperAddress: '0x9669218e7ffACE40D78FF09C78aEA5F4DEb9aD4D', - }, - { - pid: 47, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.cake, - token1: bscTokens.usdt, - lpAddress: Pair.getAddress(bscTokens.cake, bscTokens.usdt), - bCakeWrapperAddress: '0xf320e4E90D3914EE224777dE842f4995467CBeF6', - }, - { - pid: 9, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.wbnb, - token1: bscTokens.xvs, - lpAddress: Pair.getAddress(bscTokens.wbnb, bscTokens.xvs), - bCakeWrapperAddress: '0xF919F052E4608D239E49E57957022FdcAaeeeB49', - }, - { - pid: 182, - chainId: ChainId.BSC, - protocol: Protocol.STABLE, - lpAddress: '0x4cBEa76B4A1c42C356B4c52B0314A98313fFE9df', - stableSwapAddress: '0xfF5Ce4846A3708EA9befa6c3Ab145e63f65DC045', - bCakeWrapperAddress: '0x2F3caA7637D5E7270091156D399cD06a8633d1dd', - token0: bscTokens.mwbeth, - token1: bscTokens.wbeth, - }, - { - pid: 180, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.wbnb, - token1: bscTokens.mgp, - lpAddress: Pair.getAddress(bscTokens.wbnb, bscTokens.mgp), - bCakeWrapperAddress: '0x8F30711e577d8870B390B383a6d4B1c28D6DEdF8', - }, - { - pid: 181, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.pnp, - token1: bscTokens.wbnb, - lpAddress: Pair.getAddress(bscTokens.pnp, bscTokens.wbnb), - bCakeWrapperAddress: '0x6F2ecB6929326Fd30406dDA3E643413f2736a3f7', - }, - { - pid: 179, - chainId: ChainId.BSC, - protocol: Protocol.STABLE, - token0: bscTokens.mdlp, - token1: bscTokens.dlp, - lpAddress: '0xA2915ae3bc8C6C03f59496B6Dd26aa6a4335b788', - stableSwapAddress: '0x25d0eD3b1cE5aF0F3Ac7da4b39B46FC409bF67e2', - bCakeWrapperAddress: '0x3c5cdb87Ab4B05C6A6826A2dc69965B5d25A7419', - }, - { - pid: 178, - chainId: ChainId.BSC, - protocol: Protocol.STABLE, - token0: bscTokens.mpendle, - token1: bscTokens.pendle, - lpAddress: '0x183F325b33d190597D80d1B46D865d0250fD9BF2', - stableSwapAddress: '0xD8CB82059da7215b1a9604E845d49D3e78d0f95A', - bCakeWrapperAddress: '0xdB52402F58D15974027911D8E5C958737949DBaA', - }, - { - pid: 177, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.ckp, - token1: bscTokens.mcake, - lpAddress: Pair.getAddress(bscTokens.ckp, bscTokens.mcake), - bCakeWrapperAddress: '0xd4cE5488aEDfb0F26A2bcFa068fB57bDDEBE09Fd', - }, - { - pid: 176, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.rdp, - token1: bscTokens.wbnb, - lpAddress: Pair.getAddress(bscTokens.rdp, bscTokens.wbnb), - bCakeWrapperAddress: '0x66e49e2b4c5c16EbE95E1af7902DAB1211b80E07', - }, - { - pid: 175, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.wbnb, - token1: bscTokens.hzn, - lpAddress: Pair.getAddress(bscTokens.wbnb, bscTokens.hzn), - bCakeWrapperAddress: '0x33770fBC3952d5C85eEDF780Ca63E15C009DefaA', - }, - { - pid: 173, - chainId: ChainId.BSC, - protocol: Protocol.STABLE, - token0: bscTokens.cake, - token1: bscTokens.sdcake, - lpAddress: '0xB1D54d76E2cB9425Ec9c018538cc531440b55dbB', - stableSwapAddress: '0xb8204D31379A9B317CD61C833406C972F58ecCbC', - bCakeWrapperAddress: '0x823AE568DD020894261FD587248304952b5931F1', - }, - { - pid: 174, - chainId: ChainId.BSC, - protocol: Protocol.STABLE, - token0: bscTokens.cake, - token1: bscTokens.mcake, - lpAddress: '0xb9dC6396AcFFD24E0f69Dfd3231fDaeB31514D02', - stableSwapAddress: '0xc54d35a8Cfd9f6dAe50945Df27A91C9911A03ab1', - bCakeWrapperAddress: '0x10Cfcd2b3e8c35B3bd36dFDBd0063829eA244e84', - }, - { - pid: 163, - chainId: ChainId.BSC, - protocol: Protocol.STABLE, - token0: bscTokens.hay, - token1: bscTokens.usdt, - lpAddress: '0xB2Aa63f363196caba3154D4187949283F085a488', - stableSwapAddress: '0xb1Da7D2C257c5700612BdE35C8d7187dc80d79f1', - bCakeWrapperAddress: '0xd069a9E50E4ad04592cb00826d312D9f879eBb02', - }, - { - pid: 42, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.mbox, - token1: bscTokens.wbnb, - lpAddress: Pair.getAddress(bscTokens.mbox, bscTokens.wbnb), - bCakeWrapperAddress: '0xD4e726fEE72BE7Db298034a46430935d735aD5A8', - }, - { - pid: 8, - chainId: ChainId.BSC, - protocol: Protocol.V2, - token0: bscTokens.twt, - token1: bscTokens.wbnb, - lpAddress: Pair.getAddress(bscTokens.twt, bscTokens.wbnb), - bCakeWrapperAddress: '0xF94cE20b9bd3a7E64A64E39DF5c7d7BDb915499f', - }, -] - -export default bscFarmConfig - -/** @deprecated */ -export const legacyV3BscFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - bscFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [ diff --git a/packages/farms/src/farms/eth.ts b/packages/farms/src/farms/eth.ts index f4d1e0703c705..9d0298ad5a44b 100644 --- a/packages/farms/src/farms/eth.ts +++ b/packages/farms/src/farms/eth.ts @@ -1,770 +1,6 @@ -import { ChainId } from '@pancakeswap/chains' import { ethereumTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' import { getAddress } from 'viem' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [ - { - pid: 1, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.usdc, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(ethereumTokens.usdc, ethereumTokens.weth, FeeAmount.LOW), - }, - { - pid: 62, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.usdc, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.usdc, ethereumTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 63, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 2, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.usdt, FeeAmount.LOW), - }, - { - pid: 3, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.usdc, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.usdc, ethereumTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 4, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.wbtc, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.wbtc, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 5, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.cake, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.cake, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 6, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.cake, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.cake, ethereumTokens.usdc, FeeAmount.MEDIUM), - }, -] - -export const ethereumFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 83, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0x0eEEE1eBa23fe157dBbD17ae2A1Bf9cd53EF7bDd', - token0: ethereumTokens.wbtc, - token1: ethereumTokens.mBtc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 82, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0x64c78D2C2cCf8BC44a5A2DcDd980735b28e9B406', - token0: ethereumTokens.weth, - token1: ethereumTokens.eigen, - feeAmount: FeeAmount.LOW, - }, - { - pid: 81, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0x5fbbC3380DD9f7253Aa10838DD641dAc8242F817', - token0: ethereumTokens.usdc, - token1: ethereumTokens.cbBTC, - feeAmount: FeeAmount.LOW, - }, - { - pid: 80, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0xF84AAd7ab687b1BB1FBB190344240b60B39e5b79', - token0: ethereumTokens.weth, - token1: ethereumTokens.cbBTC, - feeAmount: FeeAmount.LOW, - }, - { - pid: 79, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0x3E253Ae716eBf5047d6deeE8f2607121ceA08482', - token0: ethereumTokens.wbtc, - token1: ethereumTokens.cbBTC, - feeAmount: FeeAmount.LOWEST, - }, - { - chainId: ChainId.ETHEREUM, - protocol: Protocol.STABLE, - lpAddress: '0xaB9dEBAED21270832cCdf54a7461A8E4B133B57A', - stableSwapAddress: '0x95A3832889B2c3455077991b834efA2d4fA3A945', - bCakeWrapperAddress: '0xfF0A279B156C82013F15CE12B8dB7de07115B745', - token0: ethereumTokens.wbtc, - token1: ethereumTokens.mBtc, - }, - { - pid: 78, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0xB2DC4d7627501338B578985c214208eb32283086', - token0: ethereumTokens.order, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 77, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0x365EA9E5Cec960390f35b6509548e84073168A8B', - token0: ethereumTokens.wbtc, - token1: ethereumTokens.swBTC, - feeAmount: FeeAmount.LOW, - }, - { - pid: 76, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0xBfab494D6311432Ed86Ee88779aCD7B4838920B7', - token0: ethereumTokens.usd0, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.LOW, - }, - { - pid: 75, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0x027039bd4eA6Ac7f80fEf4be2d0C6B74bfA932F9', - token0: ethereumTokens.usde, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 74, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0x856B93E22127E6B76B79573bf95a93b4c88cb745', - token0: ethereumTokens.deusd, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 73, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: '0x689D028f13033d2E2A7c87806bEe05F45d859B52', - token0: ethereumTokens.deusd, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 72, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.zro, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.zro, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 71, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.taiko, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.taiko, ethereumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 70, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.blb, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.blb, ethereumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 69, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.mETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.mETH, FeeAmount.LOWEST), - }, - { - pid: 68, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.mETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.mETH, FeeAmount.LOW), - }, - { - pid: 67, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.mnt, - token1: ethereumTokens.mETH, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.mnt, ethereumTokens.mETH, FeeAmount.MEDIUM), - }, - { - pid: 66, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.masa, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.masa, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 65, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.rswETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.rswETH, FeeAmount.LOW), - }, - { - pid: 64, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.nmt, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.nmt, ethereumTokens.usdc, FeeAmount.MEDIUM), - }, - { - pid: 61, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.mstETH, - token1: ethereumTokens.wstETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.mstETH, ethereumTokens.wstETH, FeeAmount.LOWEST), - }, - { - pid: 60, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.mswETH, - token1: ethereumTokens.swETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.mswETH, ethereumTokens.swETH, FeeAmount.LOWEST), - }, - { - pid: 59, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.xrgb, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.xrgb, ethereumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 58, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.pixel, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.pixel, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 57, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.pandora, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.pandora, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 56, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.weETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.weETH, FeeAmount.LOWEST), - }, - { - pid: 55, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.pxETH, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.pxETH, ethereumTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 54, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.osak, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.osak, ethereumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 53, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.ords, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.ords, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 52, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.swETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.swETH, FeeAmount.LOW), - }, - { - pid: 51, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.eura, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(ethereumTokens.eura, ethereumTokens.usdc, FeeAmount.LOW), - }, - { - pid: 50, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.sdt, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.sdt, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 49, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.btrfly, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.btrfly, FeeAmount.MEDIUM), - }, - { - pid: 48, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.insp, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.insp, ethereumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 47, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.aioz, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.aioz, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 46, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.id, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.id, ethereumTokens.usdc, FeeAmount.MEDIUM), - }, - { - pid: 45, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.bonk, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.bonk, ethereumTokens.usdt, FeeAmount.HIGH), - }, - { - pid: 44, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.insp, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.insp, ethereumTokens.usdt, FeeAmount.HIGH), - }, - { - pid: 43, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.wstETH, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.wstETH, ethereumTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 42, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.meme, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.meme, ethereumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 41, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.ethx, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(ethereumTokens.ethx, ethereumTokens.weth, FeeAmount.LOW), - }, - { - pid: 40, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.pyusd, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.pyusd, ethereumTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 39, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.pyusd, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.pyusd, ethereumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 38, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.woo, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.woo, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 12, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.wstETH, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(ethereumTokens.wstETH, ethereumTokens.weth, FeeAmount.LOW), - }, - { - pid: 37, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.cyber, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.cyber, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 36, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.wom, ethereumTokens.usdt, FeeAmount.HIGH), - token0: ethereumTokens.wom, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.HIGH, - }, - { - pid: 35, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.wld, ethereumTokens.weth, FeeAmount.HIGH), - token0: ethereumTokens.wld, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - }, - { - pid: 34, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.pendle, ethereumTokens.weth, FeeAmount.HIGH), - token0: ethereumTokens.pendle, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - }, - { - pid: 33, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.canto, ethereumTokens.weth, FeeAmount.HIGH), - token0: ethereumTokens.canto, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - }, - { - pid: 32, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.tusd, ethereumTokens.usdt, FeeAmount.LOWEST), - token0: ethereumTokens.tusd, - token1: ethereumTokens.usdt, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 22, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.axl, ethereumTokens.usdc, FeeAmount.MEDIUM), - token0: ethereumTokens.axl, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 19, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.rETH, ethereumTokens.weth, FeeAmount.LOW), - token0: ethereumTokens.rETH, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOW, - }, - { - pid: 31, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.wbtc, ethereumTokens.rETH, FeeAmount.MEDIUM), - token0: ethereumTokens.wbtc, - token1: ethereumTokens.rETH, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 30, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.fuse, ethereumTokens.weth, FeeAmount.MEDIUM), - token0: ethereumTokens.fuse, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 29, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.ens, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.ens, FeeAmount.MEDIUM), - }, - { - pid: 28, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.blur, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.blur, ethereumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 27, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.pepe, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(ethereumTokens.pepe, ethereumTokens.weth, FeeAmount.HIGH), - }, - { - pid: 26, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.wbeth, ethereumTokens.weth, FeeAmount.LOW), - token0: ethereumTokens.wbeth, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOW, - }, - { - pid: 25, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.unshETH, ethereumTokens.usdc, FeeAmount.MEDIUM), - token0: ethereumTokens.unshETH, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 24, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.weth, - token1: ethereumTokens.wncg, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.wncg, FeeAmount.MEDIUM), - }, - { - pid: 23, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.mask, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.mask, ethereumTokens.usdc, FeeAmount.MEDIUM), - }, - { - pid: 14, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.alETH, ethereumTokens.alcx, FeeAmount.MEDIUM), - token0: ethereumTokens.alETH, - token1: ethereumTokens.alcx, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 15, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.alETH, ethereumTokens.weth, FeeAmount.LOW), - token0: ethereumTokens.alETH, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOW, - }, - { - pid: 16, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.fxs, ethereumTokens.weth, FeeAmount.MEDIUM), - token0: ethereumTokens.fxs, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 17, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.frxETH, ethereumTokens.weth, FeeAmount.LOW), - token0: ethereumTokens.frxETH, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOW, - }, - { - pid: 18, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.rpl, FeeAmount.MEDIUM), - token0: ethereumTokens.weth, - token1: ethereumTokens.rpl, - feeAmount: FeeAmount.MEDIUM, - }, - { - pid: 20, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.weth, ethereumTokens.ankrETH, FeeAmount.LOW), - token0: ethereumTokens.weth, - token1: ethereumTokens.ankrETH, - feeAmount: FeeAmount.LOW, - }, - { - pid: 21, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(ethereumTokens.cbEth, ethereumTokens.weth, FeeAmount.LOW), - token0: ethereumTokens.cbEth, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.LOW, - }, - { - pid: 7, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.dai, - token1: ethereumTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(ethereumTokens.dai, ethereumTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 8, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.ldo, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.ldo, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 9, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.link, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.link, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 10, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.matic, - token1: ethereumTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.matic, ethereumTokens.weth, FeeAmount.MEDIUM), - }, - { - pid: 13, - chainId: ChainId.ETHEREUM, - protocol: Protocol.V3, - token0: ethereumTokens.usdc, - token1: ethereumTokens.stg, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(ethereumTokens.usdc, ethereumTokens.stg, FeeAmount.MEDIUM), - }, -] - -export default ethereumFarmConfig - -/** @deprecated */ -export const legacyV3EthereumFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - ethereumFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [ diff --git a/packages/farms/src/farms/index.test.ts b/packages/farms/src/farms/index.test.ts deleted file mode 100644 index 9ecec12dcb7ea..0000000000000 --- a/packages/farms/src/farms/index.test.ts +++ /dev/null @@ -1,224 +0,0 @@ -import { ChainId, Pair } from '@pancakeswap/sdk' -import { Pool } from '@pancakeswap/v3-sdk' -import groupBy from 'lodash/groupBy' -import { createPublicClient, fallback, getAddress, http, parseAbiItem, PublicClient } from 'viem' -import * as CHAINS from 'viem/chains' -import { describe, expect, test } from 'vitest' -import { UNIVERSAL_FARMS } from '.' -import { masterChefV3Addresses, supportedChainIdV4 } from '../const' -import { UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const PUBLIC_NODES: Record = { - [ChainId.ARBITRUM_ONE]: [ - CHAINS.arbitrum.rpcUrls.default.http[0], - 'https://arbitrum-one.publicnode.com', - 'https://arbitrum.llamarpc.com', - ], - [ChainId.ETHEREUM]: [ - CHAINS.mainnet.rpcUrls.default.http[0], - 'https://ethereum.publicnode.com', - 'https://eth.llamarpc.com', - ], -} - -const getTestLpSymbol = (farm: UniversalFarmConfig) => { - return `${farm.chainId}:${farm.protocol}:${farm.token0.symbol}/${farm.token1.symbol}${ - farm.protocol === 'v3' ? ` fee ${farm.feeAmount}` : '' - }` -} - -const publicClient: Record = supportedChainIdV4.reduce((acc, chainId) => { - const node = PUBLIC_NODES[chainId] - return { - ...acc, - [chainId]: createPublicClient({ - chain: Object.values(CHAINS).find((chain) => chain.id === Number(chainId)), - transport: node ? fallback(node.map((rpc: string) => http(rpc))) : http(), - }) as PublicClient, - } -}, {} as Record) - -describe.concurrent( - 'Universal Farms config', - () => { - test('lpAddress should be unique', () => { - const configByChains = groupBy(UNIVERSAL_FARMS, 'chainId') - - for (const [chainId, config] of Object.entries(configByChains)) { - config.forEach((farm, index) => { - const duplicateLp = config.filter( - (f, i) => f.lpAddress === farm.lpAddress && i !== index && f.protocol === farm.protocol, - ) - expect(duplicateLp, `Duplicate lpAddress ${getTestLpSymbol(farm)} on chain ${chainId}`).toEqual([]) - }) - } - }) - - test('v3 pid should be unique', () => { - const configByChains = groupBy(UNIVERSAL_FARMS, 'chainId') - - for (const [chainId, config] of Object.entries(configByChains)) { - const v3Config = config.filter((farm) => farm.protocol === 'v3') - v3Config.forEach((farm, index) => { - const duplicatePid = v3Config.filter((f, i) => f.pid === farm.pid && i !== index) - expect(duplicatePid, `Duplicate v3 pid ${getTestLpSymbol(farm)} on chain ${chainId}`).toEqual([]) - }) - } - }) - - test('v3 pid should be correct', async () => { - const configByChains = groupBy(UNIVERSAL_FARMS, 'chainId') - - for await (const [chainId, configs_] of Object.entries(configByChains)) { - const client = publicClient[chainId] - const masterChefAddress = masterChefV3Addresses[Number(chainId) as keyof typeof masterChefV3Addresses] - if (!masterChefAddress) throw new Error(`No masterChefAddress for chain ${chainId}`) - const configs = configs_.filter((farm) => farm.protocol === 'v3') - - const pidCalls = configs.map((farm) => ({ - address: masterChefAddress, - functionName: 'v3PoolAddressPid', - abi: [parseAbiItem('function v3PoolAddressPid(address) view returns (uint256)')], - args: [farm.lpAddress], - })) - const pids = await client.multicall({ - contracts: pidCalls, - allowFailure: false, - }) - configs.forEach((farm, index) => { - expect(pids[index], `wrong pid ${getTestLpSymbol(farm)}`).toEqual(BigInt(farm.pid)) - }) - } - }) - - test('v2/ss bCakeWrapperAddress should be unique', () => { - const configByChains = groupBy(UNIVERSAL_FARMS, 'chainId') - - for (const [chainId, config] of Object.entries(configByChains)) { - const v2Config = config.filter((farm) => farm.protocol === 'v2' || farm.protocol === 'stable') - v2Config.forEach((farm, index) => { - const duplicateBCake = v2Config.filter( - (f, i) => f.bCakeWrapperAddress === farm.bCakeWrapperAddress && i !== index, - ) - expect(duplicateBCake, `Duplicate bCakeWrapperAddress ${getTestLpSymbol(farm)} on chain ${chainId}`).toEqual( - [], - ) - }) - } - }) - - test('v2/ss bCakeWrapperAddress should be correct', async () => { - const configByChains = groupBy(UNIVERSAL_FARMS, 'chainId') - - for await (const [chainId, configs_] of Object.entries(configByChains)) { - const client = publicClient[chainId] - const configs = configs_.filter((farm) => farm.protocol === 'v2' || farm.protocol === 'stable') - - const lpAddressCalls = configs.map((farm) => ({ - address: farm.bCakeWrapperAddress, - functionName: 'stakedToken', - abi: [parseAbiItem('function stakedToken() view returns (address)')], - })) - const lpAddresses = await client.multicall({ - contracts: lpAddressCalls, - allowFailure: false, - }) - configs.forEach((farm, index) => { - expect(getAddress(lpAddresses[index]), `wrong bCakeWrapperAddress ${getTestLpSymbol(farm)}`).toEqual( - farm.lpAddress, - ) - }) - } - }) - - test('stable lpAddress/stableSwapAddress should be correct', async () => { - const ssFarms = groupBy( - UNIVERSAL_FARMS.filter((farm) => farm.protocol === 'stable'), - 'chainId', - ) - - for await (const [chainId, farms] of Object.entries(ssFarms)) { - const client = publicClient[chainId] - - const minterCalls = farms.map((farm) => ({ - address: farm.lpAddress, - functionName: 'minter', - abi: [parseAbiItem('function minter() view returns (address)')], - })) - const minters = await client.multicall({ - contracts: minterCalls, - allowFailure: false, - }) - expect(minters.length).toBe(farms.length) - minters.forEach((minter, index) => { - expect(getAddress(minter), `wrong stableSwapAddress, ${getTestLpSymbol(farms[index])}`).toEqual( - farms[index].stableSwapAddress, - ) - }) - const coinsCall = minters.reduce((calls, minter) => { - return [ - ...calls, - { - address: minter, - functionName: 'coins', - abi: [parseAbiItem('function coins(uint256) view returns (address)')], - args: [0], - }, - { - address: minter, - functionName: 'coins', - abi: [parseAbiItem('function coins(uint256) view returns (address)')], - args: [1], - }, - ] - }, [] as unknown[]) - const coins = await client.multicall({ - contracts: coinsCall as any, - allowFailure: false, - }) - farms.forEach((farm, index) => { - const token0 = coins[index * 2] - const token1 = coins[index * 2 + 1] - expect(token0, `wrong stable pool coin0, ${getTestLpSymbol(farm)}`).toEqual(farm.token0.address) - expect(token1, `wrong stable pool coin1, ${getTestLpSymbol(farm)}`).toEqual(farm.token1.address) - }) - } - }) - - test('(v2 lpAddress) & (v3 lpAddress, feeAmount) should be correct', async () => { - const othersFarms = groupBy( - UNIVERSAL_FARMS.filter((farm) => farm.protocol !== 'stable'), - 'protocol', - ) - for (const [protocol, config] of Object.entries(othersFarms)) { - config.forEach((farm) => { - const lpAddress = - protocol === 'v2' - ? Pair.getAddress(farm.token0, farm.token1) - : Pool.getAddress(farm.token0, farm.token1, (farm as UniversalFarmConfigV3).feeAmount) - expect(lpAddress, `Wrong lpAddress for farm ${getTestLpSymbol(farm)}, expected ${lpAddress}`).toBe( - farm.lpAddress, - ) - }) - } - }) - - test('token order should be correct', () => { - for (const farm of UNIVERSAL_FARMS) { - if (farm.token0.isNative) continue - expect(farm.token1.isNative).toBe(false) - expect( - farm.token0.sortsBefore(farm.token1), - ` -Wrong token order for farm ${getTestLpSymbol(farm)}: -token0: ${farm.token0.address} -token1: ${farm.token1.address} - `, - ).toBe(true) - } - }) - }, - { - timeout: 300000, - }, -) diff --git a/packages/farms/src/farms/index.ts b/packages/farms/src/farms/index.ts index 932f123293e8c..e265239292bc8 100644 --- a/packages/farms/src/farms/index.ts +++ b/packages/farms/src/farms/index.ts @@ -1,38 +1,50 @@ +import { ChainId } from '@pancakeswap/chains' import set from 'lodash/set' - +import { fetchUniversalFarms } from '../fetchUniversalFarms' import { UniversalFarmConfig } from '../types' - -import { arbFarmConfig } from './arb' -import { baseFarmConfig } from './base' -import { bscFarmConfig } from './bsc' -import { ethereumFarmConfig } from './eth' -import { lineaFarmConfig } from './linea' -import { opBNBFarmConfig } from './opBNB' -import { polygonZkEVMFarmConfig } from './polygonZkEVM' -import { zkSyncFarmConfig } from './zkSync' - import { bscTestnetFarmConfig } from './bscTestnet' import { polygonZkEVMTestnetFarmConfig } from './polygonZkEVMTestnet' import { zkSyncTestnetFarmConfig } from './zkSyncTestnet' -export const UNIVERSAL_FARMS: UniversalFarmConfig[] = [ - ...bscFarmConfig, - ...ethereumFarmConfig, - ...polygonZkEVMFarmConfig, - ...zkSyncFarmConfig, - ...arbFarmConfig, - ...lineaFarmConfig, - ...baseFarmConfig, - ...opBNBFarmConfig, +const chainIds: ChainId[] = [ + ChainId.BSC, + ChainId.ETHEREUM, + ChainId.POLYGON_ZKEVM, + ChainId.ZKSYNC, + ChainId.ARBITRUM_ONE, + ChainId.LINEA, + ChainId.BASE, + ChainId.OPBNB, ] -export const UNIVERSAL_FARMS_MAP: Record = UNIVERSAL_FARMS.reduce((acc, farm) => { - set(acc, `${farm.chainId}:${farm.lpAddress}`, farm) - return acc -}, {} as Record) +export const fetchAllUniversalFarms = async (): Promise => { + try { + const farmPromises = chainIds.map((chainId) => fetchUniversalFarms(chainId)) + const allFarms = await Promise.all(farmPromises) + const combinedFarms = allFarms.flat() + + return combinedFarms + } catch (error) { + console.error('Failed to fetch universal farms:', error) + return [] + } +} + +export const fetchAllUniversalFarmsMap = async (): Promise> => { + try { + const farmConfig = await fetchAllUniversalFarms() + + return farmConfig.reduce((acc, farm) => { + set(acc, `${farm.chainId}:${farm.lpAddress}`, farm) + return acc + }, {} as Record) + } catch (error) { + console.error('Failed to fetch universal farms map:', error) + return {} + } +} export const UNIVERSAL_FARMS_WITH_TESTNET: UniversalFarmConfig[] = [ - ...UNIVERSAL_FARMS, ...bscTestnetFarmConfig, ...polygonZkEVMTestnetFarmConfig, ...zkSyncTestnetFarmConfig, diff --git a/packages/farms/src/farms/linea.ts b/packages/farms/src/farms/linea.ts index 280e5fa17515e..30fd3690422df 100644 --- a/packages/farms/src/farms/linea.ts +++ b/packages/farms/src/farms/linea.ts @@ -1,152 +1,4 @@ -import { ChainId } from '@pancakeswap/chains' -import { lineaTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [ - { - pid: 9, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.usdc, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(lineaTokens.usdc, lineaTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 12, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.usdt, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(lineaTokens.usdt, lineaTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 1, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.usdc, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(lineaTokens.usdc, lineaTokens.weth, FeeAmount.LOW), - }, - { - pid: 8, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.usdt, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(lineaTokens.usdt, lineaTokens.weth, FeeAmount.LOW), - }, - - { - pid: 2, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.usdc, - token1: lineaTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(lineaTokens.usdc, lineaTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 10, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.wbtc, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(lineaTokens.wbtc, lineaTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 3, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.wbtc, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(lineaTokens.wbtc, lineaTokens.weth, FeeAmount.LOW), - }, -] - -export const lineaFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 14, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.foxy, - token1: lineaTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(lineaTokens.foxy, lineaTokens.weth, FeeAmount.HIGH), - }, - { - pid: 13, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.ezETH, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(lineaTokens.ezETH, lineaTokens.weth, FeeAmount.LOW), - }, - - { - pid: 11, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.cake, - token1: lineaTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(lineaTokens.cake, lineaTokens.weth, FeeAmount.HIGH), - }, - - { - pid: 7, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.wstETH, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(lineaTokens.wstETH, lineaTokens.weth, FeeAmount.LOW), - }, - { - pid: 6, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.wstETH, - token1: lineaTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(lineaTokens.wstETH, lineaTokens.weth, FeeAmount.LOWEST), - }, - - { - pid: 4, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.usdc, - token1: lineaTokens.dai, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(lineaTokens.usdc, lineaTokens.dai, FeeAmount.LOWEST), - }, - { - pid: 5, - chainId: ChainId.LINEA, - protocol: Protocol.V3, - token0: lineaTokens.usdc, - token1: lineaTokens.axlusdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(lineaTokens.usdc, lineaTokens.axlusdc, FeeAmount.LOWEST), - }, -] - -export default lineaFarmConfig - -/** @deprecated */ -export const legacyV3LineaFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - lineaFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [] diff --git a/packages/farms/src/farms/opBNB.ts b/packages/farms/src/farms/opBNB.ts index 929259a37e3aa..30fd3690422df 100644 --- a/packages/farms/src/farms/opBNB.ts +++ b/packages/farms/src/farms/opBNB.ts @@ -1,57 +1,4 @@ -import { ChainId } from '@pancakeswap/chains' -import { opBnbTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [] - -export const opBNBFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 4, - chainId: ChainId.OPBNB, - protocol: Protocol.V3, - token0: opBnbTokens.usdt, - token1: opBnbTokens.xcad, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(opBnbTokens.usdt, opBnbTokens.xcad, FeeAmount.HIGH), - }, - { - pid: 3, - chainId: ChainId.OPBNB, - protocol: Protocol.V3, - token0: opBnbTokens.wbnb, - token1: opBnbTokens.eth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(opBnbTokens.wbnb, opBnbTokens.eth, FeeAmount.MEDIUM), - }, - { - pid: 2, - chainId: ChainId.OPBNB, - protocol: Protocol.V3, - token0: opBnbTokens.fdusd, - token1: opBnbTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(opBnbTokens.fdusd, opBnbTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 1, - chainId: ChainId.OPBNB, - protocol: Protocol.V3, - token0: opBnbTokens.wbnb, - token1: opBnbTokens.usdt, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(opBnbTokens.wbnb, opBnbTokens.usdt, FeeAmount.LOW), - }, -] - -export default opBNBFarmConfig - -/** @deprecated */ -export const legacyV3OpBNBFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - opBNBFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [] diff --git a/packages/farms/src/farms/opBnbTestnet.ts b/packages/farms/src/farms/opBnbTestnet.ts index dd298f383f0c9..30fd3690422df 100644 --- a/packages/farms/src/farms/opBnbTestnet.ts +++ b/packages/farms/src/farms/opBnbTestnet.ts @@ -1,49 +1,4 @@ -import { ChainId } from '@pancakeswap/chains' -import { opBnbTestnetTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [] - -export const opBNBTestnetFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 1, - chainId: ChainId.OPBNB_TESTNET, - protocol: Protocol.V3, - token0: opBnbTestnetTokens.mockA, - token1: opBnbTestnetTokens.wbnb, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(opBnbTestnetTokens.mockA, opBnbTestnetTokens.wbnb, FeeAmount.LOW), - }, - - { - pid: 2, - chainId: ChainId.OPBNB_TESTNET, - protocol: Protocol.V3, - token0: opBnbTestnetTokens.mockB, - token1: opBnbTestnetTokens.wbnb, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(opBnbTestnetTokens.mockB, opBnbTestnetTokens.wbnb, FeeAmount.MEDIUM), - }, - { - pid: 3, - chainId: ChainId.OPBNB_TESTNET, - protocol: Protocol.V3, - token0: opBnbTestnetTokens.mockB, - token1: opBnbTestnetTokens.mockC, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(opBnbTestnetTokens.mockB, opBnbTestnetTokens.mockC, FeeAmount.HIGH), - }, -] - -export default opBNBTestnetFarmConfig - -/** @deprecated */ -export const legacyV3OpBNBTestnetFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - opBNBTestnetFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [] diff --git a/packages/farms/src/farms/polygonZkEVM.ts b/packages/farms/src/farms/polygonZkEVM.ts index 951c405d90048..30fd3690422df 100644 --- a/packages/farms/src/farms/polygonZkEVM.ts +++ b/packages/farms/src/farms/polygonZkEVM.ts @@ -1,257 +1,4 @@ -import { ChainId } from '@pancakeswap/chains' -import { polygonZkEvmTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [ - { - pid: 15, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 1, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.usdc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.usdc, FeeAmount.LOW), - }, - { - pid: 2, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.usdt, - token1: polygonZkEvmTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.usdt, polygonZkEvmTokens.weth, FeeAmount.LOW), - }, - { - pid: 3, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.usdt, - token1: polygonZkEvmTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.usdt, polygonZkEvmTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 16, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.wbtc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.wbtc, FeeAmount.LOWEST), - }, - { - pid: 17, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.matic, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.matic, FeeAmount.LOW), - }, - { - pid: 4, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.matic, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.matic, FeeAmount.MEDIUM), - }, -] - -export const polygonZkEVMFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 26, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(polygonZkEvmTokens.pol, polygonZkEvmTokens.matic, FeeAmount.LOWEST), - token0: polygonZkEvmTokens.pol, - token1: polygonZkEvmTokens.matic, - feeAmount: FeeAmount.LOWEST, - }, - { - pid: 25, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(polygonZkEvmTokens.pol, polygonZkEvmTokens.weth, FeeAmount.LOW), - token0: polygonZkEvmTokens.pol, - token1: polygonZkEvmTokens.weth, - feeAmount: FeeAmount.LOW, - }, - { - pid: 24, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(polygonZkEvmTokens.usdt, polygonZkEvmTokens.pol, FeeAmount.LOW), - token0: polygonZkEvmTokens.usdt, - token1: polygonZkEvmTokens.pol, - feeAmount: FeeAmount.LOW, - }, - { - pid: 23, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - lpAddress: Pool.getAddress(polygonZkEvmTokens.pol, polygonZkEvmTokens.usdce, FeeAmount.LOW), - token0: polygonZkEvmTokens.pol, - token1: polygonZkEvmTokens.usdce, - feeAmount: FeeAmount.LOW, - }, - { - pid: 22, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.usdc, - token1: polygonZkEvmTokens.dai, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.usdc, polygonZkEvmTokens.dai, FeeAmount.LOWEST), - }, - { - pid: 21, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.usdt, - token1: polygonZkEvmTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.usdt, polygonZkEvmTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 20, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.usdce, - token1: polygonZkEvmTokens.grai, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.usdce, polygonZkEvmTokens.grai, FeeAmount.LOW), - }, - { - pid: 19, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.cake, - token1: polygonZkEvmTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(polygonZkEvmTokens.cake, polygonZkEvmTokens.weth, FeeAmount.HIGH), - }, - { - pid: 18, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.cake, - token1: polygonZkEvmTokens.usdc, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(polygonZkEvmTokens.cake, polygonZkEvmTokens.usdc, FeeAmount.HIGH), - }, - - { - pid: 14, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.rsETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.rsETH, FeeAmount.LOW), - }, - { - pid: 13, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.reth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.reth, FeeAmount.LOW), - }, - { - pid: 12, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.wstETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.wstETH, FeeAmount.LOW), - }, - { - pid: 11, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.wstETH, - token1: polygonZkEvmTokens.reth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.wstETH, polygonZkEvmTokens.reth, FeeAmount.LOW), - }, - { - pid: 8, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.wstETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.wstETH, FeeAmount.LOWEST), - }, - { - pid: 9, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.reth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.reth, FeeAmount.LOWEST), - }, - { - pid: 10, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.rsETH, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.rsETH, FeeAmount.LOWEST), - }, - { - pid: 7, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.usdce, - token1: polygonZkEvmTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(polygonZkEvmTokens.usdce, polygonZkEvmTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 5, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.usdc, - token1: polygonZkEvmTokens.grai, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.usdc, polygonZkEvmTokens.grai, FeeAmount.LOW), - }, - { - pid: 6, - chainId: ChainId.POLYGON_ZKEVM, - protocol: Protocol.V3, - token0: polygonZkEvmTokens.weth, - token1: polygonZkEvmTokens.wbtc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(polygonZkEvmTokens.weth, polygonZkEvmTokens.wbtc, FeeAmount.LOW), - }, -] - -export default polygonZkEVMFarmConfig - -/** @deprecated */ -export const legacyV3PolygonZkEVMFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - polygonZkEVMFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [] diff --git a/packages/farms/src/farms/zkSync.ts b/packages/farms/src/farms/zkSync.ts index 17c071cd478cb..30fd3690422df 100644 --- a/packages/farms/src/farms/zkSync.ts +++ b/packages/farms/src/farms/zkSync.ts @@ -1,334 +1,4 @@ -import { ChainId } from '@pancakeswap/chains' -import { zksyncTokens } from '@pancakeswap/tokens' -import { FeeAmount, Pool } from '@pancakeswap/v3-sdk' -import { defineFarmV3ConfigsFromUniversalFarm } from '../defineFarmV3Configs' -import { Protocol, SerializedFarmConfig, UniversalFarmConfig, UniversalFarmConfigV3 } from '../types' - -const pinnedFarmConfig: UniversalFarmConfig[] = [ - { - pid: 29, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.zk, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(zksyncTokens.zk, zksyncTokens.weth, FeeAmount.MEDIUM), - }, - - { - pid: 33, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdcNative, - token1: zksyncTokens.zk, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(zksyncTokens.usdcNative, zksyncTokens.zk, FeeAmount.MEDIUM), - }, - { - pid: 31, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.zk, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.zk, FeeAmount.MEDIUM), - }, - { - pid: 5, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.cake, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(zksyncTokens.cake, zksyncTokens.weth, FeeAmount.MEDIUM), - }, - - { - pid: 8, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 1, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.weth, FeeAmount.LOW), - }, - { - pid: 18, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdt, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdt, zksyncTokens.weth, FeeAmount.LOWEST), - }, - { - pid: 12, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdt, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.usdt, zksyncTokens.weth, FeeAmount.LOW), - }, - { - pid: 3, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 6, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.weth, - token1: zksyncTokens.wbtc, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.weth, zksyncTokens.wbtc, FeeAmount.LOW), - }, -] - -export const zkSyncFarmConfig: UniversalFarmConfig[] = [ - ...pinnedFarmConfig, - { - pid: 34, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.weth, - token1: zksyncTokens.rf, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(zksyncTokens.weth, zksyncTokens.rf, FeeAmount.HIGH), - }, - - { - pid: 32, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdcNative, - token1: zksyncTokens.zk, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(zksyncTokens.usdcNative, zksyncTokens.zk, FeeAmount.HIGH), - }, - - { - pid: 30, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.zk, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.zk, FeeAmount.HIGH), - }, - { - pid: 28, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.zk, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(zksyncTokens.zk, zksyncTokens.weth, FeeAmount.HIGH), - }, - { - pid: 27, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdcNative, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.usdcNative, zksyncTokens.weth, FeeAmount.LOW), - }, - { - pid: 26, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdcNative, - token1: zksyncTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdcNative, zksyncTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 25, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdcNative, - token1: zksyncTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdcNative, zksyncTokens.usdc, FeeAmount.LOWEST), - }, - { - pid: 24, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdt, - token1: zksyncTokens.usdtPlus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdt, zksyncTokens.usdtPlus, FeeAmount.LOWEST), - }, - { - pid: 23, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdPlus, - token1: zksyncTokens.usdtPlus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdPlus, zksyncTokens.usdtPlus, FeeAmount.LOWEST), - }, - { - pid: 22, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.grai, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.grai, FeeAmount.LOWEST), - }, - { - pid: 21, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.grai, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.grai, FeeAmount.LOW), - }, - { - pid: 20, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.weth, - token1: zksyncTokens.wethe, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.weth, zksyncTokens.wethe, FeeAmount.LOW), - }, - { - pid: 19, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.weth, - token1: zksyncTokens.wbtc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.weth, zksyncTokens.wbtc, FeeAmount.LOWEST), - }, - { - pid: 17, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.dai, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.dai, FeeAmount.LOWEST), - }, - { - pid: 16, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdt, - token1: zksyncTokens.dai, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdt, zksyncTokens.dai, FeeAmount.LOWEST), - }, - { - pid: 15, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.reth, - token1: zksyncTokens.wstETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.reth, zksyncTokens.wstETH, FeeAmount.LOW), - }, - { - pid: 14, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.wstETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.wstETH, FeeAmount.LOW), - }, - { - pid: 13, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.weth, - token1: zksyncTokens.wstETH, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.weth, zksyncTokens.wstETH, FeeAmount.LOW), - }, - - { - pid: 11, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.usdPlus, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.usdPlus, FeeAmount.LOWEST), - }, - { - pid: 10, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.reth, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.LOW, - lpAddress: Pool.getAddress(zksyncTokens.reth, zksyncTokens.weth, FeeAmount.LOW), - }, - { - pid: 9, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.busd, - token1: zksyncTokens.usdt, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.busd, zksyncTokens.usdt, FeeAmount.LOWEST), - }, - { - pid: 2, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.usdc, - token1: zksyncTokens.weth, - feeAmount: FeeAmount.MEDIUM, - lpAddress: Pool.getAddress(zksyncTokens.usdc, zksyncTokens.weth, FeeAmount.MEDIUM), - }, - - { - pid: 4, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.weth, - token1: zksyncTokens.tes, - feeAmount: FeeAmount.HIGH, - lpAddress: Pool.getAddress(zksyncTokens.weth, zksyncTokens.tes, FeeAmount.HIGH), - }, - - { - pid: 7, - chainId: ChainId.ZKSYNC, - protocol: Protocol.V3, - token0: zksyncTokens.busd, - token1: zksyncTokens.usdc, - feeAmount: FeeAmount.LOWEST, - lpAddress: Pool.getAddress(zksyncTokens.busd, zksyncTokens.usdc, FeeAmount.LOWEST), - }, -] -export default zkSyncFarmConfig - -/** @deprecated */ -export const legacyV3ZkSyncFarmConfig = defineFarmV3ConfigsFromUniversalFarm( - zkSyncFarmConfig.filter((farm): farm is UniversalFarmConfigV3 => farm.protocol === Protocol.V3), -) +import { SerializedFarmConfig } from '../types' /** @deprecated */ export const legacyFarmConfig: SerializedFarmConfig[] = [] diff --git a/packages/farms/src/fetchUniversalFarms.ts b/packages/farms/src/fetchUniversalFarms.ts new file mode 100644 index 0000000000000..5a0e206182599 --- /dev/null +++ b/packages/farms/src/fetchUniversalFarms.ts @@ -0,0 +1,53 @@ +import { ChainId } from '@pancakeswap/chains' +import { ERC20Token } from '@pancakeswap/sdk' +import { FARMS_API } from '../config/endpoint' +import { Protocol, UniversalFarmConfig } from './types' + +const farmCache: Record = {} + +export const fetchUniversalFarms = async (chainId: ChainId, protocol?: Protocol) => { + const cacheKey = `${chainId}-${protocol || 'all'}` + + // Return cached data if it exists + if (farmCache[cacheKey]) { + return farmCache[cacheKey] + } + + try { + const params = { chainId, ...(protocol && { protocol }) } + const queryString = Object.entries(params) + .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) + .join('&') + + const response = await fetch(`${FARMS_API}?${queryString}`, { + signal: AbortSignal.timeout(3000), + }) + const result = await response.json() + const newData: UniversalFarmConfig[] = result.map((p: any) => ({ + ...p, + token0: new ERC20Token( + p.token0.chainId, + p.token0.address, + p.token0.decimals, + p.token0.symbol, + p.token0.name, + p.token0.projectLink, + ), + token1: new ERC20Token( + p.token1.chainId, + p.token1.address, + p.token1.decimals, + p.token1.symbol, + p.token1.name, + p.token1.projectLink, + ), + })) + + // Cache the result before returning it + farmCache[cacheKey] = newData + + return newData + } catch (error) { + return [] + } +} diff --git a/packages/farms/src/getLegacyFarmConfig.ts b/packages/farms/src/getLegacyFarmConfig.ts index f19cd1baeef9f..7c7f16b1398a6 100644 --- a/packages/farms/src/getLegacyFarmConfig.ts +++ b/packages/farms/src/getLegacyFarmConfig.ts @@ -1,6 +1,7 @@ import { ChainId, getChainName } from '@pancakeswap/chains' import { getStableSwapPools } from '@pancakeswap/stable-swap-sdk' import { supportedChainIdV4 } from './const' +import { fetchUniversalFarms } from './fetchUniversalFarms' import { SerializedFarmConfig, SerializedFarmPublicData, UniversalFarmConfig } from './types' /** @@ -11,7 +12,7 @@ export async function getLegacyFarmConfig(chainId?: ChainId): Promise 0) { @@ -24,8 +25,8 @@ export async function getLegacyFarmConfig(chainId?: ChainId): Promise f.pid && (f.protocol === 'v2' || f.protocol === 'stable')) - .map((farm) => { + ?.filter((f) => f.pid && (f.protocol === 'v2' || f.protocol === 'stable')) + ?.map((farm) => { const stablePair = farm.protocol === 'stable' ? getStableSwapPools(chainId).find((s) => { diff --git a/packages/farms/src/index.ts b/packages/farms/src/index.ts index b87714364d398..6fcf9e15fc551 100644 --- a/packages/farms/src/index.ts +++ b/packages/farms/src/index.ts @@ -155,7 +155,9 @@ export function createFarmFetcherV3(provider: ({ chainId }: { chainId: number }) export * from './apr' export { FARM_AUCTION_HOSTING_IN_SECONDS } from './const' +export * from './defineFarmV3Configs' export * from './farms' +export * from './fetchUniversalFarms' export * from './getLegacyFarmConfig' export * from './types' export * from './utils' diff --git a/packages/farms/tests/v3.test.ts b/packages/farms/tests/v3.test.ts deleted file mode 100644 index 5de2531d4a0b1..0000000000000 --- a/packages/farms/tests/v3.test.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { ChainId, chainNames, isTestnetChainId } from '@pancakeswap/chains' -import { Pool } from '@pancakeswap/v3-sdk' -import groupBy from 'lodash/groupBy' -import { isAddressEqual } from 'viem' -import { describe, expect, it } from 'vitest' -import { priceHelperTokens } from '../constants/common' -import { legacyFarmsV3ConfigChainMap } from '../constants/v3' -import { supportedChainIdV3 } from '../src' -import { CommonPrice, getFarmsPrices } from '../src/fetchFarmsV3' - -const tokenListMap = { - [ChainId.BSC]: 'https://tokens.pancakeswap.finance/pancakeswap-extended.json', - [ChainId.ETHEREUM]: 'https://tokens.pancakeswap.finance/pancakeswap-eth-default.json', - [ChainId.ZKSYNC]: 'https://tokens.pancakeswap.finance/pancakeswap-zksync-default.json', - [ChainId.POLYGON_ZKEVM]: 'https://tokens.pancakeswap.finance/pancakeswap-polygon-zkevm-default.json', - [ChainId.ARBITRUM_ONE]: 'https://tokens.pancakeswap.finance/pancakeswap-arbitrum-default.json', - [ChainId.LINEA]: 'https://tokens.pancakeswap.finance/pancakeswap-linea-default.json', - [ChainId.BASE]: 'https://tokens.pancakeswap.finance/pancakeswap-base-default.json', - [ChainId.OPBNB]: 'https://tokens.pancakeswap.finance/pancakeswap-opbnb-default.json', -} as const - -describe('Config farms V3', async () => { - const tokenListByChain = {} as Record - - await Promise.all( - Object.entries(tokenListMap).map(async ([_chainId, url]) => { - const chainId = Number(_chainId) - try { - const resp = await fetch(url) - const json = await resp.json() - tokenListByChain[chainId] = json - } catch (error) { - console.error('chainId', url, error) - throw error - } - }), - ) - Object.entries(legacyFarmsV3ConfigChainMap).forEach(([_chainId, farms]) => { - if (!supportedChainIdV3.filter((id) => !isTestnetChainId(id)).includes(Number(_chainId))) return - const chainId = Number(_chainId) as ChainId - const tokenList = tokenListByChain[chainId] - it(`${chainNames[chainId]}.ts have config in token-list`, () => { - expect(tokenList).not.toBeUndefined() - }) - - const groups = groupBy(farms, 'pid') - Object.entries(groups).forEach(([pid, c]) => { - it(`${chainNames[chainId]}.ts farms with pid #${pid} should unique`, () => { - expect(c.length).toBe(1) - }) - }) - const lps = groupBy(farms, 'lpAddress') - Object.entries(lps).forEach(([lpAddress, c]) => { - it(`${chainNames[chainId]}.ts farms with lpAddress ${lpAddress} should unique`, () => { - expect(c.length).toBe(1) - }) - }) - - farms.forEach((farm) => { - it(`${chainNames[chainId]}.ts pid #${farm.pid} tokens should has correct chainId`, () => { - expect(farm.token0.chainId).toBe(chainId) - expect(farm.token1.chainId).toBe(chainId) - }) - const token0InList = tokenList.tokens.find((t) => isAddressEqual(t.address, farm.token0.address)) - const token1InList = tokenList.tokens.find((t) => isAddressEqual(t.address, farm.token1.address)) - - it(`${chainNames[chainId]}.ts pid #${farm.pid} tokens should add to tokenlist`, () => { - expect(token0InList, `${farm.token0.symbol}#${farm.token0.address}`).toBeDefined() - expect(token1InList, `${farm.token1.symbol}#${farm.token1.address}`).toBeDefined() - }) - - it(`${chainNames[chainId]}.ts pid #${farm.pid} should has correct lpAddress`, () => { - expect(Pool.getAddress(farm.token, farm.quoteToken, farm.feeAmount)).toEqual(farm.lpAddress) - }) - - it(`${chainNames[chainId]}.ts pid #${farm.pid} should has correct token order`, () => { - expect(farm.token0.sortsBefore(farm.token1)).toBeTruthy() - }) - }) - - const commonPrice: CommonPrice = {} - for (const commonToken of priceHelperTokens[chainId as keyof typeof priceHelperTokens].list) { - commonPrice[commonToken.address] = '1' - } - const farmPrices = getFarmsPrices( - farms.map((f) => ({ - ...f, - tokenPriceVsQuote: '1', - lmPool: '0x', - lmPoolLiquidity: '', - multiplier: '', - poolWeight: '', - })), - '30', - commonPrice, - ) - - for (const farmPrice of farmPrices) { - it(`${chainNames[chainId]}.ts should have correct farm price for token ${farmPrice.token.address}`, () => { - expect(farmPrice.tokenPriceBusd).not.toEqual('0') - }) - it(`${chainNames[chainId]}.ts should have correct farm price for quoteToken ${farmPrice.quoteToken.address}`, () => { - expect(farmPrice.quoteTokenPriceBusd).not.toEqual('0') - }) - } - }) -}) diff --git a/packages/localization/src/config/translations.json b/packages/localization/src/config/translations.json index f8d9ffd316f62..6335f060b92be 100644 --- a/packages/localization/src/config/translations.json +++ b/packages/localization/src/config/translations.json @@ -1975,10 +1975,6 @@ "By adding liquidity, you’ll earn 50% from the fees of all trades on this pair, proportional to your share in the trading pair. Fees are added to the pair, accrue in real time, and can be claimed by withdrawing your liquidity. For more information on Stableswap fees click": "By adding liquidity, you’ll earn 50% from the fees of all trades on this pair, proportional to your share in the trading pair. Fees are added to the pair, accrue in real time, and can be claimed by withdrawing your liquidity. For more information on Stableswap fees click", "Due to an ongoing Subgraph indexing issue from the underlying infrastructure provider. The PancakeSwap NFT marketplace is currently showing outdated data. Continuing trading may be subject to the risk of executing orders at unexpected prices and loss of funds. We recommend not to trade until the issue is resolved. Follow our ": "Due to an ongoing Subgraph indexing issue from the underlying infrastructure provider. The PancakeSwap NFT marketplace is currently showing outdated data. Continuing trading may be subject to the risk of executing orders at unexpected prices and loss of funds. We recommend not to trade until the issue is resolved. Follow our ", "for the latest update.": "for the latest update.", - "Volume (24H)": "Volume (24H)", - "Token Name": "Token Name", - "Change": "Change", - "Top Token": "Top Token", "Farm Types": "Farm Types", "Lock End": "Lock End", "The locked staking duration has ended.": "The locked staking duration has ended.", @@ -2350,10 +2346,6 @@ "Get Started": "Get Started", "V3 Farms": "V3 Farms", "V2 Farms": "V2 Farms", - "This token contains trading pair(s) eligible for earning CAKE by trading:": "This token contains trading pair(s) eligible for earning CAKE by trading:", - "Trade now or check out the campaign page to learn more": "Trade now or check out the campaign page to learn more", - "learn more": "learn more", - "Show pairs with trading rewards": "Show pairs with trading rewards", "Your Trading Fee": "Your Trading Fee", "An additional amount of reward of": "An additional amount of reward of", "Combined APR": "Combined APR",