diff --git a/packages/lib/shared/components/tooltips/apr-tooltip/AddLiquidityAprTooltip.tsx b/packages/lib/shared/components/tooltips/apr-tooltip/AddLiquidityAprTooltip.tsx index ba294990d..9915e4772 100644 --- a/packages/lib/shared/components/tooltips/apr-tooltip/AddLiquidityAprTooltip.tsx +++ b/packages/lib/shared/components/tooltips/apr-tooltip/AddLiquidityAprTooltip.tsx @@ -10,7 +10,7 @@ import { SparklesIcon } from './MainAprTooltip' interface Props extends Omit< BaseAprTooltipProps, - 'children' | 'totalBaseText' | 'totalBaseVeBalText' | 'maxVeBalText' | 'poolId' + 'children' | 'totalBaseText' | 'totalBaseVeBalText' | 'maxVeBalText' | 'poolId' | 'poolType' > { totalUsdValue: string weeklyYield: string @@ -56,6 +56,7 @@ function AddLiquidityAprTooltip({ weeklyYield, totalUsdValue, pool, ...props }: shouldDisplayBaseTooltip shouldDisplayMaxVeBalTooltip usePortal={false} + poolType={pool.type} > diff --git a/packages/lib/shared/components/tooltips/apr-tooltip/BaseAprTooltip.tsx b/packages/lib/shared/components/tooltips/apr-tooltip/BaseAprTooltip.tsx index 12f515476..cd475f2c0 100644 --- a/packages/lib/shared/components/tooltips/apr-tooltip/BaseAprTooltip.tsx +++ b/packages/lib/shared/components/tooltips/apr-tooltip/BaseAprTooltip.tsx @@ -1,4 +1,4 @@ -import { GqlPoolAprItem } from '@repo/lib/shared/services/api/generated/graphql' +import { GqlPoolAprItem, GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql' import { PlacementWithLogical, Popover, @@ -22,7 +22,7 @@ import { import { TooltipAprItem } from './TooltipAprItem' import BigNumber from 'bignumber.js' import { bn, fNum } from '@repo/lib/shared/utils/numbers' -import { isVebalPool } from '@repo/lib/modules/pool/pool.helpers' +import { isCowAmmPool, isVebalPool } from '@repo/lib/modules/pool/pool.helpers' import { ReactNode } from 'react' interface Props { @@ -31,6 +31,7 @@ interface Props { displayValueFormatter?: (value: BigNumber) => string placement?: PlacementWithLogical poolId: string + poolType: GqlPoolType vebalBoost?: string totalBaseText: string | ((hasVeBalBoost?: boolean) => string) totalBaseVeBalText: string @@ -73,6 +74,7 @@ function BaseAprTooltip({ shouldDisplayBaseTooltip, shouldDisplayMaxVeBalTooltip, children, + poolType, usePortal = true, }: Props) { const colorMode = useThemeColorMode() @@ -87,7 +89,6 @@ function BaseAprTooltip({ stakingIncentivesAprDisplayed, merklIncentivesAprDisplayed, hasMerklIncentives, - hasSurplusIncentives, surplusIncentivesAprDisplayed, swapFeesDisplayed, isSwapFeePresent, @@ -185,7 +186,7 @@ function BaseAprTooltip({ tooltipText={merklIncentivesTooltipText} /> )} - {hasSurplusIncentives && ( + {isCowAmmPool(poolType) && ( { textProps?: TextProps onlySparkles?: boolean @@ -151,6 +151,7 @@ function MainAprTooltip({ totalBaseVeBalText="Total base APR" customPopoverContent={customPopoverContent} vebalBoost={vebalBoost} + poolType={pool.type} > {({ isOpen }) => ( diff --git a/packages/lib/shared/components/tooltips/apr-tooltip/StakeAprTooltip.tsx b/packages/lib/shared/components/tooltips/apr-tooltip/StakeAprTooltip.tsx index f5e1cd64d..6d60baa30 100644 --- a/packages/lib/shared/components/tooltips/apr-tooltip/StakeAprTooltip.tsx +++ b/packages/lib/shared/components/tooltips/apr-tooltip/StakeAprTooltip.tsx @@ -43,6 +43,7 @@ function StakeAprTooltip({ pool, totalUsdValue }: Props) { shouldDisplayBaseTooltip shouldDisplayMaxVeBalTooltip usePortal={false} + poolType={pool.type} > diff --git a/packages/lib/shared/hooks/useAprTooltip.ts b/packages/lib/shared/hooks/useAprTooltip.ts index 0c55ac14c..1caef919e 100644 --- a/packages/lib/shared/hooks/useAprTooltip.ts +++ b/packages/lib/shared/hooks/useAprTooltip.ts @@ -116,7 +116,6 @@ export function useAprTooltip({ // Surplus incentives const surplusIncentives = filterByType(aprItems, GqlPoolAprItemType.Surplus) - const hasSurplusIncentives = surplusIncentives.length > 0 const surplusIncentivesAprDisplayed = calculateSingleIncentivesAprDisplayed(surplusIncentives) // Bal Reward @@ -177,7 +176,6 @@ export function useAprTooltip({ merklIncentivesAprDisplayed, hasMerklIncentives, surplusIncentivesAprDisplayed, - hasSurplusIncentives, votingAprDisplayed, lockingAprDisplayed, isVotingPresent,