diff --git a/apps/trading/client-pages/market/market-header-stats.tsx b/apps/trading/client-pages/market/market-header-stats.tsx index ed9c29ce1..7906f6801 100644 --- a/apps/trading/client-pages/market/market-header-stats.tsx +++ b/apps/trading/client-pages/market/market-header-stats.tsx @@ -86,6 +86,7 @@ export const MarketHeaderStats = ({ market }: MarketHeaderStatsProps) => { {market.tradableInstrument.instrument.product.__typename === 'Future' && ( { const [market, setMarket] = useState(); const { params } = useNetworkParams([ @@ -79,11 +81,12 @@ export const MarketLiquiditySupplied = ({ }); const supplied = market?.suppliedStake - ? addDecimalsFormatNumber( + ? addDecimalsFormatNumberQuantum( new BigNumber(market?.suppliedStake) .multipliedBy(stakeToCcyVolume || 1) .toString(), - assetDecimals + assetDecimals, + quantum ) : '-'; @@ -108,9 +111,10 @@ export const MarketLiquiditySupplied = ({ {t('Supplied stake')} {market?.suppliedStake - ? addDecimalsFormatNumber( - new BigNumber(market?.suppliedStake).toString(), - assetDecimals + ? addDecimalsFormatNumberQuantum( + market?.suppliedStake, + assetDecimals, + quantum ) : '-'} @@ -119,9 +123,10 @@ export const MarketLiquiditySupplied = ({ {t('Target stake')} {market?.targetStake - ? addDecimalsFormatNumber( - new BigNumber(market?.targetStake).toString(), - assetDecimals + ? addDecimalsFormatNumberQuantum( + market?.targetStake, + assetDecimals, + quantum ) : '-'} diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-stop-order.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-stop-order.tsx index 8984b64fc..32c9ec957 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-stop-order.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-stop-order.tsx @@ -43,7 +43,7 @@ import { REDUCE_ONLY_TOOLTIP, stopSubmit, getNotionalSize, - getAssetUnit, + getBaseQuoteUnit, } from './deal-ticket'; import { TypeToggle } from './type-selector'; import { @@ -854,7 +854,7 @@ export const StopOrder = ({ market, marketPrice, submit }: StopOrderProps) => { }, [watch, market.id, updateStoredFormValues]); const quoteName = getQuoteName(market); - const assetUnit = getAssetUnit( + const assetUnit = getBaseQuoteUnit( market.tradableInstrument.instrument.metadata.tags ); diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx index bac4e87e9..0a71485d4 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx @@ -127,7 +127,7 @@ const getDefaultValues = ( ...storedValues, }); -export const getAssetUnit = (tags?: string[] | null) => +export const getBaseQuoteUnit = (tags?: string[] | null) => tags ?.find((tag) => tag.startsWith('base:') || tag.startsWith('ticker:')) ?.replace(/^[^:]*:/, ''); @@ -273,9 +273,7 @@ export const DealTicket = ({ const assetSymbol = getAsset(market).symbol; - const assetUnit = getAssetUnit( - market.tradableInstrument.instrument.metadata.tags - ); + const assetUnit = getQuoteName(market); const summaryError = useMemo(() => { if (!pubKey) {