Skip to content

Commit

Permalink
fix apr calc
Browse files Browse the repository at this point in the history
  • Loading branch information
groninge01 committed Dec 24, 2024
1 parent 6d81e55 commit ab1d5c0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/lib/shared/hooks/useAprTooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,13 @@ export function useAprTooltip({
maBeetsReward ? maBeetsReward.apr.toString() : '0'
)

const maBeetsStakingBoost = aprItems.find(
const maxMaBeetsReward = aprItems.find(
item => item.type === GqlPoolAprItemType.StakingBoost && item.id.match(/beets-apr-boost/) // TODO: or add prop in api to distinguish?
)

const maBeetsStakingBoostDisplayed = numberFormatter(
maBeetsStakingBoost ? maBeetsStakingBoost.apr.toString() : '0'
const maxMaBeetsRewardDisplayed = numberFormatter(
maxMaBeetsReward ? maxMaBeetsReward.apr.toString() : '0'
)
const maxMaBeetsRewardDisplayed = bn(maBeetsRewardsDisplayed).plus(maBeetsStakingBoostDisplayed)

const maxMaBeetsVotingReward = aprItems.find(
item => item.type === GqlPoolAprItemType.StakingBoost && item.id.match(/voting-apr-boost/) // TODO: or add prop in api to distinguish?
Expand All @@ -165,7 +164,6 @@ export function useAprTooltip({
.plus(maBeetsRewardsDisplayed)
.plus(maxMaBeetsRewardDisplayed)
.plus(maxMaBeetsVotingRewardDisplayed)
.plus(yieldBearingTokensAprDisplayed)

const isMaBeetsPresent = !maBeetsRewardsDisplayed.isZero()

Expand Down

0 comments on commit ab1d5c0

Please sign in to comment.