feat: 1506 add risk parameters (#1510)

* feat: #1506 add risk parameters

* fix: integration test

* fix: integration test
This commit is contained in:
m.ray 2022-09-27 23:49:34 +01:00 committed by GitHub
parent 414b8ced13
commit 6a6779ee72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 17 deletions

View File

@ -87,13 +87,6 @@ describe('market info is displayed', { tags: '@smoke' }, () => {
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();
@ -102,6 +95,21 @@ describe('market info is displayed', { tags: '@smoke' }, () => {
validateMarketDataRow(2, 'Risk Aversion Parameter', '0.01');
});
it('risk parameters displayed', () => {
cy.getByTestId(marketTitle).contains('Risk parameters').click();
validateMarketDataRow(0, 'Typename', 'LogNormalModelParams');
validateMarketDataRow(1, 'R', '0.016');
validateMarketDataRow(2, 'Sigma', '0.3');
});
it('risk factors displayed', () => {
cy.getByTestId(marketTitle).contains('Risk factors').click();
validateMarketDataRow(0, 'Short', '0.008571790367285281');
validateMarketDataRow(1, 'Long', '0.008508132993273576');
});
it('price monitoring trigger displayed', () => {
cy.getByTestId(marketTitle).contains('Price monitoring trigger 1').click();

View File

@ -230,16 +230,6 @@ export const Info = ({ market, onSelect }: InfoProps) => {
/>
),
},
{
title: t('Risk factors'),
content: (
<MarketInfoTable
data={market.riskFactors}
unformatted={true}
omits={['market', '__typename']}
/>
),
},
{
title: t('Risk model'),
content: (
@ -250,6 +240,26 @@ export const Info = ({ market, onSelect }: InfoProps) => {
/>
),
},
{
title: t('Risk parameters'),
content: (
<MarketInfoTable
data={market.tradableInstrument.riskModel.params}
unformatted={true}
omits={[]}
/>
),
},
{
title: t('Risk factors'),
content: (
<MarketInfoTable
data={market.riskFactors}
unformatted={true}
omits={['market', '__typename']}
/>
),
},
...(market.priceMonitoringSettings?.parameters?.triggers || []).map(
(trigger, i) => ({
title: t(`Price monitoring trigger ${i + 1}`),