From 382d5eb356d105b08f95e281c6e82e8010b35898 Mon Sep 17 00:00:00 2001 From: franm Date: Wed, 17 Apr 2024 16:29:57 -0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20borrow-apr:=20use=20borrow?= =?UTF-8?q?=20apr=20from=20account-data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/asset/FloatingPool/FloatingPoolInfo/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/asset/FloatingPool/FloatingPoolInfo/index.tsx b/components/asset/FloatingPool/FloatingPoolInfo/index.tsx index 4a34499ac..8f5f3e499 100644 --- a/components/asset/FloatingPool/FloatingPoolInfo/index.tsx +++ b/components/asset/FloatingPool/FloatingPoolInfo/index.tsx @@ -21,15 +21,17 @@ type FloatingPoolInfoProps = { const FloatingPoolInfo: FC = ({ symbol }) => { const { t } = useTranslation(); - const { depositAPR, borrowAPR } = useFloatingPoolAPR(symbol); + const { depositAPR } = useFloatingPoolAPR(symbol); const { marketAccount } = useAccountData(symbol); const { rates } = useRewards(); - const { deposited, borrowed } = useMemo(() => { + const { deposited, borrowed, borrowAPR } = useMemo(() => { if (!marketAccount) return {}; + const { totalFloatingDepositAssets: totalDeposited, totalFloatingBorrowAssets: totalBorrowed, + floatingBorrowRate, decimals, usdPrice, } = marketAccount; @@ -37,6 +39,7 @@ const FloatingPoolInfo: FC = ({ symbol }) => { return { deposited: Number((totalDeposited * usdPrice) / WAD) / 10 ** decimals, borrowed: Number((totalBorrowed * usdPrice) / WAD) / 10 ** decimals, + borrowAPR: floatingBorrowRate, }; }, [marketAccount]); @@ -74,7 +77,7 @@ const FloatingPoolInfo: FC = ({ symbol }) => { label: t('Borrow APR'), value: borrowAPR !== undefined && marketAccount?.assetSymbol ? ( - + ) : undefined, tooltipTitle: t( 'The borrowing interest APR related to the current utilization rate in the Variable Rate Pool.',