Skip to content

Commit

Permalink
fix: stable rates on market page (#1728)
Browse files Browse the repository at this point in the history
  • Loading branch information
grothem authored Aug 8, 2023
1 parent 1efc11f commit 230179d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/modules/markets/MarketAssetsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { NoData } from 'src/components/primitives/NoData';
import { ReserveSubheader } from 'src/components/ReserveSubheader';
import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext';
import { useRootStore } from 'src/store/root';
import { CustomMarket } from 'src/ui-config/marketsConfig';

import { IncentivesCard } from '../../components/incentives/IncentivesCard';
import { AMPLToolTip } from '../../components/infoTooltips/AMPLToolTip';
Expand All @@ -23,6 +24,11 @@ export const MarketAssetsListItem = ({ ...reserve }: ComputedReserveData) => {
const { currentMarket } = useProtocolDataContext();
const trackEvent = useRootStore((store) => store.trackEvent);

let showStableBorrowRate = Number(reserve.totalStableDebtUSD) > 0;
if (currentMarket === CustomMarket.proto_mainnet && reserve.symbol === 'TUSD') {
showStableBorrowRate = false;
}

return (
<ListItem
px={6}
Expand Down Expand Up @@ -102,7 +108,7 @@ export const MarketAssetsListItem = ({ ...reserve }: ComputedReserveData) => {

<ListColumn>
<IncentivesCard
value={Number(reserve.totalStableDebtUSD) > 0 ? reserve.stableBorrowAPY : '-1'}
value={showStableBorrowRate ? reserve.stableBorrowAPY : '-1'}
incentives={reserve.sIncentivesData || []}
symbol={reserve.symbol}
variant="main16"
Expand Down
8 changes: 7 additions & 1 deletion src/modules/markets/MarketAssetsListMobileItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { NoData } from 'src/components/primitives/NoData';
import { ReserveSubheader } from 'src/components/ReserveSubheader';
import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext';
import { useRootStore } from 'src/store/root';
import { CustomMarket } from 'src/ui-config/marketsConfig';
import { MARKETS } from 'src/utils/mixPanelEvents';

import { IncentivesCard } from '../../components/incentives/IncentivesCard';
Expand All @@ -19,6 +20,11 @@ export const MarketAssetsListMobileItem = ({ ...reserve }: ComputedReserveData)
const { currentMarket } = useProtocolDataContext();
const trackEvent = useRootStore((store) => store.trackEvent);

let showStableBorrowRate = Number(reserve.totalStableDebtUSD) > 0;
if (currentMarket === CustomMarket.proto_mainnet && reserve.symbol === 'TUSD') {
showStableBorrowRate = false;
}

return (
<ListMobileItemWrapper
symbol={reserve.symbol}
Expand Down Expand Up @@ -118,7 +124,7 @@ export const MarketAssetsListMobileItem = ({ ...reserve }: ComputedReserveData)
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
<IncentivesCard
align="flex-end"
value={Number(reserve.totalStableDebtUSD) > 0 ? reserve.stableBorrowAPY : '-1'}
value={showStableBorrowRate ? reserve.stableBorrowAPY : '-1'}
incentives={reserve.sIncentivesData || []}
symbol={reserve.symbol}
variant="secondary14"
Expand Down

1 comment on commit 230179d

@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.