Skip to content

Commit

Permalink
feat: Gho debt swap APY display (#2136)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinBattilana authored Aug 2, 2024
1 parent 8204f1b commit 9dde336
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TokenIcon } from 'src/components/primitives/TokenIcon';
import { TextWithTooltip } from 'src/components/TextWithTooltip';
import { DetailsIncentivesLine } from 'src/components/transactions/FlowCommons/TxModalDetails';
import { CustomMarket } from 'src/ui-config/marketsConfig';
import { weightedAverageAPY } from 'src/utils/ghoUtilities';
import { displayGhoForMintableMarket, weightedAverageAPY } from 'src/utils/ghoUtilities';

import { ComputedUserReserveData } from '../../../hooks/app-data-provider/useAppDataProvider';
import { GhoRange } from './DebtSwitchModalContent';
Expand Down Expand Up @@ -89,7 +89,10 @@ export const DebtSwitchModalDetails = ({
<Skeleton variant="rectangular" height={20} width={100} sx={{ borderRadius: '4px' }} />
) : (
<>
{switchSource.reserve.symbol === 'GHO' && ghoData ? (
{displayGhoForMintableMarket({
symbol: switchSource.reserve.symbol,
currentMarket,
}) && ghoData ? (
<GhoIncentivesCard
useApyRange={false}
rangeValues={ghoData.ghoApyRange}
Expand All @@ -110,7 +113,10 @@ export const DebtSwitchModalDetails = ({
<FormattedNumber value={sourceBorrowAPY} variant="secondary14" percent />
)}
{ArrowRightIcon}
{switchTarget.reserve.symbol === 'GHO' && ghoData ? (
{displayGhoForMintableMarket({
symbol: switchTarget.reserve.symbol,
currentMarket,
}) && ghoData ? (
<GhoIncentivesCard
useApyRange={ghoData.qualifiesForDiscount && !ghoData.inputAmount}
rangeValues={ghoData.inputAmount === 0 ? ghoData.ghoApyRange : switchToRange}
Expand Down

5 comments on commit 9dde336

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.