Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEETS] add aprs to mabeets #386

Merged
merged 4 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function BaseAprTooltip({
fontWeight={500}
pl={6}
pt={3}
title="Max maBEETS APR"
title="Extra BEETS (max maturity boost)"
tooltipText={maBeetsRewardTooltipText}
/>
<TooltipAprItem
Expand All @@ -326,7 +326,7 @@ function BaseAprTooltip({
fontColor={colorMode == 'light' ? 'gray.600' : 'gray.400'}
fontWeight={500}
pl={6}
title="Max Voting APR"
title="Extra Voting APR"
tooltipText={maBeetsVotingRewardsTooltipText}
/>
<Divider />
Expand Down
10 changes: 5 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 @@ -161,9 +160,10 @@ export function useAprTooltip({
)

const maBeetsTotalAprDisplayed = bn(swapFeesDisplayed)
.plus(yieldBearingTokensAprDisplayed)
.plus(maBeetsRewardsDisplayed)
.plus(maxMaBeetsRewardDisplayed)
.plus(maxMaBeetsVotingRewardDisplayed)
.plus(yieldBearingTokensAprDisplayed)

const isMaBeetsPresent = !maBeetsRewardsDisplayed.isZero()

Expand Down
Loading