chore(#1259): replaced market name with tradable instrument name (#1269)

* chore: replaced market name with tradable instrument name (1259)

* removed lodash import that must have added itself magically

* =aligned cypress tests with code changed

* =aligned console lite cypress mocks to the code changes

* changed cypress market info key details test

* changed cypress market info key details test

* generate markets for console lite
This commit is contained in:
Art 2022-09-07 20:37:39 +02:00 committed by GitHub
parent 9f6376c1b2
commit c83b5bf93c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
72 changed files with 325 additions and 208 deletions

View File

@ -39,7 +39,7 @@ describe('market selector', () => {
connectVegaWallet(); connectVegaWallet();
cy.get('input[placeholder="Search"]').should( cy.get('input[placeholder="Search"]').should(
'have.value', 'have.value',
markets[0].name markets[0].tradableInstrument.instrument.name
); );
cy.getByTestId('arrow-button').click(); cy.getByTestId('arrow-button').click();
cy.getByTestId('market-pane').should('be.visible'); cy.getByTestId('market-pane').should('be.visible');
@ -47,7 +47,7 @@ describe('market selector', () => {
.children() .children()
.find('[role="button"]') .find('[role="button"]')
.first() .first()
.should('contain.text', markets[0].name); .should('contain.text', markets[0].tradableInstrument.instrument.name);
cy.getByTestId('market-pane') cy.getByTestId('market-pane')
.children() .children()
.find('[role="button"]') .find('[role="button"]')
@ -69,7 +69,9 @@ describe('market selector', () => {
cy.get('input[placeholder="Search"]').clear(); cy.get('input[placeholder="Search"]').clear();
cy.get('input[placeholder="Search"]').type('aa'); cy.get('input[placeholder="Search"]').type('aa');
const filtered = markets.filter( const filtered = markets.filter(
(market) => market.state === 'STATE_ACTIVE' && market.name.match(/aa/i) (market) =>
market.state === 'STATE_ACTIVE' &&
market.tradableInstrument.instrument.name.match(/aa/i)
); );
cy.getByTestId('market-pane') cy.getByTestId('market-pane')
.children() .children()
@ -86,7 +88,7 @@ describe('market selector', () => {
); );
cy.get('input[placeholder="Search"]').should( cy.get('input[placeholder="Search"]').should(
'have.value', 'have.value',
filtered[filtered.length - 1].name filtered[filtered.length - 1].tradableInstrument.instrument.name
); );
} }
}); });
@ -129,7 +131,7 @@ describe('market selector', () => {
cy.getByTestId('dialog-close').click(); cy.getByTestId('dialog-close').click();
cy.get('input[placeholder="Search"]').should( cy.get('input[placeholder="Search"]').should(
'have.value', 'have.value',
markets[0].name markets[0].tradableInstrument.instrument.name
); );
} }
}); });

View File

@ -75,11 +75,11 @@ const protoCandles = [
export const protoMarket = { export const protoMarket = {
id: 'first-btcusd-id', id: 'first-btcusd-id',
name: 'AAVEDAI Monthly (30 Jun 2022)',
state: 'STATE_ACTIVE', state: 'STATE_ACTIVE',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'AAVEDAI.MF21', code: 'AAVEDAI.MF21',
name: 'AAVEDAI Monthly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:2839D9B2329C9E70', 'formerly:2839D9B2329C9E70',

View File

@ -2,13 +2,13 @@ export const generateDealTicket = () => {
return { return {
market: { market: {
id: 'first-btcusd-id', id: 'first-btcusd-id',
name: 'AAVEDAI Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
state: 'STATE_ACTIVE', state: 'STATE_ACTIVE',
tradingMode: 'Continuous', tradingMode: 'Continuous',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
name: 'AAVEDAI Monthly (30 Jun 2022)',
product: { product: {
quoteName: 'DAI', quoteName: 'DAI',
settlementAsset: { settlementAsset: {

View File

@ -6,11 +6,11 @@ export const generateMarketNames = () => {
{ ...protoMarket }, { ...protoMarket },
{ {
id: '1d7ddf67dac4924db03f5bf58571a7bcb1908d70c66580467717aabc5345b68a', id: '1d7ddf67dac4924db03f5bf58571a7bcb1908d70c66580467717aabc5345b68a',
name: 'Apple Monthly (30 Jun 2022)',
state: 'STATE_SUSPENDED', state: 'STATE_SUSPENDED',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'AAPL.MF21', code: 'AAPL.MF21',
name: 'Apple Monthly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:4899E01009F1A721', 'formerly:4899E01009F1A721',
@ -32,11 +32,11 @@ export const generateMarketNames = () => {
}, },
{ {
id: '87ae87cd3244fc1fab4b0e2dad2437879864192bb969f3109b69293421644c8b', id: '87ae87cd3244fc1fab4b0e2dad2437879864192bb969f3109b69293421644c8b',
name: 'Tesla Quarterly (30 Jun 2022)',
state: 'STATE_SUSPENDED', state: 'STATE_SUSPENDED',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'TSLA.QM21', code: 'TSLA.QM21',
name: 'Tesla Quarterly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:5A86B190C384997F', 'formerly:5A86B190C384997F',
@ -58,11 +58,11 @@ export const generateMarketNames = () => {
}, },
{ {
id: '69205712a854f1bbfb69fa3d11b60e01a1e249bafb5ece88115e7451e8ef07b3', id: '69205712a854f1bbfb69fa3d11b60e01a1e249bafb5ece88115e7451e8ef07b3',
name: 'BTCUSD Monthly (30 Jun 2022)',
state: 'STATE_SUSPENDED', state: 'STATE_SUSPENDED',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: 'BTCUSD Monthly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:076BB86A5AA41E3E', 'formerly:076BB86A5AA41E3E',
@ -83,11 +83,11 @@ export const generateMarketNames = () => {
}, },
{ {
id: 'ethbtc-quaterly', id: 'ethbtc-quaterly',
name: 'ETHBTC Quarterly (30 Jun 2022)',
state: 'STATE_ACTIVE', state: 'STATE_ACTIVE',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'ETHBTC.QM21', code: 'ETHBTC.QM21',
name: 'ETHBTC Quarterly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:1F0BB6EB5703B099', 'formerly:1F0BB6EB5703B099',
@ -108,11 +108,11 @@ export const generateMarketNames = () => {
}, },
{ {
id: '3c62b2714c4332d1a689a5352bff090e6aabccfd6bd87ce018936b38372530c9', id: '3c62b2714c4332d1a689a5352bff090e6aabccfd6bd87ce018936b38372530c9',
name: 'UNIDAI Monthly (30 Jun 2022)',
state: 'STATE_ACTIVE', state: 'STATE_ACTIVE',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'UNIDAI.MF21', code: 'UNIDAI.MF21',
name: 'UNIDAI Monthly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:3C58ED2A4A6C5D7E', 'formerly:3C58ED2A4A6C5D7E',

View File

@ -6,11 +6,11 @@ export const generateSimpleMarkets = () => {
{ ...protoMarket }, { ...protoMarket },
{ {
id: '57fbaa322e97cfc8bb5f1de048c37e033c41b1ac1906d3aed9960912a067ef5a', id: '57fbaa322e97cfc8bb5f1de048c37e033c41b1ac1906d3aed9960912a067ef5a',
name: 'CELUSD (June 2022)',
state: 'Active', state: 'Active',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'CELUSD', code: 'CELUSD',
name: 'CELUSD (June 2022)',
metadata: { metadata: {
tags: [ tags: [
'base:CEL', 'base:CEL',
@ -35,11 +35,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: 'ccf2f04865e5951ac3405da6e16b7cbdb535a0ad32df4df2dbed4262cf473255', id: 'ccf2f04865e5951ac3405da6e16b7cbdb535a0ad32df4df2dbed4262cf473255',
name: 'XMRUSD market',
state: 'Suspended', state: 'Suspended',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'XMRUSD', code: 'XMRUSD',
name: 'XMRUSD market',
metadata: { metadata: {
tags: [ tags: [
'base:monero', 'base:monero',
@ -64,11 +64,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '6030e5b4e0ca3297a26081e5af4d453f97f96baab2d74bf56f84efcffc4c382f', id: '6030e5b4e0ca3297a26081e5af4d453f97f96baab2d74bf56f84efcffc4c382f',
name: 'UNIDAI Monthly (30 Jun 2022)',
state: 'Active', state: 'Active',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'UNIDAI.MF21', code: 'UNIDAI.MF21',
name: 'UNIDAI Monthly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:3C58ED2A4A6C5D7E', 'formerly:3C58ED2A4A6C5D7E',
@ -167,11 +167,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: 'de74a5572045b300e8ec50d136896912ec76e7d7ec135bc305dfd4854d9363a4', id: 'de74a5572045b300e8ec50d136896912ec76e7d7ec135bc305dfd4854d9363a4',
name: 'XMRUSD market',
state: 'Pending', state: 'Pending',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'XMRUSD', code: 'XMRUSD',
name: 'XMRUSD market',
metadata: { metadata: {
tags: [ tags: [
'base:monero', 'base:monero',
@ -269,11 +269,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '31ea96284611771e486c820acb26a325a99664f9854b5a7e7ad99023efa8f9e6', id: '31ea96284611771e486c820acb26a325a99664f9854b5a7e7ad99023efa8f9e6',
name: 'ApeCoin (18 Jul 2022)',
state: 'Closed', state: 'Closed',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'APE/USD', code: 'APE/USD',
name: 'ApeCoin (18 Jul 2022)',
metadata: { metadata: {
tags: [ tags: [
'quote:USD', 'quote:USD',
@ -297,11 +297,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '34cff959cdc2ffdb0f167820d701fe8b51cc6b8588e650d93369aaa22d6f8b74', id: '34cff959cdc2ffdb0f167820d701fe8b51cc6b8588e650d93369aaa22d6f8b74',
name: 'BTCUSD Monthly (18 Jul 2022)',
state: 'Settled', state: 'Settled',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: 'BTCUSD Monthly (18 Jul 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:076BB86A5AA41E3E', 'formerly:076BB86A5AA41E3E',
@ -327,11 +327,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '87b0bbb3c171baa5d97dfc3852332829c91e5c5dc9f7c8fb584c6d8ac75aaaf2', id: '87b0bbb3c171baa5d97dfc3852332829c91e5c5dc9f7c8fb584c6d8ac75aaaf2',
name: 'Builders Club x ETHcc',
state: 'Settled', state: 'Settled',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'LTCUSD', code: 'LTCUSD',
name: 'Builders Club x ETHcc',
metadata: { metadata: {
tags: [ tags: [
'base:litecoin', 'base:litecoin',
@ -417,11 +417,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '45266143c6e9b58f4cff9b8906e971c531bb29ea7af01066973f9b77e8134823', id: '45266143c6e9b58f4cff9b8906e971c531bb29ea7af01066973f9b77e8134823',
name: 'BTCUSD Monthly (18 Jul 2022)',
state: 'Pending', state: 'Pending',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: 'BTCUSD Monthly (18 Jul 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:076BB86A5AA41E3E', 'formerly:076BB86A5AA41E3E',
@ -447,11 +447,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '65663ebdc96161162769c4d5c5508137416748178d7cb28e2cb0d07a151a2bc6', id: '65663ebdc96161162769c4d5c5508137416748178d7cb28e2cb0d07a151a2bc6',
name: 'ETHBTC Quarterly (30 Jun 2022)',
state: 'Active', state: 'Active',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'ETHBTC.QM21', code: 'ETHBTC.QM21',
name: 'ETHBTC Quarterly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:1F0BB6EB5703B099', 'formerly:1F0BB6EB5703B099',
@ -550,11 +550,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '234afabd27e3bce1a879039c041f9f00f915d98459935ddafd0169d38dd13850', id: '234afabd27e3bce1a879039c041f9f00f915d98459935ddafd0169d38dd13850',
name: 'Apple Monthly (30 Jun 2022)',
state: 'Active', state: 'Active',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'AAPL.MF21', code: 'AAPL.MF21',
name: 'Apple Monthly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:4899E01009F1A721', 'formerly:4899E01009F1A721',
@ -654,11 +654,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '9f2a3c1caa67bb0773ec18d908d32b55b129b9ec2d106a8e9a87f6aa5c0375a6', id: '9f2a3c1caa67bb0773ec18d908d32b55b129b9ec2d106a8e9a87f6aa5c0375a6',
name: 'Tesla Quarterly (30 Jun 2022)',
state: 'Active', state: 'Active',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'TSLA.QM21', code: 'TSLA.QM21',
name: 'Tesla Quarterly (30 Jun 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:5A86B190C384997F', 'formerly:5A86B190C384997F',
@ -758,11 +758,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '8a45ee934d3ddac4b036f9884df1064a5353c620a56f775ba36597d0edef9a7a', id: '8a45ee934d3ddac4b036f9884df1064a5353c620a56f775ba36597d0edef9a7a',
name: 'Go big or Go home',
state: 'Active', state: 'Active',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'LTCUSD', code: 'LTCUSD',
name: 'Go big or Go home',
metadata: { metadata: {
tags: [ tags: [
'base:litecoin', 'base:litecoin',
@ -801,11 +801,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: 'aede7b9ac0c3b225004929c5455160a00f59864aad32ec366e8a2bff1b30fd0f', id: 'aede7b9ac0c3b225004929c5455160a00f59864aad32ec366e8a2bff1b30fd0f',
name: 'BTCUSD Monthly (08 Jul 2022)',
state: 'Active', state: 'Active',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: 'BTCUSD Monthly (08 Jul 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:076BB86A5AA41E3E', 'formerly:076BB86A5AA41E3E',
@ -831,11 +831,11 @@ export const generateSimpleMarkets = () => {
}, },
{ {
id: '9398707e01daa1a1f1ca6ff87cf8d6c03fe7373ce31121ce81b99a129e6bda47', id: '9398707e01daa1a1f1ca6ff87cf8d6c03fe7373ce31121ce81b99a129e6bda47',
name: 'BTCUSD Monthly (18 Jul 2022)',
state: 'Active', state: 'Active',
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: 'BTCUSD Monthly (18 Jul 2022)',
metadata: { metadata: {
tags: [ tags: [
'formerly:076BB86A5AA41E3E', 'formerly:076BB86A5AA41E3E',
@ -866,11 +866,16 @@ export const generateSimpleMarkets = () => {
export const generateLongListMarkets = (count: number) => { export const generateLongListMarkets = (count: number) => {
const markets = []; const markets = [];
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {
const { id, name } = protoMarket;
markets.push({ markets.push({
...protoMarket, ...protoMarket,
id: id + i, id: protoMarket.id + i,
name: name + i, tradableInstrument: {
...protoMarket.tradableInstrument,
instrument: {
...protoMarket.tradableInstrument.instrument,
name: protoMarket.tradableInstrument.instrument.name + i,
},
},
}); });
} }
return { markets }; return { markets };

View File

@ -179,7 +179,7 @@ export const DealTicketSteps = ({
ItemRenderer={MarketNameRenderer} ItemRenderer={MarketNameRenderer}
/> />
), ),
value: market.name, value: market.tradableInstrument.instrument.name,
}, },
{ {
label: t('Select Direction'), label: t('Select Direction'),

View File

@ -43,6 +43,10 @@ export interface SimpleMarkets_markets_tradableInstrument_instrument {
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/ */
code: string; code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
/** /**
* Metadata for this instrument * Metadata for this instrument
*/ */
@ -79,10 +83,6 @@ export interface SimpleMarkets_markets {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* Current state of the market * Current state of the market
*/ */

View File

@ -14,11 +14,11 @@ export const MARKETS_QUERY = gql`
query SimpleMarkets($CandleSince: String!) { query SimpleMarkets($CandleSince: String!) {
markets { markets {
id id
name
state state
tradableInstrument { tradableInstrument {
instrument { instrument {
code code
name
metadata { metadata {
tags tags
} }

View File

@ -17,7 +17,9 @@ const MarketNameRenderer = ({ market, isMobile }: Props) => {
)} )}
/> />
<div className="col-span-2 uppercase justify-start text-black dark:text-white text-ui-small md:text-market self-end"> <div className="col-span-2 uppercase justify-start text-black dark:text-white text-ui-small md:text-market self-end">
{isMobile ? market.tradableInstrument.instrument.code : market.name}{' '} {isMobile
? market.tradableInstrument.instrument.code
: market.tradableInstrument.instrument.name}{' '}
<SimpleMarketExpires <SimpleMarketExpires
tags={market.tradableInstrument.instrument.metadata.tags} tags={market.tradableInstrument.instrument.metadata.tags}
/> />

View File

@ -22,7 +22,7 @@ const useColumnDefinitions = ({ isMobile }: Props) => {
headerName: t('Markets'), headerName: t('Markets'),
headerClass: 'uppercase', headerClass: 'uppercase',
minWidth: isMobile ? 160 : 350, minWidth: isMobile ? 160 : 350,
field: 'name', field: 'tradableInstrument.instrument.name',
cellClass: 'overflow-visible', cellClass: 'overflow-visible',
cellRenderer: ({ data }: { data: SimpleMarketsType }) => ( cellRenderer: ({ data }: { data: SimpleMarketsType }) => (
<MarketNameRenderer market={data} isMobile={isMobile} /> <MarketNameRenderer market={data} isMobile={isMobile} />

View File

@ -465,10 +465,6 @@ export interface MarketsQuery_markets {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* Fees related data * Fees related data
*/ */

View File

@ -11,7 +11,6 @@ const MARKETS_QUERY = gql`
query MarketsQuery { query MarketsQuery {
markets { markets {
id id
name
fees { fees {
factors { factors {
makerFee makerFee
@ -154,7 +153,9 @@ const Markets = () => {
{data?.markets {data?.markets
? data.markets.map((m) => ( ? data.markets.map((m) => (
<React.Fragment key={m.id}> <React.Fragment key={m.id}>
<SubHeading data-testid="markets-header">{m.name}</SubHeading> <SubHeading data-testid="markets-header">
{m.tradableInstrument.instrument.name}
</SubHeading>
<SyntaxHighlighter data={m} /> <SyntaxHighlighter data={m} />
</React.Fragment> </React.Fragment>
)) ))

View File

@ -1,8 +1,4 @@
import { import { MarketState, MarketTradingModeMapping } from '@vegaprotocol/types';
MarketState,
MarketStateMapping,
MarketTradingModeMapping,
} from '@vegaprotocol/types';
import { mockTradingPage } from '../support/trading'; import { mockTradingPage } from '../support/trading';
const marketInfoBtn = 'Info'; const marketInfoBtn = 'Info';
@ -52,16 +48,13 @@ describe('market info is displayed', () => {
it('key details displayed', () => { it('key details displayed', () => {
cy.getByTestId(marketTitle).contains('Key details').click(); cy.getByTestId(marketTitle).contains('Key details').click();
validateMarketDataRow(0, 'Name', 'ETHBTC Quarterly (30 Jun 2022)'); validateMarketDataRow(0, 'Name', 'BTCUSD Monthly (30 Jun 2022)');
validateMarketDataRow(1, 'Decimal Places', '2'); validateMarketDataRow(1, 'Market ID', 'market-0');
validateMarketDataRow(2, 'Position Decimal Places', '0');
validateMarketDataRow( validateMarketDataRow(
3, 2,
'Trading Mode', 'Trading Mode',
MarketTradingModeMapping.TRADING_MODE_CONTINUOUS MarketTradingModeMapping.TRADING_MODE_CONTINUOUS
); );
validateMarketDataRow(4, 'State', MarketStateMapping.STATE_ACTIVE);
validateMarketDataRow(5, 'Market ID', 'market-0');
}); });
it('instrument displayed', () => { it('instrument displayed', () => {

View File

@ -33,7 +33,7 @@ describe('accounts', () => {
cy.getByTestId('tab-accounts') cy.getByTestId('tab-accounts')
.should('be.visible') .should('be.visible')
.get(tradingAccountRowId) .get(tradingAccountRowId)
.find('[col-id="market.name"]') .find('[col-id="market.tradableInstrument.instrument.name"]')
.should('have.text', '—'); .should('have.text', '—');
cy.getByTestId('tab-accounts') cy.getByTestId('tab-accounts')

View File

@ -13,7 +13,8 @@ describe('collateral', () => {
const collateralTab = 'Collateral'; const collateralTab = 'Collateral';
const assetSymbolColumn = "[col-id='asset.symbol']"; const assetSymbolColumn = "[col-id='asset.symbol']";
const assetTypeColumn = "[col-id='type']"; const assetTypeColumn = "[col-id='type']";
const assetMarketName = "[col-id='market.name']"; const assetMarketName =
"[col-id='market.tradableInstrument.instrument.name']";
it('renders collateral', () => { it('renders collateral', () => {
connectVegaWallet(); connectVegaWallet();
cy.getByTestId(collateralTab).click(); cy.getByTestId(collateralTab).click();

View File

@ -22,7 +22,11 @@ const fills = [
infrastructureFee: '5000', infrastructureFee: '5000',
}, },
market: { market: {
tradableInstrument: {
instrument: {
name: 'Apples Daily v3', name: 'Apples Daily v3',
},
},
positionDecimalPlaces: 2, positionDecimalPlaces: 2,
}, },
}), }),
@ -37,8 +41,12 @@ const fills = [
id: '3', id: '3',
aggressor: Side.SIDE_SELL, aggressor: Side.SIDE_SELL,
market: { market: {
tradableInstrument: {
instrument: {
name: 'ETHBTC Quarterly (30 Jun 2022)', name: 'ETHBTC Quarterly (30 Jun 2022)',
}, },
},
},
buyer: { buyer: {
id: Cypress.env('VEGA_PUBLIC_KEY'), id: Cypress.env('VEGA_PUBLIC_KEY'),
}, },
@ -90,7 +98,9 @@ describe('fills', () => {
cy.getByTestId('tab-fills').should('be.visible'); cy.getByTestId('tab-fills').should('be.visible');
cy.getByTestId('tab-fills') cy.getByTestId('tab-fills')
.get('[role="gridcell"][col-id="market.name"]') .get(
'[role="gridcell"][col-id="market.tradableInstrument.instrument.name"]'
)
.each(($marketSymbol) => { .each(($marketSymbol) => {
cy.wrap($marketSymbol).invoke('text').should('not.be.empty'); cy.wrap($marketSymbol).invoke('text').should('not.be.empty');
}); });

View File

@ -29,7 +29,13 @@ export const generateAccounts = (
balance: '100000000', balance: '100000000',
market: { market: {
id: '0604e8c918655474525e1a95367902266ade70d318c2c908f0cca6e3d11dcb13', id: '0604e8c918655474525e1a95367902266ade70d318c2c908f0cca6e3d11dcb13',
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
__typename: 'Instrument',
name: 'AAVEDAI Monthly (30 Jun 2022)', name: 'AAVEDAI Monthly (30 Jun 2022)',
},
},
__typename: 'Market', __typename: 'Market',
}, },
asset: { asset: {
@ -45,7 +51,13 @@ export const generateAccounts = (
balance: '1000', balance: '1000',
market: { market: {
__typename: 'Market', __typename: 'Market',
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
__typename: 'Instrument',
name: '', name: '',
},
},
id: '5a4b0b9e9c0629f0315ec56fcb7bd444b0c6e4da5ec7677719d502626658a376', id: '5a4b0b9e9c0629f0315ec56fcb7bd444b0c6e4da5ec7677719d502626658a376',
}, },
asset: { asset: {
@ -61,7 +73,13 @@ export const generateAccounts = (
balance: '1000', balance: '1000',
market: { market: {
__typename: 'Market', __typename: 'Market',
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
__typename: 'Instrument',
name: '', name: '',
},
},
id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d', id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d',
}, },
asset: { asset: {

View File

@ -10,7 +10,6 @@ export const generateDealTicketQuery = (
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'market-0', id: 'market-0',
name: 'ETHBTC Quarterly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
state: MarketState.STATE_ACTIVE, state: MarketState.STATE_ACTIVE,
@ -18,8 +17,9 @@ export const generateDealTicketQuery = (
tradableInstrument: { tradableInstrument: {
__typename: 'TradableInstrument', __typename: 'TradableInstrument',
instrument: { instrument: {
id: 'tBTC TEST',
__typename: 'Instrument', __typename: 'Instrument',
id: 'tBTC TEST',
name: 'ETHBTC Quarterly (30 Jun 2022)',
product: { product: {
__typename: 'Future', __typename: 'Future',
quoteName: 'BTC', quoteName: 'BTC',

View File

@ -23,7 +23,11 @@ export const generateFills = (override?: PartialDeep<Fills>): Fills => {
infrastructureFee: '5000', infrastructureFee: '5000',
}, },
market: { market: {
tradableInstrument: {
instrument: {
name: 'Apples Daily v3', name: 'Apples Daily v3',
},
},
positionDecimalPlaces: 2, positionDecimalPlaces: 2,
}, },
}), }),
@ -38,8 +42,12 @@ export const generateFills = (override?: PartialDeep<Fills>): Fills => {
id: '3', id: '3',
aggressor: Side.SIDE_SELL, aggressor: Side.SIDE_SELL,
market: { market: {
tradableInstrument: {
instrument: {
name: 'ETHBTC Quarterly (30 Jun 2022)', name: 'ETHBTC Quarterly (30 Jun 2022)',
}, },
},
},
buyer: { buyer: {
id: Cypress.env('VEGA_PUBLIC_KEY'), id: Cypress.env('VEGA_PUBLIC_KEY'),
}, },
@ -108,7 +116,6 @@ export const generateFill = (
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'market-id', id: 'market-id',
name: 'UNIDAI Monthly (30 Jun 2022)',
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
decimalPlaces: 5, decimalPlaces: 5,
tradableInstrument: { tradableInstrument: {
@ -117,6 +124,7 @@ export const generateFill = (
__typename: 'Instrument', __typename: 'Instrument',
id: 'instrument-id', id: 'instrument-id',
code: 'instrument-code', code: 'instrument-code',
name: 'UNIDAI Monthly (30 Jun 2022)',
product: { product: {
__typename: 'Future', __typename: 'Future',
settlementAsset: { settlementAsset: {

View File

@ -15,7 +15,6 @@ export const generateMarketInfoQuery = (
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'market-0', id: 'market-0',
name: 'ETHBTC Quarterly (30 Jun 2022)',
decimalPlaces: 2, decimalPlaces: 2,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
state: MarketState.STATE_ACTIVE, state: MarketState.STATE_ACTIVE,

View File

@ -12,7 +12,6 @@ export const generateMarket = (override?: PartialDeep<Market>): Market => {
const defaultResult: Market = { const defaultResult: Market = {
market: { market: {
id: 'market-0', id: 'market-0',
name: 'ACTIVE MARKET',
tradingMode: MarketTradingMode.TRADING_MODE_MONITORING_AUCTION, tradingMode: MarketTradingMode.TRADING_MODE_MONITORING_AUCTION,
state: MarketState.STATE_ACTIVE, state: MarketState.STATE_ACTIVE,
decimalPlaces: 5, decimalPlaces: 5,
@ -39,7 +38,7 @@ export const generateMarket = (override?: PartialDeep<Market>): Market => {
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
id: 'BTCUSD.MF21', id: 'BTCUSD.MF21',
name: 'BTCUSD Monthly', name: 'ACTIVE MARKET',
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
metadata: { metadata: {
tags: [ tags: [

View File

@ -13,7 +13,6 @@ export const generateMarkets = (
const markets: MarketList_markets[] = [ const markets: MarketList_markets[] = [
{ {
id: 'market-0', id: 'market-0',
name: 'ACTIVE MARKET',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
@ -59,7 +58,7 @@ export const generateMarkets = (
instrument: { instrument: {
id: '', id: '',
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: '', name: 'ACTIVE MARKET',
metadata: { metadata: {
__typename: 'InstrumentMetadata', __typename: 'InstrumentMetadata',
tags: [], tags: [],
@ -79,7 +78,6 @@ export const generateMarkets = (
}, },
{ {
id: 'market-1', id: 'market-1',
name: 'SUSPENDED MARKET',
decimalPlaces: 2, decimalPlaces: 2,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
@ -124,7 +122,7 @@ export const generateMarkets = (
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
id: 'SOLUSD', id: 'SOLUSD',
name: 'SOL/USD', name: 'SUSPENDED MARKET',
code: 'SOLUSD', code: 'SOLUSD',
metadata: { metadata: {
__typename: 'InstrumentMetadata', __typename: 'InstrumentMetadata',
@ -145,7 +143,6 @@ export const generateMarkets = (
}, },
{ {
id: 'market-2', id: 'market-2',
name: 'Apple Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradingMode: MarketTradingMode.TRADING_MODE_MONITORING_AUCTION, tradingMode: MarketTradingMode.TRADING_MODE_MONITORING_AUCTION,
@ -211,7 +208,6 @@ export const generateMarkets = (
}, },
{ {
id: 'market-3', id: 'market-3',
name: 'ETHBTC Quarterly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,

View File

@ -19,7 +19,6 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d', id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d',
name: 'AAVEDAI Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
@ -28,6 +27,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
id: '', id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'AAVEDAI.MF21', code: 'AAVEDAI.MF21',
name: 'AAVEDAI Monthly (30 Jun 2022)',
}, },
}, },
}, },
@ -49,7 +49,6 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
market: { market: {
__typename: 'Market', __typename: 'Market',
id: '5a4b0b9e9c0629f0315ec56fcb7bd444b0c6e4da5ec7677719d502626658a376', id: '5a4b0b9e9c0629f0315ec56fcb7bd444b0c6e4da5ec7677719d502626658a376',
name: 'Tesla Quarterly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
@ -58,6 +57,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
id: '', id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'TSLA.QM21', code: 'TSLA.QM21',
name: 'Tesla Quarterly (30 Jun 2022)',
}, },
}, },
}, },
@ -79,7 +79,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'c6f4337b31ed57a961969c3ba10297b369d01b9e75a4cbb96db4fc62886444e6', id: 'c6f4337b31ed57a961969c3ba10297b369d01b9e75a4cbb96db4fc62886444e6',
name: 'BTCUSD Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
@ -88,6 +88,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
id: '', id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: 'BTCUSD Monthly (30 Jun 2022)',
}, },
}, },
}, },
@ -109,7 +110,6 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'a316fa51dab97d76a1472c2f22906f4e461728e04355096788165d5b13999ed5', id: 'a316fa51dab97d76a1472c2f22906f4e461728e04355096788165d5b13999ed5',
name: 'UNIDAI Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
@ -118,6 +118,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
id: '', id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'UNIDAI.MF21', code: 'UNIDAI.MF21',
name: 'UNIDAI Monthly (30 Jun 2022)',
}, },
}, },
}, },
@ -139,7 +140,6 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'a316fa51dab97d76a1472c2f22906f4e461728e04355096788165d5b13999ed5', id: 'a316fa51dab97d76a1472c2f22906f4e461728e04355096788165d5b13999ed5',
name: 'UNIDAI Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
@ -148,6 +148,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
id: '', id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'UNIDAI.MF21', code: 'UNIDAI.MF21',
name: 'UNIDAI Monthly (30 Jun 2022)',
}, },
}, },
}, },

View File

@ -42,7 +42,6 @@ export const generatePositions = (
}, },
market: { market: {
id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d', id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d',
name: 'UNIDAI Monthly (30 Jun 2022)',
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
data: { data: {
markPrice: '17588787', markPrice: '17588787',
@ -96,7 +95,6 @@ export const generatePositions = (
}, },
market: { market: {
id: '0604e8c918655474525e1a95367902266ade70d318c2c908f0cca6e3d11dcb13', id: '0604e8c918655474525e1a95367902266ade70d318c2c908f0cca6e3d11dcb13',
name: 'AAVEDAI Monthly (30 Jun 2022)',
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
data: { data: {
markPrice: '8649338', markPrice: '8649338',
@ -149,7 +147,6 @@ export const generatePositions = (
}, },
market: { market: {
id: '5a4b0b9e9c0629f0315ec56fcb7bd444b0c6e4da5ec7677719d502626658a376', id: '5a4b0b9e9c0629f0315ec56fcb7bd444b0c6e4da5ec7677719d502626658a376',
name: 'Tesla Quarterly (30 Jun 2022)',
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
data: { data: {
markPrice: '84377569', markPrice: '84377569',

View File

@ -22,7 +22,11 @@ export const mockTradingPage = (
'Market', 'Market',
generateMarket({ generateMarket({
market: { market: {
tradableInstrument: {
instrument: {
name: `${state.toUpperCase()} MARKET`, name: `${state.toUpperCase()} MARKET`,
},
},
state: state, state: state,
}, },
}) })

View File

@ -16,7 +16,6 @@ const MARKET_QUERY = gql`
query Market($marketId: ID!, $interval: Interval!, $since: String!) { query Market($marketId: ID!, $interval: Interval!, $since: String!) {
market(id: $marketId) { market(id: $marketId) {
id id
name
tradingMode tradingMode
state state
decimalPlaces decimalPlaces

View File

@ -187,10 +187,6 @@ export interface Market_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* Current mode of execution of the market * Current mode of execution of the market
*/ */

View File

@ -141,7 +141,10 @@ export const TradeMarketHeader = ({ market }: TradeMarketHeaderProps) => {
<header className="w-screen xl:px-4 pt-4 border-b border-neutral-300 dark:border-neutral-700"> <header className="w-screen xl:px-4 pt-4 border-b border-neutral-300 dark:border-neutral-700">
<div className="xl:flex xl:gap-4 items-start"> <div className="xl:flex xl:gap-4 items-start">
<div className="px-4 mb-2 xl:mb-0"> <div className="px-4 mb-2 xl:mb-0">
<SelectMarketPopover marketName={market.name} onSelect={onSelect} /> <SelectMarketPopover
marketName={market.tradableInstrument.instrument.name}
onSelect={onSelect}
/>
</div> </div>
<div <div
data-testid="market-summary" data-testid="market-summary"

View File

@ -9,6 +9,22 @@ import { AccountType } from "@vegaprotocol/types";
// GraphQL fragment: AccountFields // GraphQL fragment: AccountFields
// ==================================================== // ====================================================
export interface AccountFields_market_tradableInstrument_instrument {
__typename: "Instrument";
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
}
export interface AccountFields_market_tradableInstrument {
__typename: "TradableInstrument";
/**
* An instance of, or reference to, a fully specified instrument.
*/
instrument: AccountFields_market_tradableInstrument_instrument;
}
export interface AccountFields_market { export interface AccountFields_market {
__typename: "Market"; __typename: "Market";
/** /**
@ -16,9 +32,9 @@ export interface AccountFields_market {
*/ */
id: string; id: string;
/** /**
* Market full name * An instance of, or reference to, a tradable instrument.
*/ */
name: string; tradableInstrument: AccountFields_market_tradableInstrument;
} }
export interface AccountFields_asset { export interface AccountFields_asset {

View File

@ -9,6 +9,22 @@ import { AccountType } from "@vegaprotocol/types";
// GraphQL subscription operation: AccountSubscribe // GraphQL subscription operation: AccountSubscribe
// ==================================================== // ====================================================
export interface AccountSubscribe_accounts_market_tradableInstrument_instrument {
__typename: "Instrument";
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
}
export interface AccountSubscribe_accounts_market_tradableInstrument {
__typename: "TradableInstrument";
/**
* An instance of, or reference to, a fully specified instrument.
*/
instrument: AccountSubscribe_accounts_market_tradableInstrument_instrument;
}
export interface AccountSubscribe_accounts_market { export interface AccountSubscribe_accounts_market {
__typename: "Market"; __typename: "Market";
/** /**
@ -16,9 +32,9 @@ export interface AccountSubscribe_accounts_market {
*/ */
id: string; id: string;
/** /**
* Market full name * An instance of, or reference to, a tradable instrument.
*/ */
name: string; tradableInstrument: AccountSubscribe_accounts_market_tradableInstrument;
} }
export interface AccountSubscribe_accounts_asset { export interface AccountSubscribe_accounts_asset {

View File

@ -9,6 +9,22 @@ import { AccountType } from "@vegaprotocol/types";
// GraphQL query operation: Accounts // GraphQL query operation: Accounts
// ==================================================== // ====================================================
export interface Accounts_party_accounts_market_tradableInstrument_instrument {
__typename: "Instrument";
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
}
export interface Accounts_party_accounts_market_tradableInstrument {
__typename: "TradableInstrument";
/**
* An instance of, or reference to, a fully specified instrument.
*/
instrument: Accounts_party_accounts_market_tradableInstrument_instrument;
}
export interface Accounts_party_accounts_market { export interface Accounts_party_accounts_market {
__typename: "Market"; __typename: "Market";
/** /**
@ -16,9 +32,9 @@ export interface Accounts_party_accounts_market {
*/ */
id: string; id: string;
/** /**
* Market full name * An instance of, or reference to, a tradable instrument.
*/ */
name: string; tradableInstrument: Accounts_party_accounts_market_tradableInstrument;
} }
export interface Accounts_party_accounts_asset { export interface Accounts_party_accounts_asset {

View File

@ -17,8 +17,12 @@ const ACCOUNTS_FRAGMENT = gql`
balance balance
market { market {
id id
tradableInstrument {
instrument {
name name
} }
}
}
asset { asset {
id id
symbol symbol

View File

@ -9,7 +9,13 @@ const singleRow: Accounts_party_accounts = {
balance: '125600000', balance: '125600000',
market: { market: {
__typename: 'Market', __typename: 'Market',
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
__typename: 'Instrument',
name: 'BTCUSD Monthly (30 Jun 2022)', name: 'BTCUSD Monthly (30 Jun 2022)',
},
},
id: '10cd0a793ad2887b340940337fa6d97a212e0e517fe8e9eab2b5ef3a38633f35', id: '10cd0a793ad2887b340940337fa6d97a212e0e517fe8e9eab2b5ef3a38633f35',
}, },
asset: { asset: {

View File

@ -151,7 +151,7 @@ export const AccountsTable = forwardRef<AgGridReact, AccountsTableProps>(
/> />
<AgGridColumn <AgGridColumn
headerName={t('Market')} headerName={t('Market')}
field="market.name" field="market.tradableInstrument.instrument.name"
valueFormatter="value || '—'" valueFormatter="value || '—'"
/> />
<AgGridColumn <AgGridColumn

View File

@ -9,6 +9,7 @@ query DealTicketQuery($marketId: ID!) {
tradableInstrument { tradableInstrument {
instrument { instrument {
id id
name
product { product {
... on Future { ... on Future {
quoteName quoteName

View File

@ -1,7 +1,6 @@
query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) {
market(id: $marketId) { market(id: $marketId) {
id id
name
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
state state

View File

@ -1,11 +1,11 @@
query MarketNames { query MarketNames {
markets { markets {
id id
name
state state
tradableInstrument { tradableInstrument {
instrument { instrument {
code code
name
metadata { metadata {
tags tags
} }

View File

@ -8,7 +8,7 @@ export type DealTicketQueryQueryVariables = Types.Exact<{
}>; }>;
export type DealTicketQueryQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, name: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string } } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } } | null }; export type DealTicketQueryQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, name: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string } } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } } | null };
export const DealTicketQueryDocument = gql` export const DealTicketQueryDocument = gql`
@ -23,6 +23,7 @@ export const DealTicketQueryDocument = gql`
tradableInstrument { tradableInstrument {
instrument { instrument {
id id
name
product { product {
... on Future { ... on Future {
quoteName quoteName

View File

@ -10,14 +10,13 @@ export type MarketInfoQueryQueryVariables = Types.Exact<{
}>; }>;
export type MarketInfoQueryQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, name: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', id: string } }> | null, fees: { __typename?: 'Fees', factors: { __typename?: 'FeeFactors', makerFee: string, infrastructureFee: string, liquidityFee: string } }, priceMonitoringSettings: { __typename?: 'PriceMonitoringSettings', parameters?: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null } | null }, riskFactors?: { __typename?: 'RiskFactor', market: string, short: string, long: string } | null, data?: { __typename?: 'MarketData', markPrice: string, indicativeVolume: string, bestBidVolume: string, bestOfferVolume: string, bestStaticBidVolume: string, bestStaticOfferVolume: string, openInterest: string, bestBidPrice: string, bestOfferPrice: string, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string }, priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string, trigger: { __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number } }> | null } | null, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', triggeringRatio: number, targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } }, candles?: Array<{ __typename?: 'Candle', volume: string } | null> | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string }, oracleSpecForSettlementPrice: { __typename?: 'OracleSpec', id: string }, oracleSpecForTradingTermination: { __typename?: 'OracleSpec', id: string }, oracleSpecBinding: { __typename?: 'OracleSpecToFutureBinding', settlementPriceProperty: string, tradingTerminationProperty: string } } }, riskModel: { __typename?: 'LogNormalRiskModel', tau: number, riskAversionParameter: number, params: { __typename?: 'LogNormalModelParams', r: number, sigma: number, mu: number } } | { __typename?: 'SimpleRiskModel', params: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } } | null }; export type MarketInfoQueryQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', id: string } }> | null, fees: { __typename?: 'Fees', factors: { __typename?: 'FeeFactors', makerFee: string, infrastructureFee: string, liquidityFee: string } }, priceMonitoringSettings: { __typename?: 'PriceMonitoringSettings', parameters?: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null } | null }, riskFactors?: { __typename?: 'RiskFactor', market: string, short: string, long: string } | null, data?: { __typename?: 'MarketData', markPrice: string, indicativeVolume: string, bestBidVolume: string, bestOfferVolume: string, bestStaticBidVolume: string, bestStaticOfferVolume: string, openInterest: string, bestBidPrice: string, bestOfferPrice: string, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string }, priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string, trigger: { __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number } }> | null } | null, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', triggeringRatio: number, targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } }, candles?: Array<{ __typename?: 'Candle', volume: string } | null> | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string }, oracleSpecForSettlementPrice: { __typename?: 'OracleSpec', id: string }, oracleSpecForTradingTermination: { __typename?: 'OracleSpec', id: string }, oracleSpecBinding: { __typename?: 'OracleSpecToFutureBinding', settlementPriceProperty: string, tradingTerminationProperty: string } } }, riskModel: { __typename?: 'LogNormalRiskModel', tau: number, riskAversionParameter: number, params: { __typename?: 'LogNormalModelParams', r: number, sigma: number, mu: number } } | { __typename?: 'SimpleRiskModel', params: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } } | null };
export const MarketInfoQueryDocument = gql` export const MarketInfoQueryDocument = gql`
query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) {
market(id: $marketId) { market(id: $marketId) {
id id
name
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
state state

View File

@ -6,18 +6,18 @@ const defaultOptions = {} as const;
export type MarketNamesQueryVariables = Types.Exact<{ [key: string]: never; }>; export type MarketNamesQueryVariables = Types.Exact<{ [key: string]: never; }>;
export type MarketNamesQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, name: string, state: Types.MarketState, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string } } } }> | null }; export type MarketNamesQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, state: Types.MarketState, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', code: string, name: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string } } } }> | null };
export const MarketNamesDocument = gql` export const MarketNamesDocument = gql`
query MarketNames { query MarketNames {
markets { markets {
id id
name
state state
tradableInstrument { tradableInstrument {
instrument { instrument {
code code
name
metadata { metadata {
tags tags
} }

View File

@ -43,6 +43,10 @@ export interface DealTicketQuery_market_tradableInstrument_instrument {
* Uniquely identify an instrument across all instruments available on Vega (string) * Uniquely identify an instrument across all instruments available on Vega (string)
*/ */
id: string; id: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
/** /**
* A reference to or instance of a fully specified product, including all required product parameters for that product (Product union) * A reference to or instance of a fully specified product, including all required product parameters for that product (Product union)
*/ */
@ -79,10 +83,6 @@ export interface DealTicketQuery_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -31,6 +31,10 @@ export interface MarketNames_markets_tradableInstrument_instrument {
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/ */
code: string; code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
/** /**
* Metadata for this instrument * Metadata for this instrument
*/ */
@ -55,10 +59,6 @@ export interface MarketNames_markets {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* Current state of the market * Current state of the market
*/ */

View File

@ -8,7 +8,6 @@ const DEAL_TICKET_QUERY = gql`
query DealTicketQuery($marketId: ID!) { query DealTicketQuery($marketId: ID!) {
market(id: $marketId) { market(id: $marketId) {
id id
name
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
state state
@ -16,6 +15,7 @@ const DEAL_TICKET_QUERY = gql`
tradableInstrument { tradableInstrument {
instrument { instrument {
id id
name
product { product {
... on Future { ... on Future {
quoteName quoteName

View File

@ -33,11 +33,11 @@ export const MARKET_NAMES_QUERY = gql`
query MarketNames { query MarketNames {
markets { markets {
id id
name
state state
tradableInstrument { tradableInstrument {
instrument { instrument {
code code
name
metadata { metadata {
tags tags
} }
@ -70,7 +70,9 @@ export const MarketSelector = ({ market, setMarket, ItemRenderer }: Props) => {
const [skip, setSkip] = useState(true); const [skip, setSkip] = useState(true);
const [results, setResults] = useState<MarketNames_markets[]>([]); const [results, setResults] = useState<MarketNames_markets[]>([]);
const [showPane, setShowPane] = useState(false); const [showPane, setShowPane] = useState(false);
const [lookup, setLookup] = useState(market.name || ''); const [lookup, setLookup] = useState(
market.tradableInstrument.instrument.name || ''
);
const [dialogContent, setDialogContent] = useState<React.ReactNode | null>( const [dialogContent, setDialogContent] = useState<React.ReactNode | null>(
null null
); );
@ -102,10 +104,13 @@ export const MarketSelector = ({ market, setMarket, ItemRenderer }: Props) => {
); );
const handleMarketSelect = useCallback( const handleMarketSelect = useCallback(
({ id, name }: { id: string; name: string }) => { (market: {
setLookup(name); id: string;
tradableInstrument: { instrument: { name: string } };
}) => {
setLookup(market.tradableInstrument.instrument.name);
setShowPane(false); setShowPane(false);
setMarket(id); setMarket(market.id);
inputRef.current?.focus(); inputRef.current?.focus();
}, },
[setLookup, setShowPane, setMarket, inputRef] [setLookup, setShowPane, setMarket, inputRef]
@ -142,7 +147,7 @@ export const MarketSelector = ({ market, setMarket, ItemRenderer }: Props) => {
break; break;
default: default:
setShowPane(false); setShowPane(false);
setLookup(market.name); setLookup(market.tradableInstrument.instrument.name);
} }
}, },
[results, handleMarketSelect] [results, handleMarketSelect]
@ -159,7 +164,7 @@ export const MarketSelector = ({ market, setMarket, ItemRenderer }: Props) => {
const handleOnBlur = useCallback(() => { const handleOnBlur = useCallback(() => {
if (!lookup && !showPane) { if (!lookup && !showPane) {
setLookup(market.name); setLookup(market.tradableInstrument.instrument.name);
} }
}, [market, lookup, showPane, setLookup]); }, [market, lookup, showPane, setLookup]);
@ -173,11 +178,17 @@ export const MarketSelector = ({ market, setMarket, ItemRenderer }: Props) => {
(isOpen: boolean) => { (isOpen: boolean) => {
setShowPane(isOpen); setShowPane(isOpen);
if (!isOpen) { if (!isOpen) {
setLookup(lookup || market.name); setLookup(lookup || market.tradableInstrument.instrument.name);
inputRef.current?.focus(); inputRef.current?.focus();
} }
}, },
[setShowPane, lookup, setLookup, market.name, inputRef] [
setShowPane,
lookup,
setLookup,
market.tradableInstrument.instrument.name,
inputRef,
]
); );
const selectorContent = useMemo(() => { const selectorContent = useMemo(() => {
@ -235,7 +246,11 @@ export const MarketSelector = ({ market, setMarket, ItemRenderer }: Props) => {
onClick={() => handleMarketSelect(market)} onClick={() => handleMarketSelect(market)}
onKeyDown={(e) => handleItemKeyDown(e, market, i)} onKeyDown={(e) => handleItemKeyDown(e, market, i)}
> >
{ItemRenderer ? <ItemRenderer market={market} /> : market.name} {ItemRenderer ? (
<ItemRenderer market={market} />
) : (
market.tradableInstrument.instrument.name
)}
</div> </div>
))} ))}
</div> </div>
@ -262,7 +277,9 @@ export const MarketSelector = ({ market, setMarket, ItemRenderer }: Props) => {
data?.markets?.filter( data?.markets?.filter(
(item: MarketNames_markets) => (item: MarketNames_markets) =>
item.state === MarketState.STATE_ACTIVE && item.state === MarketState.STATE_ACTIVE &&
item.name.match(new RegExp(escapeRegExp(lookup), 'i')) item.tradableInstrument.instrument.name.match(
new RegExp(escapeRegExp(lookup), 'i')
)
) || [] ) || []
); );
}, [data, lookup]); }, [data, lookup]);

View File

@ -459,10 +459,6 @@ export interface MarketInfoQuery_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -4,7 +4,6 @@ export const MARKET_INFO_QUERY = gql`
query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) {
market(id: $marketId) { market(id: $marketId) {
id id
name
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
state state

View File

@ -155,13 +155,7 @@ export const Info = ({ market }: InfoProps) => {
]; ];
const { VEGA_EXPLORER_URL } = useEnvironment(); const { VEGA_EXPLORER_URL } = useEnvironment();
const keyDetails = { const keyDetails = {
...pick( ...pick(market, 'decimalPlaces', 'positionDecimalPlaces', 'tradingMode'),
market,
'name',
'decimalPlaces',
'positionDecimalPlaces',
'tradingMode'
),
state: MarketStateMapping[market.state], state: MarketStateMapping[market.state],
}; };
const marketSpecPanels = [ const marketSpecPanels = [
@ -170,7 +164,7 @@ export const Info = ({ market }: InfoProps) => {
content: ( content: (
<MarketInfoTable <MarketInfoTable
data={{ data={{
...keyDetails, name: market.tradableInstrument.instrument.name,
marketID: market.id, marketID: market.id,
tradingMode: tradingMode:
keyDetails.tradingMode && keyDetails.tradingMode &&

View File

@ -91,6 +91,10 @@ export interface FillFields_market_tradableInstrument_instrument {
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/ */
code: string; code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
/** /**
* A reference to or instance of a fully specified product, including all required product parameters for that product (Product union) * A reference to or instance of a fully specified product, including all required product parameters for that product (Product union)
*/ */
@ -111,10 +115,6 @@ export interface FillFields_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -91,6 +91,10 @@ export interface Fills_party_tradesConnection_edges_node_market_tradableInstrume
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/ */
code: string; code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
/** /**
* A reference to or instance of a fully specified product, including all required product parameters for that product (Product union) * A reference to or instance of a fully specified product, including all required product parameters for that product (Product union)
*/ */
@ -111,10 +115,6 @@ export interface Fills_party_tradesConnection_edges_node_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -91,6 +91,10 @@ export interface FillsSub_trades_market_tradableInstrument_instrument {
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/ */
code: string; code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
/** /**
* A reference to or instance of a fully specified product, including all required product parameters for that product (Product union) * A reference to or instance of a fully specified product, including all required product parameters for that product (Product union)
*/ */
@ -111,10 +115,6 @@ export interface FillsSub_trades_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -41,13 +41,13 @@ const FILL_FRAGMENT = gql`
} }
market { market {
id id
name
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
tradableInstrument { tradableInstrument {
instrument { instrument {
id id
code code
name
product { product {
... on Future { ... on Future {
settlementAsset { settlementAsset {

View File

@ -28,11 +28,11 @@ describe('FillsTable', () => {
price: '100', price: '100',
size: '300000', size: '300000',
market: { market: {
name: 'test market',
decimalPlaces: 2, decimalPlaces: 2,
positionDecimalPlaces: 5, positionDecimalPlaces: 5,
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
name: 'test market',
product: { product: {
settlementAsset: { settlementAsset: {
decimals: 2, decimals: 2,
@ -87,7 +87,7 @@ describe('FillsTable', () => {
const cells = screen.getAllByRole('gridcell'); const cells = screen.getAllByRole('gridcell');
const expectedValues = [ const expectedValues = [
buyerFill.market.name, buyerFill.market.tradableInstrument.instrument.name,
'+3.00000', '+3.00000',
'1.00 BTC', '1.00 BTC',
'3.00 BTC', '3.00 BTC',
@ -124,7 +124,7 @@ describe('FillsTable', () => {
const cells = screen.getAllByRole('gridcell'); const cells = screen.getAllByRole('gridcell');
const expectedValues = [ const expectedValues = [
buyerFill.market.name, buyerFill.market.tradableInstrument.instrument.name,
'+3.00000', '+3.00000',
'1.00 BTC', '1.00 BTC',
'3.00 BTC', '3.00 BTC',
@ -161,7 +161,7 @@ describe('FillsTable', () => {
const cells = screen.getAllByRole('gridcell'); const cells = screen.getAllByRole('gridcell');
const expectedValues = [ const expectedValues = [
buyerFill.market.name, buyerFill.market.tradableInstrument.instrument.name,
'-3.00000', '-3.00000',
'1.00 BTC', '1.00 BTC',
'3.00 BTC', '3.00 BTC',

View File

@ -44,7 +44,10 @@ export const FillsTable = forwardRef<AgGridReact, Props>(
getRowId={({ data }) => data?.id} getRowId={({ data }) => data?.id}
{...props} {...props}
> >
<AgGridColumn headerName={t('Market')} field="market.name" /> <AgGridColumn
headerName={t('Market')}
field="market.tradableInstrument.instrument.name"
/>
<AgGridColumn <AgGridColumn
headerName={t('Size')} headerName={t('Size')}
type="rightAligned" type="rightAligned"

View File

@ -23,7 +23,11 @@ export const generateFills = (override?: PartialDeep<Fills>): Fills => {
infrastructureFee: '5000', infrastructureFee: '5000',
}, },
market: { market: {
tradableInstrument: {
instrument: {
name: 'Apples Daily v3', name: 'Apples Daily v3',
},
},
positionDecimalPlaces: 2, positionDecimalPlaces: 2,
}, },
}), }),
@ -38,8 +42,12 @@ export const generateFills = (override?: PartialDeep<Fills>): Fills => {
id: '3', id: '3',
aggressor: Side.SIDE_SELL, aggressor: Side.SIDE_SELL,
market: { market: {
tradableInstrument: {
instrument: {
name: 'ETHBTC Quarterly (30 Jun 2022)', name: 'ETHBTC Quarterly (30 Jun 2022)',
}, },
},
},
buyer: { buyer: {
id: 'party-id', id: 'party-id',
}, },
@ -108,7 +116,6 @@ export const generateFill = (
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'market-id', id: 'market-id',
name: 'UNIDAI Monthly (30 Jun 2022)',
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
decimalPlaces: 5, decimalPlaces: 5,
tradableInstrument: { tradableInstrument: {
@ -117,6 +124,7 @@ export const generateFill = (
__typename: 'Instrument', __typename: 'Instrument',
id: 'instrument-id', id: 'instrument-id',
code: 'instrument-code', code: 'instrument-code',
name: 'UNIDAI Monthly (30 Jun 2022)',
product: { product: {
__typename: 'Future', __typename: 'Future',
settlementAsset: { settlementAsset: {

View File

@ -171,10 +171,6 @@ export interface MarketList_markets {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -315,7 +315,7 @@ export const columns = (
dataTestId: 'taker-fee', dataTestId: 'taker-fee',
}, },
{ {
value: market.name, value: market.tradableInstrument.instrument.name,
className: `${cellClassNames} hidden xxl:block`, className: `${cellClassNames} hidden xxl:block`,
onlyOnDetailed: true, onlyOnDetailed: true,
dataTestId: 'market-name', dataTestId: 'market-name',

View File

@ -46,7 +46,6 @@ export const MARKET_LIST_QUERY = gql`
query MarketList($interval: Interval!, $since: String!) { query MarketList($interval: Interval!, $since: String!) {
markets { markets {
id id
name
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
state state

View File

@ -17,7 +17,6 @@ export const generateOrder = (
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'market-id', id: 'market-id',
name: 'market-name',
decimalPlaces: 2, decimalPlaces: 2,
positionDecimalPlaces: 2, positionDecimalPlaces: 2,
tradableInstrument: { tradableInstrument: {
@ -26,6 +25,7 @@ export const generateOrder = (
id: 'instrument-id', id: 'instrument-id',
__typename: 'Instrument', __typename: 'Instrument',
code: 'instrument-code', code: 'instrument-code',
name: 'instrument-market-name',
}, },
}, },
}, },
@ -67,7 +67,6 @@ export const generateMockOrders =
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d', id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d',
name: 'AAVEDAI Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
@ -75,6 +74,7 @@ export const generateMockOrders =
instrument: { instrument: {
__typename: 'Instrument', __typename: 'Instrument',
code: 'AAVEDAI.MF21', code: 'AAVEDAI.MF21',
name: 'AAVEDAI Monthly (30 Jun 2022)',
}, },
}, },
}, },
@ -92,7 +92,6 @@ export const generateMockOrders =
market: { market: {
__typename: 'Market', __typename: 'Market',
id: '5a4b0b9e9c0629f0315ec56fcb7bd444b0c6e4da5ec7677719d502626658a376', id: '5a4b0b9e9c0629f0315ec56fcb7bd444b0c6e4da5ec7677719d502626658a376',
name: 'Tesla Quarterly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
@ -100,6 +99,7 @@ export const generateMockOrders =
instrument: { instrument: {
__typename: 'Instrument', __typename: 'Instrument',
code: 'TSLA.QM21', code: 'TSLA.QM21',
name: 'Tesla Quarterly (30 Jun 2022)',
}, },
}, },
}, },
@ -117,7 +117,6 @@ export const generateMockOrders =
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'c6f4337b31ed57a961969c3ba10297b369d01b9e75a4cbb96db4fc62886444e6', id: 'c6f4337b31ed57a961969c3ba10297b369d01b9e75a4cbb96db4fc62886444e6',
name: 'BTCUSD Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
@ -125,6 +124,7 @@ export const generateMockOrders =
instrument: { instrument: {
__typename: 'Instrument', __typename: 'Instrument',
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: 'BTCUSD Monthly (30 Jun 2022)',
}, },
}, },
}, },

View File

@ -19,6 +19,10 @@ export interface OrderFields_market_tradableInstrument_instrument {
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/ */
code: string; code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
} }
export interface OrderFields_market_tradableInstrument { export interface OrderFields_market_tradableInstrument {
@ -35,10 +39,6 @@ export interface OrderFields_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -19,6 +19,10 @@ export interface OrderSub_orders_market_tradableInstrument_instrument {
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/ */
code: string; code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
} }
export interface OrderSub_orders_market_tradableInstrument { export interface OrderSub_orders_market_tradableInstrument {
@ -35,10 +39,6 @@ export interface OrderSub_orders_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -19,6 +19,10 @@ export interface Orders_party_ordersConnection_edges_node_market_tradableInstrum
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/ */
code: string; code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
} }
export interface Orders_party_ordersConnection_edges_node_market_tradableInstrument { export interface Orders_party_ordersConnection_edges_node_market_tradableInstrument {
@ -35,10 +39,6 @@ export interface Orders_party_ordersConnection_edges_node_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -19,13 +19,13 @@ const ORDER_FRAGMENT = gql`
id id
market { market {
id id
name
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
tradableInstrument { tradableInstrument {
instrument { instrument {
id id
code code
name
} }
} }
} }

View File

@ -74,7 +74,7 @@ describe('OrderFeedback', () => {
); );
expect(screen.getByText('Market').nextElementSibling).toHaveTextContent( expect(screen.getByText('Market').nextElementSibling).toHaveTextContent(
// eslint-disable-next-line // eslint-disable-next-line
order.market!.name order.market!.tradableInstrument.instrument.name
); );
expect(screen.getByText('Status').nextElementSibling).toHaveTextContent( expect(screen.getByText('Status').nextElementSibling).toHaveTextContent(
OrderStatusMapping[order.status] OrderStatusMapping[order.status]

View File

@ -29,7 +29,7 @@ export const OrderFeedback = ({ transaction, order }: OrderFeedbackProps) => {
{order.market && ( {order.market && (
<div> <div>
<p className={labelClass}>{t(`Market`)}</p> <p className={labelClass}>{t(`Market`)}</p>
<p>{t(`${order.market.name}`)}</p> <p>{t(`${order.market.tradableInstrument.instrument.name}`)}</p>
</div> </div>
)} )}
<div> <div>

View File

@ -53,7 +53,7 @@ export const OrderEditDialog = ({
{order.market && ( {order.market && (
<div> <div>
<p className={headerClassName}>{t(`Market`)}</p> <p className={headerClassName}>{t(`Market`)}</p>
<p>{t(`${order.market.name}`)}</p> <p>{t(`${order.market.tradableInstrument.instrument.name}`)}</p>
</div> </div>
)} )}
{order.type === OrderType.TYPE_LIMIT && order.market && ( {order.type === OrderType.TYPE_LIMIT && order.market && (

View File

@ -13,6 +13,22 @@ export interface OrderEvent_busEvents_event_TimeUpdate {
__typename: "TimeUpdate" | "MarketEvent" | "TransferResponses" | "PositionResolution" | "Trade" | "Account" | "Party" | "MarginLevels" | "Proposal" | "Vote" | "MarketData" | "NodeSignature" | "LossSocialization" | "SettlePosition" | "Market" | "Asset" | "MarketTick" | "SettleDistressed" | "AuctionEvent" | "RiskFactor" | "Deposit" | "Withdrawal" | "OracleSpec" | "LiquidityProvision"; __typename: "TimeUpdate" | "MarketEvent" | "TransferResponses" | "PositionResolution" | "Trade" | "Account" | "Party" | "MarginLevels" | "Proposal" | "Vote" | "MarketData" | "NodeSignature" | "LossSocialization" | "SettlePosition" | "Market" | "Asset" | "MarketTick" | "SettleDistressed" | "AuctionEvent" | "RiskFactor" | "Deposit" | "Withdrawal" | "OracleSpec" | "LiquidityProvision";
} }
export interface OrderEvent_busEvents_event_Order_market_tradableInstrument_instrument {
__typename: "Instrument";
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
}
export interface OrderEvent_busEvents_event_Order_market_tradableInstrument {
__typename: "TradableInstrument";
/**
* An instance of, or reference to, a fully specified instrument.
*/
instrument: OrderEvent_busEvents_event_Order_market_tradableInstrument_instrument;
}
export interface OrderEvent_busEvents_event_Order_market { export interface OrderEvent_busEvents_event_Order_market {
__typename: "Market"; __typename: "Market";
/** /**
@ -20,9 +36,9 @@ export interface OrderEvent_busEvents_event_Order_market {
*/ */
id: string; id: string;
/** /**
* Market full name * An instance of, or reference to, a tradable instrument.
*/ */
name: string; tradableInstrument: OrderEvent_busEvents_event_Order_market_tradableInstrument;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -18,7 +18,11 @@ export const ORDER_EVENT_SUB = gql`
side side
market { market {
id id
tradableInstrument {
instrument {
name name
}
}
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
} }

View File

@ -109,10 +109,6 @@ export interface PositionFields_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -109,10 +109,6 @@ export interface Positions_party_positionsConnection_edges_node_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -109,10 +109,6 @@ export interface PositionsSubscription_positions_market {
* Market ID * Market ID
*/ */
id: string; id: string;
/**
* Market full name
*/
name: string;
/** /**
* decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct * decimalPlaces indicates the number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64) * number denominated in the currency of the market. (uint64)

View File

@ -32,8 +32,14 @@ const accounts: Accounts = {
balance: '33353727', balance: '33353727',
market: { market: {
__typename: 'Market', __typename: 'Market',
name: 'AAVEDAI Monthly (30 Jun 2022)',
id: '5e6035fe6a6df78c9ec44b333c231e63d357acef0a0620d2c243f5865d1dc0d8', id: '5e6035fe6a6df78c9ec44b333c231e63d357acef0a0620d2c243f5865d1dc0d8',
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
__typename: 'Instrument',
name: 'AAVEDAI Monthly (30 Jun 2022)',
},
},
}, },
}, },
{ {
@ -48,8 +54,14 @@ const accounts: Accounts = {
balance: '3274050', balance: '3274050',
market: { market: {
__typename: 'Market', __typename: 'Market',
name: 'UNIDAI Monthly (30 Jun 2022)',
id: '10c4b1114d2f6fda239b73d018bca55888b6018f0ac70029972a17fea0a6a56e', id: '10c4b1114d2f6fda239b73d018bca55888b6018f0ac70029972a17fea0a6a56e',
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
__typename: 'Instrument',
name: 'UNIDAI Monthly (30 Jun 2022)',
},
},
}, },
}, },
], ],
@ -97,7 +109,6 @@ const data: Positions = {
}, },
market: { market: {
__typename: 'Market', __typename: 'Market',
name: 'AAVEDAI Monthly (30 Jun 2022)',
id: '5e6035fe6a6df78c9ec44b333c231e63d357acef0a0620d2c243f5865d1dc0d8', id: '5e6035fe6a6df78c9ec44b333c231e63d357acef0a0620d2c243f5865d1dc0d8',
decimalPlaces: 5, decimalPlaces: 5,
tradingMode: MarketTradingMode.TRADING_MODE_MONITORING_AUCTION, tradingMode: MarketTradingMode.TRADING_MODE_MONITORING_AUCTION,
@ -155,7 +166,6 @@ const data: Positions = {
market: { market: {
__typename: 'Market', __typename: 'Market',
id: '10c4b1114d2f6fda239b73d018bca55888b6018f0ac70029972a17fea0a6a56e', id: '10c4b1114d2f6fda239b73d018bca55888b6018f0ac70029972a17fea0a6a56e',
name: 'UNIDAI Monthly (30 Jun 2022)',
decimalPlaces: 5, decimalPlaces: 5,
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,

View File

@ -72,7 +72,6 @@ const POSITION_FIELDS = gql`
} }
market { market {
id id
name
decimalPlaces decimalPlaces
positionDecimalPlaces positionDecimalPlaces
tradingMode tradingMode
@ -202,7 +201,7 @@ export const getMetrics = (
) && generalAccountBalance.isLessThan(marginInitial.minus(marginSearch)); ) && generalAccountBalance.isLessThan(marginInitial.minus(marginSearch));
metrics.push({ metrics.push({
marketName: market.name, marketName: market.tradableInstrument.instrument.name,
averageEntryPrice: position.node.averageEntryPrice, averageEntryPrice: position.node.averageEntryPrice,
capitalUtilisation: Math.round(capitalUtilisation.toNumber()), capitalUtilisation: Math.round(capitalUtilisation.toNumber()),
currentLeverage: currentLeverage.toNumber(), currentLeverage: currentLeverage.toNumber(),