diff --git a/apps/trading-e2e/src/integration/market-info.cy.ts b/apps/trading-e2e/src/integration/market-info.cy.ts index 7be267338..0c85ab859 100644 --- a/apps/trading-e2e/src/integration/market-info.cy.ts +++ b/apps/trading-e2e/src/integration/market-info.cy.ts @@ -17,6 +17,7 @@ describe('market info is displayed', { tags: '@smoke' }, () => { cy.visit('/markets/market-0'); cy.wait('@Market'); cy.getByTestId(marketInfoBtn).click(); + cy.wait('@MarketInfo'); }); it('current fees displayed', () => { @@ -162,7 +163,7 @@ describe('market info is displayed', { tags: '@smoke' }, () => { it('oracle displayed', () => { cy.getByTestId(marketTitle).contains('Oracle').click(); - validateMarketDataRow(0, 'Settlement Price Property', 'prices.BTC.value'); + validateMarketDataRow(0, 'Settlement Data Property', 'prices.BTC.value'); validateMarketDataRow( 1, 'Trading Termination Property', @@ -174,10 +175,11 @@ describe('market info is displayed', { tags: '@smoke' }, () => { .and('contain', '/oracles'); }); - it('proposal displayed', () => { + it.only('proposal displayed', () => { cy.getByTestId(marketTitle).contains('Proposal').click(); cy.getByTestId(externalLink) + .first() .should('have.text', 'View governance proposal') .and('have.attr', 'href') .and('contain', '/governance/market-0'); diff --git a/apps/trading-e2e/src/support/mocks/generate-market-info-query.ts b/apps/trading-e2e/src/support/mocks/generate-market-info-query.ts index b027953ed..5686eaff5 100644 --- a/apps/trading-e2e/src/support/mocks/generate-market-info-query.ts +++ b/apps/trading-e2e/src/support/mocks/generate-market-info-query.ts @@ -11,7 +11,7 @@ import type { PartialDeep } from 'type-fest'; export const generateMarketInfoQuery = ( override?: PartialDeep ): MarketInfoQuery => { - const defaultResult: MarketInfoQuery = { + const defaultResult = { market: { __typename: 'Market', id: 'market-0', @@ -149,7 +149,7 @@ export const generateMarketInfoQuery = ( name: 'tBTC TEST', decimals: 5, }, - oracleSpecForSettlementPrice: { + oracleSpecForSettlementData: { __typename: 'OracleSpec', id: 'f028fe5ea7de3890962a05a7163fdde562629af649ed81b8c8902fafb6eef04f', }, @@ -159,7 +159,7 @@ export const generateMarketInfoQuery = ( }, oracleSpecBinding: { __typename: 'OracleSpecToFutureBinding', - settlementPriceProperty: 'prices.BTC.value', + settlementDataProperty: 'prices.BTC.value', tradingTerminationProperty: 'termination.BTC.value', }, }, diff --git a/apps/trading-e2e/src/support/trading.ts b/apps/trading-e2e/src/support/trading.ts index fb9d5033b..7d4288fc2 100644 --- a/apps/trading-e2e/src/support/trading.ts +++ b/apps/trading-e2e/src/support/trading.ts @@ -77,7 +77,7 @@ export const mockTradingPage = ( aliasQuery( req, - 'MarketInfoQuery', + 'MarketInfo', generateMarketInfoQuery({ market: { state, diff --git a/libs/market-info/src/components/__generated___/MarketInfo.ts b/libs/market-info/src/components/__generated___/MarketInfo.ts deleted file mode 100644 index 621b1f301..000000000 --- a/libs/market-info/src/components/__generated___/MarketInfo.ts +++ /dev/null @@ -1,189 +0,0 @@ -import { Schema as Types } from '@vegaprotocol/types'; - -import { gql } from '@apollo/client'; -import * as Apollo from '@apollo/client'; -const defaultOptions = {} as const; -export type MarketInfoQueryQueryVariables = Types.Exact<{ - marketId: Types.Scalars['ID']; - interval: Types.Interval; - since: Types.Scalars['String']; -}>; - - -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 } }, candlesConnection?: { __typename?: 'CandleDataConnection', edges?: Array<{ __typename?: 'CandleEdge', node: { __typename?: 'Candle', volume: string } } | null> | null } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array | 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` - query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { - market(id: $marketId) { - id - decimalPlaces - positionDecimalPlaces - state - accounts { - type - asset { - id - } - balance - } - tradingMode - accounts { - type - asset { - id - } - balance - } - fees { - factors { - makerFee - infrastructureFee - liquidityFee - } - } - priceMonitoringSettings { - parameters { - triggers { - horizonSecs - probability - auctionExtensionSecs - } - } - } - riskFactors { - market - short - long - } - accounts { - type - asset { - id - } - balance - } - data { - market { - id - } - markPrice - indicativeVolume - bestBidVolume - bestOfferVolume - bestStaticBidVolume - bestStaticOfferVolume - openInterest - bestBidPrice - bestOfferPrice - trigger - priceMonitoringBounds { - minValidPrice - maxValidPrice - trigger { - horizonSecs - probability - auctionExtensionSecs - } - referencePrice - } - } - liquidityMonitoringParameters { - triggeringRatio - targetStakeParameters { - timeWindow - scalingFactor - } - } - candlesConnection(interval: $interval, since: $since) { - edges { - node { - volume - } - } - } - tradableInstrument { - instrument { - id - name - code - metadata { - tags - } - product { - ... on Future { - quoteName - settlementAsset { - id - symbol - name - } - oracleSpecForSettlementPrice { - id - } - oracleSpecForTradingTermination { - id - } - oracleSpecBinding { - settlementPriceProperty - tradingTerminationProperty - } - } - } - } - riskModel { - ... on LogNormalRiskModel { - tau - riskAversionParameter - params { - r - sigma - mu - } - } - ... on SimpleRiskModel { - params { - factorLong - factorShort - } - } - } - } - depth { - lastTrade { - price - } - } - } -} - `; - -/** - * __useMarketInfoQueryQuery__ - * - * To run a query within a React component, call `useMarketInfoQueryQuery` and pass it any options that fit your needs. - * When your component renders, `useMarketInfoQueryQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useMarketInfoQueryQuery({ - * variables: { - * marketId: // value for 'marketId' - * interval: // value for 'interval' - * since: // value for 'since' - * }, - * }); - */ -export function useMarketInfoQueryQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(MarketInfoQueryDocument, options); - } -export function useMarketInfoQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(MarketInfoQueryDocument, options); - } -export type MarketInfoQueryQueryHookResult = ReturnType; -export type MarketInfoQueryLazyQueryHookResult = ReturnType; -export type MarketInfoQueryQueryResult = Apollo.QueryResult; \ No newline at end of file diff --git a/libs/market-info/src/components/MarketInfo.graphql b/libs/market-info/src/components/market-info/MarketInfo.graphql similarity index 82% rename from libs/market-info/src/components/MarketInfo.graphql rename to libs/market-info/src/components/market-info/MarketInfo.graphql index b6b638927..589844229 100644 --- a/libs/market-info/src/components/MarketInfo.graphql +++ b/libs/market-info/src/components/market-info/MarketInfo.graphql @@ -1,9 +1,25 @@ -query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { +query MarketInfo($marketId: ID!, $interval: Interval!, $since: String!) { market(id: $marketId) { id decimalPlaces positionDecimalPlaces state + tradingMode + proposal { + id + rationale { + title + description + } + } + marketTimestamps { + open + close + } + openingAuction { + durationSecs + volume + } accounts { type asset { @@ -12,13 +28,6 @@ query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { balance } tradingMode - accounts { - type - asset { - id - } - balance - } fees { factors { makerFee @@ -40,27 +49,23 @@ query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { short long } - accounts { - type - asset { - id - } - balance - } data { market { id } markPrice - indicativeVolume bestBidVolume bestOfferVolume bestStaticBidVolume bestStaticOfferVolume - openInterest bestBidPrice bestOfferPrice trigger + openInterest + suppliedStake + openInterest + targetStake + marketValueProxy priceMonitoringBounds { minValidPrice maxValidPrice @@ -101,15 +106,16 @@ query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { id symbol name + decimals } - oracleSpecForSettlementPrice { + oracleSpecForSettlementData { id } oracleSpecForTradingTermination { id } oracleSpecBinding { - settlementPriceProperty + settlementDataProperty tradingTerminationProperty } } diff --git a/libs/market-info/src/components/market-info/__generated__/MarketInfoQuery.ts b/libs/market-info/src/components/market-info/__generated__/MarketInfoQuery.ts deleted file mode 100644 index ae7f3c9ab..000000000 --- a/libs/market-info/src/components/market-info/__generated__/MarketInfoQuery.ts +++ /dev/null @@ -1,563 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -// @generated -// This file was automatically generated and should not be edited. - -import { Interval, MarketState, MarketTradingMode, AccountType, AuctionTrigger } from "@vegaprotocol/types"; - -// ==================================================== -// GraphQL query operation: MarketInfoQuery -// ==================================================== - -export interface MarketInfoQuery_market_proposal_rationale { - __typename: "ProposalRationale"; - /** - * Title to be used to give a short description of the proposal in lists. - * This is to be between 0 and 100 unicode characters. - * This is mandatory for all proposals. - */ - title: string; - /** - * Description to show a short title / something in case the link goes offline. - * This is to be between 0 and 20k unicode characters. - * This is mandatory for all proposals. - */ - description: string; -} - -export interface MarketInfoQuery_market_proposal { - __typename: "Proposal"; - /** - * Proposal ID that is filled by Vega once proposal reaches the network - */ - id: string | null; - /** - * Rationale behind the proposal - */ - rationale: MarketInfoQuery_market_proposal_rationale; -} - -export interface MarketInfoQuery_market_accounts_asset { - __typename: "Asset"; - /** - * The ID of the asset - */ - id: string; -} - -export interface MarketInfoQuery_market_accounts { - __typename: "Account"; - /** - * Account type (General, Margin, etc) - */ - type: AccountType; - /** - * Asset, the 'currency' - */ - asset: MarketInfoQuery_market_accounts_asset; - /** - * Balance as string - current account balance (approx. as balances can be updated several times per second) - */ - balance: string; -} - -export interface MarketInfoQuery_market_fees_factors { - __typename: "FeeFactors"; - /** - * The factor applied to calculate MakerFees, a non-negative float - */ - makerFee: string; - /** - * The factor applied to calculate InfrastructureFees, a non-negative float - */ - infrastructureFee: string; - /** - * The factor applied to calculate LiquidityFees, a non-negative float - */ - liquidityFee: string; -} - -export interface MarketInfoQuery_market_fees { - __typename: "Fees"; - /** - * The factors used to calculate the different fees - */ - factors: MarketInfoQuery_market_fees_factors; -} - -export interface MarketInfoQuery_market_priceMonitoringSettings_parameters_triggers { - __typename: "PriceMonitoringTrigger"; - /** - * Price monitoring projection horizon τ in seconds (> 0). - */ - horizonSecs: number; - /** - * Price monitoring probability level p. (>0 and < 1) - */ - probability: number; - /** - * Price monitoring auction extension duration in seconds should the price - * breach its theoretical level over the specified horizon at the specified - * probability level (> 0) - */ - auctionExtensionSecs: number; -} - -export interface MarketInfoQuery_market_priceMonitoringSettings_parameters { - __typename: "PriceMonitoringParameters"; - /** - * The list of triggers for this price monitoring - */ - triggers: MarketInfoQuery_market_priceMonitoringSettings_parameters_triggers[] | null; -} - -export interface MarketInfoQuery_market_priceMonitoringSettings { - __typename: "PriceMonitoringSettings"; - /** - * Specified a set of PriceMonitoringParameters to be use for price monitoring purposes - */ - 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"; - /** - * Market ID - */ - id: string; -} - -export interface MarketInfoQuery_market_data_priceMonitoringBounds_trigger { - __typename: "PriceMonitoringTrigger"; - /** - * Price monitoring projection horizon τ in seconds (> 0). - */ - horizonSecs: number; - /** - * Price monitoring probability level p. (>0 and < 1) - */ - probability: number; - /** - * Price monitoring auction extension duration in seconds should the price - * breach its theoretical level over the specified horizon at the specified - * probability level (> 0) - */ - auctionExtensionSecs: number; -} - -export interface MarketInfoQuery_market_data_priceMonitoringBounds { - __typename: "PriceMonitoringBounds"; - /** - * Minimum price that isn't currently breaching the specified price monitoring trigger - */ - minValidPrice: string; - /** - * Maximum price that isn't currently breaching the specified price monitoring trigger - */ - maxValidPrice: string; - /** - * Price monitoring trigger associated with the bounds - */ - trigger: MarketInfoQuery_market_data_priceMonitoringBounds_trigger; - /** - * Reference price used to calculate the valid price range - */ - referencePrice: string; -} - -export interface MarketInfoQuery_market_data { - __typename: "MarketData"; - /** - * Market of the associated mark price - */ - market: MarketInfoQuery_market_data_market; - /** - * The mark price (an unsigned integer) - */ - markPrice: string; - /** - * The aggregated volume being bid at the best bid price. - */ - bestBidVolume: string; - /** - * The aggregated volume being offered at the best offer price. - */ - bestOfferVolume: string; - /** - * The aggregated volume being offered at the best static bid price, excluding pegged orders - */ - bestStaticBidVolume: string; - /** - * The aggregated volume being offered at the best static offer price, excluding pegged orders. - */ - bestStaticOfferVolume: string; - /** - * The highest price level on an order book for buy orders. - */ - bestBidPrice: string; - /** - * The lowest price level on an order book for offer orders. - */ - bestOfferPrice: string; - /** - * What triggered an auction (if an auction was started) - */ - trigger: AuctionTrigger; - /** - * The sum of the size of all positions greater than 0. - */ - openInterest: string; - /** - * The supplied stake for the market - */ - suppliedStake: string | null; - /** - * The amount of stake targeted for this market - */ - targetStake: string | null; - /** - * The market value proxy - */ - marketValueProxy: string; - /** - * A list of valid price ranges per associated trigger - */ - priceMonitoringBounds: MarketInfoQuery_market_data_priceMonitoringBounds[] | null; -} - -export interface MarketInfoQuery_market_liquidityMonitoringParameters_targetStakeParameters { - __typename: "TargetStakeParameters"; - /** - * Specifies length of time window expressed in seconds for target stake calculation - */ - timeWindow: number; - /** - * Specifies scaling factors used in target stake calculation - */ - scalingFactor: number; -} - -export interface MarketInfoQuery_market_liquidityMonitoringParameters { - __typename: "LiquidityMonitoringParameters"; - /** - * Specifies the triggering ratio for entering liquidity auction - */ - triggeringRatio: number; - /** - * Specifies parameters related to target stake calculation - */ - targetStakeParameters: MarketInfoQuery_market_liquidityMonitoringParameters_targetStakeParameters; -} - -export interface MarketInfoQuery_market_candlesConnection_edges_node { - __typename: "Candle"; - /** - * Volume price (uint64) - */ - volume: string; -} - -export interface MarketInfoQuery_market_candlesConnection_edges { - __typename: "CandleEdge"; - /** - * The candle - */ - node: MarketInfoQuery_market_candlesConnection_edges_node; -} - -export interface MarketInfoQuery_market_candlesConnection { - __typename: "CandleDataConnection"; - /** - * The candles - */ - edges: (MarketInfoQuery_market_candlesConnection_edges | null)[] | null; -} - -export interface MarketInfoQuery_market_tradableInstrument_instrument_metadata { - __typename: "InstrumentMetadata"; - /** - * An arbitrary list of tags to associated to associate to the Instrument (string list) - */ - tags: string[] | null; -} - -export interface MarketInfoQuery_market_tradableInstrument_instrument_product_settlementAsset { - __typename: "Asset"; - /** - * The ID of the asset - */ - id: string; - /** - * The symbol of the asset (e.g: GBP) - */ - symbol: string; - /** - * The full name of the asset (e.g: Great British Pound) - */ - name: string; - /** - * The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18 - */ - decimals: number; -} - -export interface MarketInfoQuery_market_tradableInstrument_instrument_product_oracleSpecForSettlementPrice { - __typename: "OracleSpec"; - /** - * ID is a hash generated from the OracleSpec data. - */ - id: string; -} - -export interface MarketInfoQuery_market_tradableInstrument_instrument_product_oracleSpecForTradingTermination { - __typename: "OracleSpec"; - /** - * ID is a hash generated from the OracleSpec data. - */ - id: string; -} - -export interface MarketInfoQuery_market_tradableInstrument_instrument_product_oracleSpecBinding { - __typename: "OracleSpecToFutureBinding"; - settlementPriceProperty: string; - tradingTerminationProperty: string; -} - -export interface MarketInfoQuery_market_tradableInstrument_instrument_product { - __typename: "Future"; - /** - * String representing the quote (e.g. BTCUSD -> USD is quote) - */ - quoteName: string; - /** - * The name of the asset (string) - */ - settlementAsset: MarketInfoQuery_market_tradableInstrument_instrument_product_settlementAsset; - /** - * The oracle spec describing the oracle data of interest for settlement price. - */ - oracleSpecForSettlementPrice: MarketInfoQuery_market_tradableInstrument_instrument_product_oracleSpecForSettlementPrice; - /** - * The oracle spec describing the oracle data of interest for trading termination. - */ - oracleSpecForTradingTermination: MarketInfoQuery_market_tradableInstrument_instrument_product_oracleSpecForTradingTermination; - /** - * The binding between the oracle spec and the settlement price - */ - oracleSpecBinding: MarketInfoQuery_market_tradableInstrument_instrument_product_oracleSpecBinding; -} - -export interface MarketInfoQuery_market_tradableInstrument_instrument { - __typename: "Instrument"; - /** - * Uniquely identify an instrument across all instruments available on Vega (string) - */ - id: string; - /** - * Full and fairly descriptive name for the instrument - */ - name: string; - /** - * A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) - */ - code: string; - /** - * Metadata for this instrument - */ - metadata: MarketInfoQuery_market_tradableInstrument_instrument_metadata; - /** - * A reference to or instance of a fully specified product, including all required product parameters for that product (Product union) - */ - product: MarketInfoQuery_market_tradableInstrument_instrument_product; -} - -export interface MarketInfoQuery_market_tradableInstrument_riskModel_LogNormalRiskModel_params { - __typename: "LogNormalModelParams"; - /** - * R parameter - */ - r: number; - /** - * Sigma parameter, annualised volatility of the underlying asset, must be a strictly non-negative real number - */ - sigma: number; - /** - * Mu parameter, annualised growth rate of the underlying asset - */ - mu: number; -} - -export interface MarketInfoQuery_market_tradableInstrument_riskModel_LogNormalRiskModel { - __typename: "LogNormalRiskModel"; - /** - * Tau parameter of the risk model, projection horizon measured as a year fraction used in the expected shortfall calculation to obtain the maintenance margin, must be a strictly non-negative real number - */ - tau: number; - /** - * Lambda parameter of the risk model, probability confidence level used in expected shortfall calculation when obtaining the maintenance margin level, must be strictly greater than 0 and strictly smaller than 1 - */ - riskAversionParameter: number; - /** - * Parameters for the log normal risk model - */ - params: MarketInfoQuery_market_tradableInstrument_riskModel_LogNormalRiskModel_params; -} - -export interface MarketInfoQuery_market_tradableInstrument_riskModel_SimpleRiskModel_params { - __typename: "SimpleRiskModelParams"; - /** - * Risk factor for long - */ - factorLong: number; - /** - * Risk factor for short - */ - factorShort: number; -} - -export interface MarketInfoQuery_market_tradableInstrument_riskModel_SimpleRiskModel { - __typename: "SimpleRiskModel"; - /** - * Params for the simple risk model - */ - params: MarketInfoQuery_market_tradableInstrument_riskModel_SimpleRiskModel_params; -} - -export type MarketInfoQuery_market_tradableInstrument_riskModel = MarketInfoQuery_market_tradableInstrument_riskModel_LogNormalRiskModel | MarketInfoQuery_market_tradableInstrument_riskModel_SimpleRiskModel; - -export interface MarketInfoQuery_market_tradableInstrument { - __typename: "TradableInstrument"; - /** - * An instance of, or reference to, a fully specified instrument. - */ - instrument: MarketInfoQuery_market_tradableInstrument_instrument; - /** - * A reference to a risk model that is valid for the instrument - */ - riskModel: MarketInfoQuery_market_tradableInstrument_riskModel; -} - -export interface MarketInfoQuery_market_depth_lastTrade { - __typename: "Trade"; - /** - * The price of the trade (probably initially the passive order price, other determination algorithms are possible though) (uint64) - */ - price: string; -} - -export interface MarketInfoQuery_market_depth { - __typename: "MarketDepth"; - /** - * Last trade for the given market (if available) - */ - lastTrade: MarketInfoQuery_market_depth_lastTrade | null; -} - -export interface MarketInfoQuery_market { - __typename: "Market"; - /** - * Market ID - */ - id: string; - /** - * 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) - * - * Examples: - * Currency Balance decimalPlaces Real Balance - * GBP 100 0 GBP 100 - * GBP 100 2 GBP 1.00 - * GBP 100 4 GBP 0.01 - * GBP 1 4 GBP 0.0001 ( 0.01p ) - * - * GBX (pence) 100 0 GBP 1.00 (100p ) - * GBX (pence) 100 2 GBP 0.01 ( 1p ) - * GBX (pence) 100 4 GBP 0.0001 ( 0.01p ) - * GBX (pence) 1 4 GBP 0.000001 ( 0.0001p) - */ - decimalPlaces: number; - /** - * The number of decimal places that an integer must be shifted in order to get a correct size (uint64). - * i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes. - * 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market. - * This sets how big the smallest order / position on the market can be. - */ - positionDecimalPlaces: number; - /** - * Current state of the market - */ - state: MarketState; - /** - * Current mode of execution of the market - */ - tradingMode: MarketTradingMode; - /** - * The proposal that initiated this market - */ - proposal: MarketInfoQuery_market_proposal | null; - /** - * Get account for a party or market - */ - accounts: MarketInfoQuery_market_accounts[] | null; - /** - * Fees related data - */ - fees: MarketInfoQuery_market_fees; - /** - * 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 - */ - data: MarketInfoQuery_market_data | null; - /** - * Liquidity monitoring parameters for the market - */ - liquidityMonitoringParameters: MarketInfoQuery_market_liquidityMonitoringParameters; - /** - * Candles on a market, for the 'last' n candles, at 'interval' seconds as specified by parameters using cursor based pagination - */ - candlesConnection: MarketInfoQuery_market_candlesConnection | null; - /** - * An instance of, or reference to, a tradable instrument. - */ - tradableInstrument: MarketInfoQuery_market_tradableInstrument; - /** - * Current depth on the order book for this market - */ - depth: MarketInfoQuery_market_depth; -} - -export interface MarketInfoQuery { - /** - * An instrument that is trading on the Vega network - */ - market: MarketInfoQuery_market | null; -} - -export interface MarketInfoQueryVariables { - marketId: string; - interval: Interval; - since: string; -} diff --git a/libs/market-info/src/components/market-info/__generated__/index.ts b/libs/market-info/src/components/market-info/__generated__/index.ts deleted file mode 100644 index 9807aed20..000000000 --- a/libs/market-info/src/components/market-info/__generated__/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './MarketInfoQuery'; diff --git a/libs/market-info/src/components/market-info/__generated___/MarketInfo.ts b/libs/market-info/src/components/market-info/__generated___/MarketInfo.ts new file mode 100644 index 000000000..97def6e71 --- /dev/null +++ b/libs/market-info/src/components/market-info/__generated___/MarketInfo.ts @@ -0,0 +1,195 @@ +import { Schema as Types } from '@vegaprotocol/types'; + +import { gql } from '@apollo/client'; +import * as Apollo from '@apollo/client'; +const defaultOptions = {} as const; +export type MarketInfoQueryVariables = Types.Exact<{ + marketId: Types.Scalars['ID']; + interval: Types.Interval; + since: Types.Scalars['String']; +}>; + + +export type MarketInfoQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, proposal?: { __typename?: 'Proposal', id?: string | null, rationale: { __typename?: 'ProposalRationale', title: string, description: string } } | null, marketTimestamps: { __typename?: 'MarketTimestamps', open?: string | null, close?: string | null }, openingAuction: { __typename?: 'AuctionDuration', durationSecs: number, volume: number }, 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, bestBidVolume: string, bestOfferVolume: string, bestStaticBidVolume: string, bestStaticOfferVolume: string, bestBidPrice: string, bestOfferPrice: string, trigger: Types.AuctionTrigger, openInterest: string, suppliedStake?: string | null, targetStake?: string | null, marketValueProxy: string, 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 } }, candlesConnection?: { __typename?: 'CandleDataConnection', edges?: Array<{ __typename?: 'CandleEdge', node: { __typename?: 'Candle', volume: string } } | null> | null } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array | null }, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string, decimals: number }, oracleSpecForSettlementData: { __typename?: 'OracleSpec', id: string }, oracleSpecForTradingTermination: { __typename?: 'OracleSpec', id: string }, oracleSpecBinding: { __typename?: 'OracleSpecToFutureBinding', settlementDataProperty: 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 MarketInfoDocument = gql` + query MarketInfo($marketId: ID!, $interval: Interval!, $since: String!) { + market(id: $marketId) { + id + decimalPlaces + positionDecimalPlaces + state + tradingMode + proposal { + id + rationale { + title + description + } + } + marketTimestamps { + open + close + } + openingAuction { + durationSecs + volume + } + accounts { + type + asset { + id + } + balance + } + tradingMode + fees { + factors { + makerFee + infrastructureFee + liquidityFee + } + } + priceMonitoringSettings { + parameters { + triggers { + horizonSecs + probability + auctionExtensionSecs + } + } + } + riskFactors { + market + short + long + } + data { + market { + id + } + markPrice + bestBidVolume + bestOfferVolume + bestStaticBidVolume + bestStaticOfferVolume + bestBidPrice + bestOfferPrice + trigger + openInterest + suppliedStake + openInterest + targetStake + marketValueProxy + priceMonitoringBounds { + minValidPrice + maxValidPrice + trigger { + horizonSecs + probability + auctionExtensionSecs + } + referencePrice + } + } + liquidityMonitoringParameters { + triggeringRatio + targetStakeParameters { + timeWindow + scalingFactor + } + } + candlesConnection(interval: $interval, since: $since) { + edges { + node { + volume + } + } + } + tradableInstrument { + instrument { + id + name + code + metadata { + tags + } + product { + ... on Future { + quoteName + settlementAsset { + id + symbol + name + decimals + } + oracleSpecForSettlementData { + id + } + oracleSpecForTradingTermination { + id + } + oracleSpecBinding { + settlementDataProperty + tradingTerminationProperty + } + } + } + } + riskModel { + ... on LogNormalRiskModel { + tau + riskAversionParameter + params { + r + sigma + mu + } + } + ... on SimpleRiskModel { + params { + factorLong + factorShort + } + } + } + } + depth { + lastTrade { + price + } + } + } +} + `; + +/** + * __useMarketInfoQuery__ + * + * To run a query within a React component, call `useMarketInfoQuery` and pass it any options that fit your needs. + * When your component renders, `useMarketInfoQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMarketInfoQuery({ + * variables: { + * marketId: // value for 'marketId' + * interval: // value for 'interval' + * since: // value for 'since' + * }, + * }); + */ +export function useMarketInfoQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MarketInfoDocument, options); + } +export function useMarketInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MarketInfoDocument, options); + } +export type MarketInfoQueryHookResult = ReturnType; +export type MarketInfoLazyQueryHookResult = ReturnType; +export type MarketInfoQueryResult = Apollo.QueryResult; \ No newline at end of file diff --git a/libs/market-info/src/components/market-info/index.ts b/libs/market-info/src/components/market-info/index.ts index 7888cbaa0..8e3aee242 100644 --- a/libs/market-info/src/components/market-info/index.ts +++ b/libs/market-info/src/components/market-info/index.ts @@ -1,5 +1,4 @@ -export * from './__generated__'; export * from './info-key-value-table'; -export * from './info-market-query'; export * from './info-market'; export * from './tooltip-mapping'; +export * from './__generated___/MarketInfo'; diff --git a/libs/market-info/src/components/market-info/info-market-query.ts b/libs/market-info/src/components/market-info/info-market-query.ts deleted file mode 100644 index fcdf0588b..000000000 --- a/libs/market-info/src/components/market-info/info-market-query.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { gql } from '@apollo/client'; - -export const MARKET_INFO_QUERY = gql` - query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) { - market(id: $marketId) { - id - decimalPlaces - positionDecimalPlaces - state - tradingMode - proposal { - id - rationale { - title - description - } - } - accounts { - type - asset { - id - } - balance - } - tradingMode - fees { - factors { - makerFee - infrastructureFee - liquidityFee - } - } - priceMonitoringSettings { - parameters { - triggers { - horizonSecs - probability - auctionExtensionSecs - } - } - } - riskFactors { - market - short - long - } - data { - market { - id - } - markPrice - bestBidVolume - bestOfferVolume - bestStaticBidVolume - bestStaticOfferVolume - bestBidPrice - bestOfferPrice - trigger - openInterest - suppliedStake - openInterest - targetStake - marketValueProxy - priceMonitoringBounds { - minValidPrice - maxValidPrice - trigger { - horizonSecs - probability - auctionExtensionSecs - } - referencePrice - } - } - liquidityMonitoringParameters { - triggeringRatio - targetStakeParameters { - timeWindow - scalingFactor - } - } - candlesConnection(interval: $interval, since: $since) { - edges { - node { - volume - } - } - } - tradableInstrument { - instrument { - id - name - code - metadata { - tags - } - product { - ... on Future { - quoteName - settlementAsset { - id - symbol - name - decimals - } - oracleSpecForSettlementPrice { - id - } - oracleSpecForTradingTermination { - id - } - oracleSpecBinding { - settlementPriceProperty - tradingTerminationProperty - } - } - } - } - riskModel { - ... on LogNormalRiskModel { - tau - riskAversionParameter - params { - r - sigma - mu - } - } - ... on SimpleRiskModel { - params { - factorLong - factorShort - } - } - } - } - depth { - lastTrade { - price - } - } - } - } -`; diff --git a/libs/market-info/src/components/market-info/info-market.tsx b/libs/market-info/src/components/market-info/info-market.tsx index daf1212dd..4fbec4e55 100644 --- a/libs/market-info/src/components/market-info/info-market.tsx +++ b/libs/market-info/src/components/market-info/info-market.tsx @@ -1,9 +1,13 @@ import { useMemo } from 'react'; -import { formatNumber, t, useYesterday } from '@vegaprotocol/react-helpers'; +import { + formatNumber, + t, + useDataProvider, + useYesterday, +} from '@vegaprotocol/react-helpers'; import { AsyncRenderer, Splash, Accordion } from '@vegaprotocol/ui-toolkit'; import pick from 'lodash/pick'; import BigNumber from 'bignumber.js'; -import { useQuery } from '@apollo/client'; import { totalFees } from '@vegaprotocol/market-list'; import { AccountType, @@ -11,19 +15,15 @@ import { MarketStateMapping, MarketTradingModeMapping, } from '@vegaprotocol/types'; -import { MARKET_INFO_QUERY } from './info-market-query'; -import type { - MarketInfoQuery, - MarketInfoQuery_market, - MarketInfoQuery_market_candlesConnection_edges, -} from './__generated__/MarketInfoQuery'; import { MarketInfoTable } from './info-key-value-table'; import { ExternalLink } from '@vegaprotocol/ui-toolkit'; import { generatePath } from 'react-router-dom'; import { useEnvironment } from '@vegaprotocol/environment'; import { Link as UiToolkitLink } from '@vegaprotocol/ui-toolkit'; import Link from 'next/link'; +import { marketInfoDataProvider } from './market-info-data-provider'; import { AssetDetailsTable, useAssetDataProvider } from '@vegaprotocol/assets'; +import type { MarketInfoQuery } from './__generated___/MarketInfo'; import { getMarketExpiryDateFormatted } from '../market-expires'; const Links = { @@ -31,23 +31,17 @@ const Links = { }; export interface InfoProps { - market: MarketInfoQuery_market; + market: MarketInfoQuery['market']; onSelect: (id: string) => void; } export const calcCandleVolume = ( - m: MarketInfoQuery_market + m: MarketInfoQuery['market'] ): string | undefined => { - return m.candlesConnection?.edges - ?.reduce( - ( - acc: BigNumber, - c: MarketInfoQuery_market_candlesConnection_edges | null - ) => { - return acc.plus(new BigNumber(c?.node?.volume ?? 0)); - }, - new BigNumber(m.candlesConnection?.edges[0]?.node.volume ?? 0) - ) + return m?.candlesConnection?.edges + ?.reduce((acc: BigNumber, c) => { + return acc.plus(new BigNumber(c?.node?.volume ?? 0)); + }, new BigNumber(m?.candlesConnection?.edges[0]?.node.volume ?? 0)) ?.toString(); }; @@ -67,16 +61,15 @@ export const MarketInfoContainer = ({ () => ({ marketId, since: yTimestamp, interval: Interval.INTERVAL_I1H }), [marketId, yTimestamp] ); - const { data, loading, error } = useQuery( - MARKET_INFO_QUERY, - { - variables, - errorPolicy: 'ignore', - } - ); + + const { data, loading, error } = useDataProvider({ + dataProvider: marketInfoDataProvider, + noUpdate: true, + variables, + }); return ( - data={data} loading={loading} error={error}> + {data && data.market ? ( ) : ( @@ -93,12 +86,13 @@ export const Info = ({ market, onSelect }: InfoProps) => { const headerClassName = 'uppercase text-lg'; const dayVolume = calcCandleVolume(market); const assetSymbol = - market.tradableInstrument.instrument.product?.settlementAsset.symbol; + market?.tradableInstrument.instrument.product?.settlementAsset.symbol; const assetId = useMemo( - () => market.tradableInstrument.instrument.product?.settlementAsset.id, + () => market?.tradableInstrument.instrument.product?.settlementAsset.id, [market] ); - const { data: asset } = useAssetDataProvider(assetId); + const { data: asset } = useAssetDataProvider(assetId ?? ''); + if (!market) return null; const marketDataPanels = [ { title: t('Current fees'), @@ -322,9 +316,9 @@ export const Info = ({ market, onSelect }: InfoProps) => { data={market.tradableInstrument.instrument.product.oracleSpecBinding} > - {t('View price oracle specification')} + {t('View settlement data oracle specification')} ({ + query: MarketInfoDocument, + getData: (responseData: MarketInfoQuery) => responseData, +}); diff --git a/libs/types/src/__generated__/globalTypes.ts b/libs/types/src/__generated__/globalTypes.ts index 4ea025e21..38c415ee2 100644 --- a/libs/types/src/__generated__/globalTypes.ts +++ b/libs/types/src/__generated__/globalTypes.ts @@ -68,6 +68,7 @@ export enum BusEventType { SettlePosition = 'SettlePosition', TimeUpdate = 'TimeUpdate', Trade = 'Trade', + TransactionResult = "TransactionResult", TransferResponses = 'TransferResponses', Vote = 'Vote', Withdrawal = 'Withdrawal', diff --git a/libs/types/src/__generated__/types.ts b/libs/types/src/__generated__/types.ts index 8aa0bf96c..f2e1703af 100644 --- a/libs/types/src/__generated__/types.ts +++ b/libs/types/src/__generated__/types.ts @@ -342,6 +342,8 @@ export enum BusEventType { TimeUpdate = 'TimeUpdate', /** A trade has been created */ Trade = 'Trade', + /** The results from processing at transaction */ + TransactionResult = 'TransactionResult', /** A balance has been transferred between accounts */ TransferResponses = 'TransferResponses', /** A vote has been placed on a governance proposal */ @@ -809,7 +811,7 @@ export type EthereumKeyRotationsConnection = { }; /** Union type for wrapped events in stream PROPOSAL is mapped to governance data, something to keep in mind */ -export type Event = Account | Asset | AuctionEvent | Deposit | LiquidityProvision | LossSocialization | MarginLevels | Market | MarketData | MarketEvent | MarketTick | NodeSignature | OracleSpec | Order | Party | PositionResolution | Proposal | RiskFactor | SettleDistressed | SettlePosition | TimeUpdate | Trade | TransferResponses | Vote | Withdrawal; +export type Event = Account | Asset | AuctionEvent | Deposit | LiquidityProvision | LossSocialization | MarginLevels | Market | MarketData | MarketEvent | MarketTick | NodeSignature | OracleSpec | Order | Party | PositionResolution | Proposal | RiskFactor | SettleDistressed | SettlePosition | TimeUpdate | Trade | TransactionResult | TransferResponses | Vote | Withdrawal; /** The factors applied to calculate the fees */ export type FeeFactors = { @@ -847,10 +849,10 @@ export type Filter = { /** A Future product */ export type Future = { __typename?: 'Future'; - /** The binding between the oracle spec and the settlement price */ + /** The binding between the oracle spec and the settlement data */ oracleSpecBinding: OracleSpecToFutureBinding; - /** The oracle spec describing the oracle data of interest for settlement price. */ - oracleSpecForSettlementPrice: OracleSpec; + /** The oracle spec describing the oracle data of interest for settlement. */ + oracleSpecForSettlementData: OracleSpec; /** The oracle spec describing the oracle data of interest for trading termination. */ oracleSpecForTradingTermination: OracleSpec; /** String representing the quote (e.g. BTCUSD -> USD is quote) */ @@ -865,11 +867,11 @@ export type FutureProduct = { __typename?: 'FutureProduct'; /** * OracleSpecToFutureBinding tells on which property oracle data should be - * used as settlement price. + * used as settlement data. */ oracleSpecBinding: OracleSpecToFutureBinding; - /** Describes the oracle data that an instrument wants to get from the oracle engine for settlement price. */ - oracleSpecForSettlementPrice: OracleSpecConfiguration; + /** Describes the oracle data that an instrument wants to get from the oracle engine for settlement data. */ + oracleSpecForSettlementData: OracleSpecConfiguration; /** Describes the oracle data that an instrument wants to get from the oracle engine for trading termination. */ oracleSpecForTradingTermination: OracleSpecConfiguration; /** String representing the quote (e.g. BTCUSD -> USD is quote) */ @@ -2073,11 +2075,11 @@ export enum OracleSpecStatus { /** * OracleSpecToFutureBinding tells on which property oracle data should be - * used as settlement price and trading termination. + * used as settlement data and trading termination. */ export type OracleSpecToFutureBinding = { __typename?: 'OracleSpecToFutureBinding'; - settlementPriceProperty: Scalars['String']; + settlementDataProperty: Scalars['String']; tradingTerminationProperty: Scalars['String']; }; @@ -2722,7 +2724,7 @@ export type Position = { marginsConnection?: Maybe; /** Market relating to this position */ market: Market; - /** Open volume (uint64) */ + /** Open volume (int64) */ openVolume: Scalars['String']; /** The party holding this position */ party: Party; @@ -2787,7 +2789,7 @@ export type PositionUpdate = { averageEntryPrice: Scalars['String']; /** Market relating to this position */ marketId: Scalars['ID']; - /** Open volume (uint64) */ + /** Open volume (int64) */ openVolume: Scalars['String']; /** The party holding this position */ partyId: Scalars['ID']; @@ -4327,6 +4329,19 @@ export type TradeUpdate = { type: TradeType; }; +/** The result from processing a transaction */ +export type TransactionResult = { + __typename?: 'TransactionResult'; + /** The error emitted by the transaction, will be null if the transaction succeeded */ + error?: Maybe; + /** The hash of the transaction */ + hash: Scalars['String']; + /** The party which submitted this transaction */ + partyId: Scalars['String']; + /** Was the transaction successful or not? */ + status: Scalars['Boolean']; +}; + export type TransactionSubmitted = { __typename?: 'TransactionSubmitted'; success: Scalars['Boolean']; @@ -4453,7 +4468,7 @@ export type UpdateERC20 = { export type UpdateFutureProduct = { __typename?: 'UpdateFutureProduct'; oracleSpecBinding: OracleSpecToFutureBinding; - oracleSpecForSettlementPrice: OracleSpecConfiguration; + oracleSpecForSettlementData: OracleSpecConfiguration; oracleSpecForTradingTermination: OracleSpecConfiguration; quoteName: Scalars['String']; }; diff --git a/libs/withdraws/src/lib/__generated___/Withdrawal.ts b/libs/withdraws/src/lib/__generated___/Withdrawal.ts index 584b15205..1a9e2528e 100644 --- a/libs/withdraws/src/lib/__generated___/Withdrawal.ts +++ b/libs/withdraws/src/lib/__generated___/Withdrawal.ts @@ -17,7 +17,7 @@ export type WithdrawalEventSubscriptionVariables = Types.Exact<{ }>; -export type WithdrawalEventSubscription = { __typename?: 'Subscription', busEvents?: Array<{ __typename?: 'BusEvent', event: { __typename?: 'Account' } | { __typename?: 'Asset' } | { __typename?: 'AuctionEvent' } | { __typename?: 'Deposit' } | { __typename?: 'LiquidityProvision' } | { __typename?: 'LossSocialization' } | { __typename?: 'MarginLevels' } | { __typename?: 'Market' } | { __typename?: 'MarketData' } | { __typename?: 'MarketEvent' } | { __typename?: 'MarketTick' } | { __typename?: 'NodeSignature' } | { __typename?: 'OracleSpec' } | { __typename?: 'Order' } | { __typename?: 'Party' } | { __typename?: 'PositionResolution' } | { __typename?: 'Proposal' } | { __typename?: 'RiskFactor' } | { __typename?: 'SettleDistressed' } | { __typename?: 'SettlePosition' } | { __typename?: 'TimeUpdate' } | { __typename?: 'Trade' } | { __typename?: 'TransferResponses' } | { __typename?: 'Vote' } | { __typename?: 'Withdrawal', id: string, status: Types.WithdrawalStatus, amount: string, createdTimestamp: string, withdrawnTimestamp?: string | null, txHash?: string | null, pendingOnForeignChain: boolean, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number }, details?: { __typename?: 'Erc20WithdrawalDetails', receiverAddress: string } | null } }> | null }; +export type WithdrawalEventSubscription = { __typename?: 'Subscription', busEvents?: Array<{ __typename?: 'BusEvent', event: { __typename?: 'Account' } | { __typename?: 'Asset' } | { __typename?: 'AuctionEvent' } | { __typename?: 'Deposit' } | { __typename?: 'LiquidityProvision' } | { __typename?: 'LossSocialization' } | { __typename?: 'MarginLevels' } | { __typename?: 'Market' } | { __typename?: 'MarketData' } | { __typename?: 'MarketEvent' } | { __typename?: 'MarketTick' } | { __typename?: 'NodeSignature' } | { __typename?: 'OracleSpec' } | { __typename?: 'Order' } | { __typename?: 'Party' } | { __typename?: 'PositionResolution' } | { __typename?: 'Proposal' } | { __typename?: 'RiskFactor' } | { __typename?: 'SettleDistressed' } | { __typename?: 'SettlePosition' } | { __typename?: 'TimeUpdate' } | { __typename?: 'Trade' } | { __typename?: 'TransactionResult' } | { __typename?: 'TransferResponses' } | { __typename?: 'Vote' } | { __typename?: 'Withdrawal', id: string, status: Types.WithdrawalStatus, amount: string, createdTimestamp: string, withdrawnTimestamp?: string | null, txHash?: string | null, pendingOnForeignChain: boolean, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number }, details?: { __typename?: 'Erc20WithdrawalDetails', receiverAddress: string } | null } }> | null }; export const WithdrawalFieldsFragmentDoc = gql` fragment WithdrawalFields on Withdrawal {