Skip to content

Commit

Permalink
feat: fixed gho debt swap apy display when gho is a normal reserve in…
Browse files Browse the repository at this point in the history
…stead of minted
  • Loading branch information
JoaquinBattilana committed Aug 2, 2024
1 parent 0adfc82 commit 00f1b63
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

0 comments on commit 00f1b63

Please sign in to comment.