From fb8af99388adba5cf707f5b075467889296f926c Mon Sep 17 00:00:00 2001 From: sebipap Date: Tue, 19 Mar 2024 17:05:53 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20AssetHeader:=20get=20maxUtilizat?= =?UTF-8?q?ion=20from=20Previewer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/asset/Header.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/asset/Header.tsx b/components/asset/Header.tsx index edbb66ef7..2893ea7ac 100644 --- a/components/asset/Header.tsx +++ b/components/asset/Header.tsx @@ -151,6 +151,11 @@ const AssetHeaderInfo: FC = ({ symbol }) => { [push, query, symbol], ); + const maxUtilization = useMemo(() => { + if (!marketAccount) return; + return Number(WEI_PER_ETHER - marketAccount.reserveFactor) / 1e18; + }, [marketAccount]); + return ( <> = ({ symbol }) => { ))} - {totalUtilization && totalUtilization > 0.9 && ( + {totalUtilization && maxUtilization && totalUtilization > maxUtilization && ( {t( - "The Global Utilization is above 90%, and the remaining liquidity is established as a Liquidity Reserve that can't be borrowed and is only available for withdrawals.", + "The Global Utilization is above {{maxUtilization}}, and the remaining liquidity is established as a Liquidity Reserve that can't be borrowed and is only available for withdrawals.", + { + maxUtilization: toPercentage(maxUtilization, 0), + }, )}