fix: add back risk factors (#1397)

* fix: #1302 add back risk factors

* fix:  omit __typename is default

* fix: add risk factors in generate-market-info-query.ts
This commit is contained in:
m.ray 2022-09-21 16:31:11 +01:00 committed by GitHub
parent c59aa19bd2
commit 832327c918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 0 deletions

View File

@ -86,6 +86,13 @@ describe('market info is displayed', () => {
validateMarketDataRow(4, 'Sector', 'crypto');
});
it('risk factors displayed', () => {
cy.getByTestId(marketTitle).contains('Risk factors').click();
validateMarketDataRow(0, 'Short', '0.008571790367285281');
validateMarketDataRow(1, 'Long', '0.008508132993273576');
});
it('risk model displayed', () => {
cy.getByTestId(marketTitle).contains('Risk model').click();

View File

@ -71,6 +71,13 @@ export const generateMarketInfoQuery = (
],
},
},
riskFactors: {
__typename: 'RiskFactor',
market:
'54b78c1b877e106842ae156332ccec740ad98d6bad43143ac6a029501dd7c6e0',
short: '0.008571790367285281',
long: '0.008508132993273576',
},
data: {
__typename: 'MarketData',
market: {

View File

@ -119,6 +119,22 @@ export interface MarketInfoQuery_market_priceMonitoringSettings {
parameters: MarketInfoQuery_market_priceMonitoringSettings_parameters | null;
}
export interface MarketInfoQuery_market_riskFactors {
__typename: "RiskFactor";
/**
* Market the risk factor was emitted for
*/
market: string;
/**
* Short factor
*/
short: string;
/**
* Long factor
*/
long: string;
}
export interface MarketInfoQuery_market_data_market {
__typename: "Market";
/**
@ -504,6 +520,10 @@ export interface MarketInfoQuery_market {
* Price monitoring settings for the market
*/
priceMonitoringSettings: MarketInfoQuery_market_priceMonitoringSettings;
/**
* Risk factors for the market
*/
riskFactors: MarketInfoQuery_market_riskFactors | null;
/**
* marketData for the given market
*/

View File

@ -39,6 +39,11 @@ export const MARKET_INFO_QUERY = gql`
}
}
}
riskFactors {
market
short
long
}
data {
market {
id

View File

@ -232,6 +232,16 @@ export const Info = ({ market, onSelect }: InfoProps) => {
/>
),
},
{
title: t('Risk factors'),
content: (
<MarketInfoTable
data={market.riskFactors}
unformatted={true}
omits={['market']}
/>
),
},
{
title: t('Risk model'),
content: (