Skip to content

Commit b0bae0b

Browse files
committed
fix: changed logic and add guard to show apys for borrow and supply
1 parent c7f5220 commit b0bae0b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/modules/reserve-overview/BorrowInfo.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export const BorrowInfo = ({
5959
});
6060

6161
const borrowProtocolIncentives = mapAaveProtocolIncentives(reserve.incentives, 'borrow');
62+
const apyValue = Number(reserve.borrowInfo?.apy.value);
63+
6264
return (
6365
<Box sx={{ flexGrow: 1, minWidth: 0, maxWidth: '100%', width: '100%' }}>
6466
<Box
@@ -183,11 +185,7 @@ export const BorrowInfo = ({
183185
}
184186
>
185187
<IncentivesCard
186-
value={
187-
Number(reserve.borrowInfo?.total.amount.value) > 0
188-
? String(reserve.borrowInfo?.apy.value)
189-
: '-1'
190-
}
188+
value={Number.isFinite(apyValue) ? apyValue : '-1'}
191189
incentives={borrowProtocolIncentives}
192190
address={reserve.vToken.address}
193191
symbol={reserve.underlyingToken.symbol}

src/modules/reserve-overview/SupplyInfo.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const SupplyInfo = ({
4242
debtCeiling,
4343
}: SupplyInfoProps) => {
4444
const supplyProtocolIncentives = mapAaveProtocolIncentives(reserve.incentives, 'supply');
45+
const apyValue = Number(reserve.supplyInfo?.apy.value);
4546
return (
4647
<Box sx={{ flexGrow: 1, minWidth: 0, maxWidth: '100%', width: '100%' }}>
4748
<Box
@@ -155,7 +156,7 @@ export const SupplyInfo = ({
155156
)}
156157
<PanelItem title={<Trans>APY</Trans>}>
157158
<IncentivesCard
158-
value={reserve.supplyInfo.apy.value}
159+
value={Number.isFinite(apyValue) ? apyValue : '-1'}
159160
incentives={supplyProtocolIncentives}
160161
address={reserve.aToken.address}
161162
symbol={reserve.underlyingToken.symbol}

0 commit comments

Comments
 (0)