+
+
+ {t('Market ID')}
+
+
+
+
+
+
+ parentData={
+ parentMarket && {
+ name: parentMarket?.tradableInstrument?.instrument?.name,
+ parentMarketID: grandparentMarketIdData?.market?.parentMarketID,
+ insurancePoolFraction:
+ parentSuccessorProposalDetails?.proposal?.terms.change
+ .__typename === 'NewMarket' &&
+ parentSuccessorProposalDetails.proposal.terms.change
+ .successorConfiguration?.insurancePoolFraction,
+ status:
+ parentMarket?.state && MarketStateMapping[parentMarket.state],
+ tradingMode:
+ parentMarket?.tradingMode &&
+ MarketTradingModeMapping[
+ parentMarket.tradingMode as MarketTradingMode
+ ],
+ marketDecimalPlaces: parentMarket?.decimalPlaces,
+ positionDecimalPlaces: parentMarket?.positionDecimalPlaces,
+ settlementAssetDecimalPlaces: assetDecimals,
+ }
+ }
+ />
+ >
);
};
@@ -432,8 +453,8 @@ export const SettlementAssetInfoPanel = ({ market }: MarketInfoProps) => {
asset={asset}
inline={true}
noBorder={true}
- dtClassName="text-black dark:text-white text-ui !px-0 !font-normal"
- ddClassName="text-black dark:text-white text-ui !px-0 !font-normal max-w-full"
+ dtClassName="text-black dark:text-white text-ui !px-0 text-xs"
+ ddClassName="text-black dark:text-white text-ui !px-0 max-w-full text-xs"
/>
{t(
@@ -505,18 +526,53 @@ export const RiskModelInfoPanel = ({
}
return (
-
+ <>
+
+
+ >
);
};
-export const RiskParametersInfoPanel = ({
+export const MarginScalingFactorsPanel = ({
market,
parentMarket,
}: MarketInfoProps) => {
+ const data = {
+ linearSlippageFactor: market.linearSlippageFactor,
+ quadraticSlippageFactor: market.quadraticSlippageFactor,
+ searchLevel:
+ market.tradableInstrument.marginCalculator?.scalingFactors.searchLevel,
+ initialMargin:
+ market.tradableInstrument.marginCalculator?.scalingFactors.initialMargin,
+ collateralRelease:
+ market.tradableInstrument.marginCalculator?.scalingFactors
+ .collateralRelease,
+ };
+
+ const parentData = parentMarket
+ ? {
+ linearSlippageFactor: parentMarket?.linearSlippageFactor,
+ quadraticSlippageFactor: parentMarket?.quadraticSlippageFactor,
+ searchLevel:
+ parentMarket?.tradableInstrument.marginCalculator?.scalingFactors
+ .searchLevel,
+ initialMargin:
+ parentMarket?.tradableInstrument.marginCalculator?.scalingFactors
+ .initialMargin,
+ collateralRelease:
+ parentMarket?.tradableInstrument.marginCalculator?.scalingFactors
+ .collateralRelease,
+ }
+ : undefined;
+
+ return ;
+};
+
+const RiskParametersInfoPanel = ({ market, parentMarket }: MarketInfoProps) => {
const marketType = market.tradableInstrument.riskModel.__typename;
let data, parentData;
@@ -562,27 +618,66 @@ export const RiskFactorsInfoPanel = ({
market,
parentMarket,
}: MarketInfoProps) => {
- if (!market.riskFactors) {
- return null;
- }
+ const getLeverageFactors = (market: MarketInfo) => {
+ if (!market.riskFactors) {
+ return undefined;
+ }
- const { short, long } = market.riskFactors;
+ const { short, long } = market.riskFactors;
- let parentData;
+ const maxLeverageLong = new BigNumber(1).dividedBy(
+ new BigNumber(market.linearSlippageFactor).plus(long)
+ );
- if (parentMarket?.riskFactors) {
- const parentShort = parentMarket.riskFactors.short;
- const parentLong = parentMarket.riskFactors.long;
- parentData = { short: parentShort, long: parentLong };
- }
+ const maxLeverageShort = new BigNumber(1).dividedBy(
+ new BigNumber(market.linearSlippageFactor).plus(short)
+ );
- return (
-
- );
+ const maxInitialLeverageLong = !market.tradableInstrument.marginCalculator
+ ? undefined
+ : new BigNumber(1)
+ .dividedBy(
+ market.tradableInstrument.marginCalculator.scalingFactors
+ .initialMargin
+ )
+ .times(maxLeverageLong);
+
+ const maxInitialLeverageShort = !market.tradableInstrument.marginCalculator
+ ? undefined
+ : new BigNumber(1)
+ .dividedBy(
+ market.tradableInstrument.marginCalculator.scalingFactors
+ .initialMargin
+ )
+ .times(maxLeverageShort);
+
+ const formatValue = (number: BigNumber | string | undefined) => {
+ if (!number) return undefined;
+ const value = new BigNumber(number);
+ if (value.gte(10)) {
+ return value.toFixed(3);
+ } else {
+ return value.toFixed(5);
+ }
+ };
+
+ const data = {
+ long: formatValue(long),
+ short: formatValue(short),
+ maxLeverageLong: formatValue(maxLeverageLong),
+ maxLeverageShort: formatValue(maxLeverageShort),
+ maxInitialLeverageLong: formatValue(maxInitialLeverageLong),
+ maxInitialLeverageShort: formatValue(maxInitialLeverageShort),
+ };
+ return data;
+ };
+
+ const data = getLeverageFactors(market);
+ const parentData = parentMarket
+ ? getLeverageFactors(parentMarket)
+ : undefined;
+
+ return ;
};
export const PriceMonitoringBoundsInfoPanel = ({
diff --git a/libs/markets/src/lib/components/market-info/market-info.mock.ts b/libs/markets/src/lib/components/market-info/market-info.mock.ts
index 163039b8c..6032acbec 100644
--- a/libs/markets/src/lib/components/market-info/market-info.mock.ts
+++ b/libs/markets/src/lib/components/market-info/market-info.mock.ts
@@ -23,6 +23,8 @@ export const marketInfoQuery = (
description: '',
},
},
+ linearSlippageFactor: '0.01',
+ quadraticSlippageFactor: '0.0001',
marketTimestamps: {
__typename: 'MarketTimestamps',
open: '2022-11-15T02:15:24.543614154Z',
diff --git a/libs/ui-toolkit/src/components/key-value-table/key-value-table.tsx b/libs/ui-toolkit/src/components/key-value-table/key-value-table.tsx
index c46a3183d..89b6de740 100644
--- a/libs/ui-toolkit/src/components/key-value-table/key-value-table.tsx
+++ b/libs/ui-toolkit/src/components/key-value-table/key-value-table.tsx
@@ -74,9 +74,13 @@ export const KeyValueTableRow = ({
{ 'flex-row items-center': inline },
className
);
- const dtClassNames = `break-words ${dtClassName}`;
+ const dtClassNames = classNames(
+ 'break-words',
+ dtClassName,
+ 'text-neutral-500 dark:text-neutral-300'
+ );
const ddClassNames = classNames(
- 'break-words text-neutral-500 dark:text-neutral-300',
+ 'break-words',
{
'font-mono': numerical,
},
diff --git a/specs/6002-MDET-market-details.md b/specs/6002-MDET-market-details.md
index 53cde7abf..64311f8ad 100644
--- a/specs/6002-MDET-market-details.md
+++ b/specs/6002-MDET-market-details.md
@@ -90,12 +90,22 @@ When I look into market info I **Must** see following specification:
- Risk model: (6002-MDET-209)
- Tau
- Risk Aversion Parameter
-- Risk parameters: (6002-MDET-210)
+ - R
- Sigma
+- Margin scaling factors (6002-MDET-210)
+ - Linear Slippage Factor
+ - Quadratic Slippage Factor
+ - Search Level
+ - Initial Margin
+ - Collateral Release
- Risk factors: (6002-MDET-211)
- - Short
- Long
-- price monitoring bounds (multiple bounds possible): (6002-MDET-212)
+ - Short
+ - Max Leverage Long
+ - Max Leverage Short
+ - Max Initial Leverage Long
+ - Max Initial Leverage Short
+- Price monitoring bounds (multiple bounds possible): (6002-MDET-212)
- Highest Price
- Lowest Price
- Liquidity monitoring parameters: (6002-MDET-213)