feat(#2239): add decimal places in key details in market info (#2268)

This commit is contained in:
m.ray 2022-11-30 09:44:51 -05:00 committed by GitHub
parent 7c8a54b35a
commit d823daeea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -55,6 +55,9 @@ describe('market info is displayed', { tags: '@smoke' }, () => {
'Trading Mode', 'Trading Mode',
MarketTradingModeMapping.TRADING_MODE_CONTINUOUS MarketTradingModeMapping.TRADING_MODE_CONTINUOUS
); );
validateMarketDataRow(3, 'Market Decimal Places', '5');
validateMarketDataRow(4, 'Position Decimal Places', '0');
validateMarketDataRow(5, 'Settlement Asset Decimal Places', '5');
}); });
it('instrument displayed', () => { it('instrument displayed', () => {

View File

@ -197,6 +197,11 @@ export const Info = ({ market, onSelect }: InfoProps) => {
tradingMode: tradingMode:
keyDetails.tradingMode && keyDetails.tradingMode &&
MarketTradingModeMapping[keyDetails.tradingMode], MarketTradingModeMapping[keyDetails.tradingMode],
marketDecimalPlaces: market.decimalPlaces,
positionDecimalPlaces: market.positionDecimalPlaces,
settlementAssetDecimalPlaces:
market.tradableInstrument.instrument.product.settlementAsset
.decimals,
}} }}
/> />
), ),

View File

@ -34,7 +34,7 @@ export const tooltipMapping: Record<string, ReactNode> = {
bestStaticOfferVolume: t( bestStaticOfferVolume: t(
'The aggregated volume being offered at the best static offer price on the market.' 'The aggregated volume being offered at the best static offer price on the market.'
), ),
marketDecimalPlaces: t('The smallest price increment on the book.'),
decimalPlaces: t('The smallest price increment on the book.'), decimalPlaces: t('The smallest price increment on the book.'),
positionDecimalPlaces: t( positionDecimalPlaces: t(
'How big the smallest order / position on the market can be.' 'How big the smallest order / position on the market can be.'