diff --git a/apps/lend/src/components/DetailsMarket/components/MarketParameters.tsx b/apps/lend/src/components/DetailsMarket/components/MarketParameters.tsx index be46b5af6..891d00436 100644 --- a/apps/lend/src/components/DetailsMarket/components/MarketParameters.tsx +++ b/apps/lend/src/components/DetailsMarket/components/MarketParameters.tsx @@ -8,6 +8,7 @@ import { SubTitle } from '@/components/DetailsMarket/styles' import Box from '@/ui/Box' import Chip from '@/ui/Typography/Chip' import DetailInfo from '@/ui/DetailInfo' +import Icon from '@/ui/Icon' const MarketParameters = ({ rChainId, @@ -18,6 +19,7 @@ const MarketParameters = ({ rOwmId: string type: 'borrow' | 'supply' }) => { + const isAdvanceMode = useStore((state) => state.isAdvanceMode) const owmData = useStore((state) => state.markets.owmDatasMapper[rChainId]?.[rOwmId]) const loanPricesResp = useStore((state) => state.markets.pricesMapper[rChainId]?.[rOwmId]) const parametersResp = useStore((state) => state.markets.statsParametersMapper[rChainId]?.[rOwmId]) @@ -29,7 +31,7 @@ const MarketParameters = ({ const { pricePerShare, error: pricePerShareError } = vaultPricePerShareResp ?? {} // prettier-ignore - const marketDetails: { label: string; value: string | number | undefined; formatOptions?: NumberFormatOptions; title?: string; isError: string; isRow?: boolean }[][] = type === 'borrow' ? + const marketDetails: { label: string; value: string | number | undefined; formatOptions?: NumberFormatOptions; title?: string; isError: string; isRow?: boolean, isAdvance?: boolean; tooltip?: string }[][] = type === 'borrow' ? [ [ { label: t`AMM swap fee`, value: parameters?.fee, formatOptions: { ...FORMAT_OPTIONS.PERCENT, maximumSignificantDigits: 3 }, isError: parametersError }, @@ -37,6 +39,7 @@ const MarketParameters = ({ { label: t`A`, value: parameters?.A, formatOptions: { useGrouping: false }, isError: parametersError }, { label: t`Loan discount`, value: parameters?.loan_discount, formatOptions: { ...FORMAT_OPTIONS.PERCENT, maximumSignificantDigits: 2 }, isError: parametersError }, { label: t`Liquidation discount`, value: parameters?.liquidation_discount, formatOptions: { ...FORMAT_OPTIONS.PERCENT, maximumSignificantDigits: 2 }, isError: parametersError }, + { label: t`Max LTV`, value: _getMaxLTV( parameters?.A, parameters?.loan_discount), formatOptions: { ...FORMAT_OPTIONS.PERCENT, maximumSignificantDigits: 2 }, isError: parametersError, isAdvance: true, tooltip: t`Max possible loan at N=4` }, ], [ { label: t`Base price`, value: prices?.basePrice, formatOptions: { showAllFractionDigits: true }, title: t`Prices`, isError: pricesError }, @@ -59,24 +62,32 @@ const MarketParameters = ({ const isError = (idx === 0 && !!parametersError) || (idx === 1 && pricesError) return (