diff --git a/apps/explorer/src/app/components/links/proposal-link/Proposal.graphql b/apps/explorer/src/app/components/links/proposal-link/Proposal.graphql index 85d2c3518..77694a2bb 100644 --- a/apps/explorer/src/app/components/links/proposal-link/Proposal.graphql +++ b/apps/explorer/src/app/components/links/proposal-link/Proposal.graphql @@ -1,9 +1,11 @@ query ExplorerProposal($id: ID!) { proposal(id: $id) { - id - rationale { - title - description + ... on Proposal { + id + rationale { + title + description + } } } } diff --git a/apps/explorer/src/app/components/links/proposal-link/__generated__/Proposal.ts b/apps/explorer/src/app/components/links/proposal-link/__generated__/Proposal.ts index 00a3cf101..60bb107bd 100644 --- a/apps/explorer/src/app/components/links/proposal-link/__generated__/Proposal.ts +++ b/apps/explorer/src/app/components/links/proposal-link/__generated__/Proposal.ts @@ -8,16 +8,18 @@ export type ExplorerProposalQueryVariables = Types.Exact<{ }>; -export type ExplorerProposalQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', id?: string | null, rationale: { __typename?: 'ProposalRationale', title: string, description: string } } | null }; +export type ExplorerProposalQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, rationale: { __typename?: 'ProposalRationale', title: string, description: string } } | null }; export const ExplorerProposalDocument = gql` query ExplorerProposal($id: ID!) { proposal(id: $id) { - id - rationale { - title - description + ... on Proposal { + id + rationale { + title + description + } } } } diff --git a/apps/explorer/src/app/components/txs/details/proposal/Proposal.graphql b/apps/explorer/src/app/components/txs/details/proposal/Proposal.graphql index aa67158dd..db4b2ea66 100644 --- a/apps/explorer/src/app/components/txs/details/proposal/Proposal.graphql +++ b/apps/explorer/src/app/components/txs/details/proposal/Proposal.graphql @@ -1,7 +1,9 @@ query ExplorerProposalStatus($id: ID!) { proposal(id: $id) { - id - state - rejectionReason + ... on Proposal { + id + state + rejectionReason + } } } diff --git a/apps/explorer/src/app/components/txs/details/proposal/__generated__/Proposal.ts b/apps/explorer/src/app/components/txs/details/proposal/__generated__/Proposal.ts index 8a1e9222a..0034cd2e2 100644 --- a/apps/explorer/src/app/components/txs/details/proposal/__generated__/Proposal.ts +++ b/apps/explorer/src/app/components/txs/details/proposal/__generated__/Proposal.ts @@ -8,15 +8,17 @@ export type ExplorerProposalStatusQueryVariables = Types.Exact<{ }>; -export type ExplorerProposalStatusQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', id?: string | null, state: Types.ProposalState, rejectionReason?: Types.ProposalRejectionReason | null } | null }; +export type ExplorerProposalStatusQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, state: Types.ProposalState, rejectionReason?: Types.ProposalRejectionReason | null } | null }; export const ExplorerProposalStatusDocument = gql` query ExplorerProposalStatus($id: ID!) { proposal(id: $id) { - id - state - rejectionReason + ... on Proposal { + id + state + rejectionReason + } } } `; diff --git a/apps/governance/src/routes/proposals/proposal/Proposal.graphql b/apps/governance/src/routes/proposals/proposal/Proposal.graphql index 2cd677790..7e23aba5e 100644 --- a/apps/governance/src/routes/proposals/proposal/Proposal.graphql +++ b/apps/governance/src/routes/proposals/proposal/Proposal.graphql @@ -86,229 +86,65 @@ query Proposal( $includeUpdateReferralProgram: Boolean! ) { proposal(id: $proposalId) { - id - rationale { - title - description - } - reference - state - datetime - rejectionReason - party { + ... on Proposal { id - } - errorDetails - ...NewMarketProductField @include(if: $includeNewMarketProductField) - ...UpdateMarketState @include(if: $includeUpdateMarketState) - ...UpdateReferralProgram @include(if: $includeUpdateReferralProgram) - ...UpdateVolumeDiscountProgram - terms { - closingDatetime - enactmentDatetime - change { - ... on NewMarket { - decimalPlaces - metadata - riskParameters { - ... on LogNormalRiskModel { - riskAversionParameter - tau - params { - mu - r - sigma - } - } - ... on SimpleRiskModel { - params { - factorLong - factorShort - } - } - } - instrument { - name - code - product { - ... on FutureProduct { - settlementAsset { - id - name - symbol - decimals - quantum - } - quoteName - dataSourceSpecBinding { - settlementDataProperty - tradingTerminationProperty - } - dataSourceSpecForSettlementData { - sourceType { - ... on DataSourceDefinitionInternal { - sourceType { - ... on DataSourceSpecConfigurationTime { - conditions { - operator - value - } - } - } - } - ... on DataSourceDefinitionExternal { - sourceType { - ... on DataSourceSpecConfiguration { - signers { - signer { - ... on PubKey { - key - } - ... on ETHAddress { - address - } - } - } - filters { - key { - name - type - } - conditions { - operator - value - } - } - } - } - } - } + rationale { + title + description + } + reference + state + datetime + rejectionReason + party { + id + } + errorDetails + ...NewMarketProductField @include(if: $includeNewMarketProductField) + ...UpdateMarketState @include(if: $includeUpdateMarketState) + ...UpdateReferralProgram @include(if: $includeUpdateReferralProgram) + ...UpdateVolumeDiscountProgram + terms { + closingDatetime + enactmentDatetime + change { + ... on NewMarket { + decimalPlaces + metadata + riskParameters { + ... on LogNormalRiskModel { + riskAversionParameter + tau + params { + mu + r + sigma } } - ... on PerpetualProduct { - settlementAsset { - id - name - symbol - decimals - quantum + ... on SimpleRiskModel { + params { + factorLong + factorShort } - quoteName } } - } - priceMonitoringParameters { - triggers { - horizonSecs - probability - auctionExtensionSecs - } - } - liquidityMonitoringParameters { - targetStakeParameters { - timeWindow - scalingFactor - } - } - positionDecimalPlaces - linearSlippageFactor - quadraticSlippageFactor - } - ... on UpdateMarket { - marketId - updateMarketConfiguration { instrument { + name code product { - ... on UpdateFutureProduct { - quoteName - dataSourceSpecForSettlementData { - sourceType { - ... on DataSourceDefinitionInternal { - sourceType { - ... on DataSourceSpecConfigurationTime { - conditions { - operator - value - } - } - } - } - ... on DataSourceDefinitionExternal { - sourceType { - ... on DataSourceSpecConfiguration { - signers { - signer { - ... on PubKey { - key - } - ... on ETHAddress { - address - } - } - } - filters { - key { - name - type - } - conditions { - operator - value - } - } - } - } - } - } + ... on FutureProduct { + settlementAsset { + id + name + symbol + decimals + quantum } - # dataSourceSpecForTradingTermination { - # sourceType { - # ... on DataSourceDefinitionInternal { - # sourceType { - # ... on DataSourceSpecConfigurationTime { - # conditions { - # operator - # value - # } - # } - # } - # } - # ... on DataSourceDefinitionExternal { - # sourceType { - # ... on DataSourceSpecConfiguration { - # signers { - # signer { - # ... on PubKey { - # key - # } - # ... on ETHAddress { - # address - # } - # } - # } - # filters { - # key { - # name - # type - # } - # conditions { - # operator - # value - # } - # } - # } - # } - # } - # } - # } + quoteName dataSourceSpecBinding { settlementDataProperty tradingTerminationProperty } - } - ... on UpdatePerpetualProduct { - quoteName dataSourceSpecForSettlementData { sourceType { ... on DataSourceDefinitionInternal { @@ -349,14 +185,19 @@ query Proposal( } } } - dataSourceSpecBinding { - settlementDataProperty - settlementScheduleProperty + } + ... on PerpetualProduct { + settlementAsset { + id + name + symbol + decimals + quantum } + quoteName } } } - metadata priceMonitoringParameters { triggers { horizonSecs @@ -370,71 +211,232 @@ query Proposal( scalingFactor } } - riskParameters { - ... on UpdateMarketSimpleRiskModel { - simple { - factorLong - factorShort + positionDecimalPlaces + linearSlippageFactor + quadraticSlippageFactor + } + ... on UpdateMarket { + marketId + updateMarketConfiguration { + instrument { + code + product { + ... on UpdateFutureProduct { + quoteName + dataSourceSpecForSettlementData { + sourceType { + ... on DataSourceDefinitionInternal { + sourceType { + ... on DataSourceSpecConfigurationTime { + conditions { + operator + value + } + } + } + } + ... on DataSourceDefinitionExternal { + sourceType { + ... on DataSourceSpecConfiguration { + signers { + signer { + ... on PubKey { + key + } + ... on ETHAddress { + address + } + } + } + filters { + key { + name + type + } + conditions { + operator + value + } + } + } + } + } + } + } + # dataSourceSpecForTradingTermination { + # sourceType { + # ... on DataSourceDefinitionInternal { + # sourceType { + # ... on DataSourceSpecConfigurationTime { + # conditions { + # operator + # value + # } + # } + # } + # } + # ... on DataSourceDefinitionExternal { + # sourceType { + # ... on DataSourceSpecConfiguration { + # signers { + # signer { + # ... on PubKey { + # key + # } + # ... on ETHAddress { + # address + # } + # } + # } + # filters { + # key { + # name + # type + # } + # conditions { + # operator + # value + # } + # } + # } + # } + # } + # } + # } + dataSourceSpecBinding { + settlementDataProperty + tradingTerminationProperty + } + } + ... on UpdatePerpetualProduct { + quoteName + dataSourceSpecForSettlementData { + sourceType { + ... on DataSourceDefinitionInternal { + sourceType { + ... on DataSourceSpecConfigurationTime { + conditions { + operator + value + } + } + } + } + ... on DataSourceDefinitionExternal { + sourceType { + ... on DataSourceSpecConfiguration { + signers { + signer { + ... on PubKey { + key + } + ... on ETHAddress { + address + } + } + } + filters { + key { + name + type + } + conditions { + operator + value + } + } + } + } + } + } + } + dataSourceSpecBinding { + settlementDataProperty + settlementScheduleProperty + } + } } } - ... on UpdateMarketLogNormalRiskModel { - logNormal { - riskAversionParameter - tau - params { - r - sigma - mu + metadata + priceMonitoringParameters { + triggers { + horizonSecs + probability + auctionExtensionSecs + } + } + liquidityMonitoringParameters { + targetStakeParameters { + timeWindow + scalingFactor + } + } + riskParameters { + ... on UpdateMarketSimpleRiskModel { + simple { + factorLong + factorShort + } + } + ... on UpdateMarketLogNormalRiskModel { + logNormal { + riskAversionParameter + tau + params { + r + sigma + mu + } } } } } } - } - ... on NewAsset { - name - symbol - decimals - quantum - source { - ... on BuiltinAsset { - maxFaucetAmountMint - } - ... on ERC20 { - contractAddress - lifetimeLimit - withdrawThreshold + ... on NewAsset { + name + symbol + decimals + quantum + source { + ... on BuiltinAsset { + maxFaucetAmountMint + } + ... on ERC20 { + contractAddress + lifetimeLimit + withdrawThreshold + } } } - } - ... on UpdateNetworkParameter { - networkParameter { - key - value + ... on UpdateNetworkParameter { + networkParameter { + key + value + } } - } - ... on UpdateAsset { - quantum - assetId - source { - ... on UpdateERC20 { - lifetimeLimit - withdrawThreshold + ... on UpdateAsset { + quantum + assetId + source { + ... on UpdateERC20 { + lifetimeLimit + withdrawThreshold + } } } } } - } - votes { - yes { - totalTokens - totalNumber - totalEquityLikeShareWeight - } - no { - totalTokens - totalNumber - totalEquityLikeShareWeight + votes { + yes { + totalTokens + totalNumber + totalEquityLikeShareWeight + } + no { + totalTokens + totalNumber + totalEquityLikeShareWeight + } } } } diff --git a/apps/governance/src/routes/proposals/proposal/__generated__/Proposal.ts b/apps/governance/src/routes/proposals/proposal/__generated__/Proposal.ts index bec6b4172..ba537b6d2 100644 --- a/apps/governance/src/routes/proposals/proposal/__generated__/Proposal.ts +++ b/apps/governance/src/routes/proposals/proposal/__generated__/Proposal.ts @@ -19,7 +19,7 @@ export type ProposalQueryVariables = Types.Exact<{ }>; -export type ProposalQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', id?: string | null, reference: string, state: Types.ProposalState, datetime: any, rejectionReason?: Types.ProposalRejectionReason | null, errorDetails?: string | null, rationale: { __typename?: 'ProposalRationale', title: string, description: string }, party: { __typename?: 'Party', id: string }, terms: { __typename?: 'ProposalTerms', closingDatetime: any, enactmentDatetime?: any | null, change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset', name: string, symbol: string, decimals: number, quantum: string, source: { __typename?: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename?: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string } } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', decimalPlaces: number, metadata?: Array | null, positionDecimalPlaces: number, linearSlippageFactor: string, quadraticSlippageFactor: string, riskParameters: { __typename?: 'LogNormalRiskModel', riskAversionParameter: number, tau: number, params: { __typename?: 'LogNormalModelParams', mu: number, r: number, sigma: number } } | { __typename?: 'SimpleRiskModel', params: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } }, instrument: { __typename?: 'InstrumentConfiguration', name: string, code: string, product?: { __typename: 'FutureProduct', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string }, dataSourceSpecBinding: { __typename?: 'DataSourceSpecToFutureBinding', settlementDataProperty: string, tradingTerminationProperty: string }, dataSourceSpecForSettlementData: { __typename?: 'DataSourceDefinition', sourceType: { __typename?: 'DataSourceDefinitionExternal', sourceType: { __typename?: 'DataSourceSpecConfiguration', signers?: Array<{ __typename?: 'Signer', signer: { __typename?: 'ETHAddress', address?: string | null } | { __typename?: 'PubKey', key?: string | null } }> | null, filters?: Array<{ __typename?: 'Filter', key: { __typename?: 'PropertyKey', name?: string | null, type: Types.PropertyKeyType }, conditions?: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null }> | null }> | null } | { __typename?: 'EthCallSpec' } } | { __typename?: 'DataSourceDefinitionInternal', sourceType: { __typename?: 'DataSourceSpecConfigurationTime', conditions: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null } | null> } | { __typename?: 'DataSourceSpecConfigurationTimeTrigger' } } } } | { __typename: 'PerpetualProduct', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string } } | { __typename: 'SpotProduct' } | null }, priceMonitoringParameters: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null }, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } } } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset', quantum: string, assetId: string, source: { __typename?: 'UpdateERC20', lifetimeLimit: string, withdrawThreshold: string } } | { __typename?: 'UpdateMarket', marketId: string, updateMarketConfiguration: { __typename?: 'UpdateMarketConfiguration', metadata?: Array | null, instrument: { __typename?: 'UpdateInstrumentConfiguration', code: string, product: { __typename?: 'UpdateFutureProduct', quoteName: string, dataSourceSpecForSettlementData: { __typename?: 'DataSourceDefinition', sourceType: { __typename?: 'DataSourceDefinitionExternal', sourceType: { __typename?: 'DataSourceSpecConfiguration', signers?: Array<{ __typename?: 'Signer', signer: { __typename?: 'ETHAddress', address?: string | null } | { __typename?: 'PubKey', key?: string | null } }> | null, filters?: Array<{ __typename?: 'Filter', key: { __typename?: 'PropertyKey', name?: string | null, type: Types.PropertyKeyType }, conditions?: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null }> | null }> | null } | { __typename?: 'EthCallSpec' } } | { __typename?: 'DataSourceDefinitionInternal', sourceType: { __typename?: 'DataSourceSpecConfigurationTime', conditions: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null } | null> } | { __typename?: 'DataSourceSpecConfigurationTimeTrigger' } } }, dataSourceSpecBinding: { __typename?: 'DataSourceSpecToFutureBinding', settlementDataProperty: string, tradingTerminationProperty: string } } | { __typename?: 'UpdatePerpetualProduct', quoteName: string, dataSourceSpecForSettlementData: { __typename?: 'DataSourceDefinition', sourceType: { __typename?: 'DataSourceDefinitionExternal', sourceType: { __typename?: 'DataSourceSpecConfiguration', signers?: Array<{ __typename?: 'Signer', signer: { __typename?: 'ETHAddress', address?: string | null } | { __typename?: 'PubKey', key?: string | null } }> | null, filters?: Array<{ __typename?: 'Filter', key: { __typename?: 'PropertyKey', name?: string | null, type: Types.PropertyKeyType }, conditions?: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null }> | null }> | null } | { __typename?: 'EthCallSpec' } } | { __typename?: 'DataSourceDefinitionInternal', sourceType: { __typename?: 'DataSourceSpecConfigurationTime', conditions: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null } | null> } | { __typename?: 'DataSourceSpecConfigurationTimeTrigger' } } }, dataSourceSpecBinding: { __typename?: 'DataSourceSpecPerpetualBinding', settlementDataProperty: string, settlementScheduleProperty: string } } }, priceMonitoringParameters: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null }, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } }, riskParameters: { __typename?: 'UpdateMarketLogNormalRiskModel', logNormal?: { __typename?: 'LogNormalRiskModel', riskAversionParameter: number, tau: number, params: { __typename?: 'LogNormalModelParams', r: number, sigma: number, mu: number } } | null } | { __typename?: 'UpdateMarketSimpleRiskModel', simple?: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } | null } } } | { __typename?: 'UpdateMarketState', updateType: Types.MarketUpdateType, price?: string | null, market: { __typename?: 'Market', decimalPlaces: number, id: string, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, code: string, product: { __typename: 'Future', quoteName: string } | { __typename: 'Perpetual', quoteName: string } | { __typename: 'Spot' } } } } } | { __typename?: 'UpdateNetworkParameter', networkParameter: { __typename?: 'NetworkParameter', key: string, value: string } } | { __typename?: 'UpdateReferralProgram', windowLength: number, endOfProgram: any, benefitTiers: Array<{ __typename?: 'BenefitTier', minimumEpochs: number, minimumRunningNotionalTakerVolume: string, referralDiscountFactor: string, referralRewardFactor: string }>, stakingTiers: Array<{ __typename?: 'StakingTier', minimumStakedTokens: string, referralRewardMultiplier: string }> } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram', endOfProgramTimestamp: any, windowLength: number, benefitTiers: Array<{ __typename?: 'VolumeBenefitTier', minimumRunningNotionalTakerVolume: string, volumeDiscountFactor: string }> } }, votes: { __typename?: 'ProposalVotes', yes: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, totalEquityLikeShareWeight: string }, no: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, totalEquityLikeShareWeight: string } } } | null }; +export type ProposalQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, reference: string, state: Types.ProposalState, datetime: any, rejectionReason?: Types.ProposalRejectionReason | null, errorDetails?: string | null, rationale: { __typename?: 'ProposalRationale', title: string, description: string }, party: { __typename?: 'Party', id: string }, terms: { __typename?: 'ProposalTerms', closingDatetime: any, enactmentDatetime?: any | null, change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset', name: string, symbol: string, decimals: number, quantum: string, source: { __typename?: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename?: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string } } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', decimalPlaces: number, metadata?: Array | null, positionDecimalPlaces: number, linearSlippageFactor: string, quadraticSlippageFactor: string, riskParameters: { __typename?: 'LogNormalRiskModel', riskAversionParameter: number, tau: number, params: { __typename?: 'LogNormalModelParams', mu: number, r: number, sigma: number } } | { __typename?: 'SimpleRiskModel', params: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } }, instrument: { __typename?: 'InstrumentConfiguration', name: string, code: string, product?: { __typename: 'FutureProduct', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string }, dataSourceSpecBinding: { __typename?: 'DataSourceSpecToFutureBinding', settlementDataProperty: string, tradingTerminationProperty: string }, dataSourceSpecForSettlementData: { __typename?: 'DataSourceDefinition', sourceType: { __typename?: 'DataSourceDefinitionExternal', sourceType: { __typename?: 'DataSourceSpecConfiguration', signers?: Array<{ __typename?: 'Signer', signer: { __typename?: 'ETHAddress', address?: string | null } | { __typename?: 'PubKey', key?: string | null } }> | null, filters?: Array<{ __typename?: 'Filter', key: { __typename?: 'PropertyKey', name?: string | null, type: Types.PropertyKeyType }, conditions?: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null }> | null }> | null } | { __typename?: 'EthCallSpec' } } | { __typename?: 'DataSourceDefinitionInternal', sourceType: { __typename?: 'DataSourceSpecConfigurationTime', conditions: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null } | null> } | { __typename?: 'DataSourceSpecConfigurationTimeTrigger' } } } } | { __typename: 'PerpetualProduct', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string } } | { __typename: 'SpotProduct' } | null }, priceMonitoringParameters: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null }, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } } } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset', quantum: string, assetId: string, source: { __typename?: 'UpdateERC20', lifetimeLimit: string, withdrawThreshold: string } } | { __typename?: 'UpdateMarket', marketId: string, updateMarketConfiguration: { __typename?: 'UpdateMarketConfiguration', metadata?: Array | null, instrument: { __typename?: 'UpdateInstrumentConfiguration', code: string, product: { __typename?: 'UpdateFutureProduct', quoteName: string, dataSourceSpecForSettlementData: { __typename?: 'DataSourceDefinition', sourceType: { __typename?: 'DataSourceDefinitionExternal', sourceType: { __typename?: 'DataSourceSpecConfiguration', signers?: Array<{ __typename?: 'Signer', signer: { __typename?: 'ETHAddress', address?: string | null } | { __typename?: 'PubKey', key?: string | null } }> | null, filters?: Array<{ __typename?: 'Filter', key: { __typename?: 'PropertyKey', name?: string | null, type: Types.PropertyKeyType }, conditions?: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null }> | null }> | null } | { __typename?: 'EthCallSpec' } } | { __typename?: 'DataSourceDefinitionInternal', sourceType: { __typename?: 'DataSourceSpecConfigurationTime', conditions: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null } | null> } | { __typename?: 'DataSourceSpecConfigurationTimeTrigger' } } }, dataSourceSpecBinding: { __typename?: 'DataSourceSpecToFutureBinding', settlementDataProperty: string, tradingTerminationProperty: string } } | { __typename?: 'UpdatePerpetualProduct', quoteName: string, dataSourceSpecForSettlementData: { __typename?: 'DataSourceDefinition', sourceType: { __typename?: 'DataSourceDefinitionExternal', sourceType: { __typename?: 'DataSourceSpecConfiguration', signers?: Array<{ __typename?: 'Signer', signer: { __typename?: 'ETHAddress', address?: string | null } | { __typename?: 'PubKey', key?: string | null } }> | null, filters?: Array<{ __typename?: 'Filter', key: { __typename?: 'PropertyKey', name?: string | null, type: Types.PropertyKeyType }, conditions?: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null }> | null }> | null } | { __typename?: 'EthCallSpec' } } | { __typename?: 'DataSourceDefinitionInternal', sourceType: { __typename?: 'DataSourceSpecConfigurationTime', conditions: Array<{ __typename?: 'Condition', operator: Types.ConditionOperator, value?: string | null } | null> } | { __typename?: 'DataSourceSpecConfigurationTimeTrigger' } } }, dataSourceSpecBinding: { __typename?: 'DataSourceSpecPerpetualBinding', settlementDataProperty: string, settlementScheduleProperty: string } } }, priceMonitoringParameters: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null }, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } }, riskParameters: { __typename?: 'UpdateMarketLogNormalRiskModel', logNormal?: { __typename?: 'LogNormalRiskModel', riskAversionParameter: number, tau: number, params: { __typename?: 'LogNormalModelParams', r: number, sigma: number, mu: number } } | null } | { __typename?: 'UpdateMarketSimpleRiskModel', simple?: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } | null } } } | { __typename?: 'UpdateMarketState', updateType: Types.MarketUpdateType, price?: string | null, market: { __typename?: 'Market', decimalPlaces: number, id: string, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, code: string, product: { __typename: 'Future', quoteName: string } | { __typename: 'Perpetual', quoteName: string } | { __typename: 'Spot' } } } } } | { __typename?: 'UpdateNetworkParameter', networkParameter: { __typename?: 'NetworkParameter', key: string, value: string } } | { __typename?: 'UpdateReferralProgram', windowLength: number, endOfProgram: any, benefitTiers: Array<{ __typename?: 'BenefitTier', minimumEpochs: number, minimumRunningNotionalTakerVolume: string, referralDiscountFactor: string, referralRewardFactor: string }>, stakingTiers: Array<{ __typename?: 'StakingTier', minimumStakedTokens: string, referralRewardMultiplier: string }> } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram', endOfProgramTimestamp: any, windowLength: number, benefitTiers: Array<{ __typename?: 'VolumeBenefitTier', minimumRunningNotionalTakerVolume: string, volumeDiscountFactor: string }> } }, votes: { __typename?: 'ProposalVotes', yes: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, totalEquityLikeShareWeight: string }, no: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, totalEquityLikeShareWeight: string } } } | null }; export const NewMarketProductFieldFragmentDoc = gql` fragment NewMarketProductField on Proposal { @@ -109,189 +109,65 @@ export const UpdateVolumeDiscountProgramFragmentDoc = gql` export const ProposalDocument = gql` query Proposal($proposalId: ID!, $includeNewMarketProductField: Boolean!, $includeUpdateMarketState: Boolean!, $includeUpdateReferralProgram: Boolean!) { proposal(id: $proposalId) { - id - rationale { - title - description - } - reference - state - datetime - rejectionReason - party { + ... on Proposal { id - } - errorDetails - ...NewMarketProductField @include(if: $includeNewMarketProductField) - ...UpdateMarketState @include(if: $includeUpdateMarketState) - ...UpdateReferralProgram @include(if: $includeUpdateReferralProgram) - ...UpdateVolumeDiscountProgram - terms { - closingDatetime - enactmentDatetime - change { - ... on NewMarket { - decimalPlaces - metadata - riskParameters { - ... on LogNormalRiskModel { - riskAversionParameter - tau - params { - mu - r - sigma - } - } - ... on SimpleRiskModel { - params { - factorLong - factorShort - } - } - } - instrument { - name - code - product { - ... on FutureProduct { - settlementAsset { - id - name - symbol - decimals - quantum - } - quoteName - dataSourceSpecBinding { - settlementDataProperty - tradingTerminationProperty - } - dataSourceSpecForSettlementData { - sourceType { - ... on DataSourceDefinitionInternal { - sourceType { - ... on DataSourceSpecConfigurationTime { - conditions { - operator - value - } - } - } - } - ... on DataSourceDefinitionExternal { - sourceType { - ... on DataSourceSpecConfiguration { - signers { - signer { - ... on PubKey { - key - } - ... on ETHAddress { - address - } - } - } - filters { - key { - name - type - } - conditions { - operator - value - } - } - } - } - } - } + rationale { + title + description + } + reference + state + datetime + rejectionReason + party { + id + } + errorDetails + ...NewMarketProductField @include(if: $includeNewMarketProductField) + ...UpdateMarketState @include(if: $includeUpdateMarketState) + ...UpdateReferralProgram @include(if: $includeUpdateReferralProgram) + ...UpdateVolumeDiscountProgram + terms { + closingDatetime + enactmentDatetime + change { + ... on NewMarket { + decimalPlaces + metadata + riskParameters { + ... on LogNormalRiskModel { + riskAversionParameter + tau + params { + mu + r + sigma } } - ... on PerpetualProduct { - settlementAsset { - id - name - symbol - decimals - quantum + ... on SimpleRiskModel { + params { + factorLong + factorShort } - quoteName } } - } - priceMonitoringParameters { - triggers { - horizonSecs - probability - auctionExtensionSecs - } - } - liquidityMonitoringParameters { - targetStakeParameters { - timeWindow - scalingFactor - } - } - positionDecimalPlaces - linearSlippageFactor - quadraticSlippageFactor - } - ... on UpdateMarket { - marketId - updateMarketConfiguration { instrument { + name code product { - ... on UpdateFutureProduct { - quoteName - dataSourceSpecForSettlementData { - sourceType { - ... on DataSourceDefinitionInternal { - sourceType { - ... on DataSourceSpecConfigurationTime { - conditions { - operator - value - } - } - } - } - ... on DataSourceDefinitionExternal { - sourceType { - ... on DataSourceSpecConfiguration { - signers { - signer { - ... on PubKey { - key - } - ... on ETHAddress { - address - } - } - } - filters { - key { - name - type - } - conditions { - operator - value - } - } - } - } - } - } + ... on FutureProduct { + settlementAsset { + id + name + symbol + decimals + quantum } + quoteName dataSourceSpecBinding { settlementDataProperty tradingTerminationProperty } - } - ... on UpdatePerpetualProduct { - quoteName dataSourceSpecForSettlementData { sourceType { ... on DataSourceDefinitionInternal { @@ -332,14 +208,19 @@ export const ProposalDocument = gql` } } } - dataSourceSpecBinding { - settlementDataProperty - settlementScheduleProperty + } + ... on PerpetualProduct { + settlementAsset { + id + name + symbol + decimals + quantum } + quoteName } } } - metadata priceMonitoringParameters { triggers { horizonSecs @@ -353,71 +234,192 @@ export const ProposalDocument = gql` scalingFactor } } - riskParameters { - ... on UpdateMarketSimpleRiskModel { - simple { - factorLong - factorShort + positionDecimalPlaces + linearSlippageFactor + quadraticSlippageFactor + } + ... on UpdateMarket { + marketId + updateMarketConfiguration { + instrument { + code + product { + ... on UpdateFutureProduct { + quoteName + dataSourceSpecForSettlementData { + sourceType { + ... on DataSourceDefinitionInternal { + sourceType { + ... on DataSourceSpecConfigurationTime { + conditions { + operator + value + } + } + } + } + ... on DataSourceDefinitionExternal { + sourceType { + ... on DataSourceSpecConfiguration { + signers { + signer { + ... on PubKey { + key + } + ... on ETHAddress { + address + } + } + } + filters { + key { + name + type + } + conditions { + operator + value + } + } + } + } + } + } + } + dataSourceSpecBinding { + settlementDataProperty + tradingTerminationProperty + } + } + ... on UpdatePerpetualProduct { + quoteName + dataSourceSpecForSettlementData { + sourceType { + ... on DataSourceDefinitionInternal { + sourceType { + ... on DataSourceSpecConfigurationTime { + conditions { + operator + value + } + } + } + } + ... on DataSourceDefinitionExternal { + sourceType { + ... on DataSourceSpecConfiguration { + signers { + signer { + ... on PubKey { + key + } + ... on ETHAddress { + address + } + } + } + filters { + key { + name + type + } + conditions { + operator + value + } + } + } + } + } + } + } + dataSourceSpecBinding { + settlementDataProperty + settlementScheduleProperty + } + } } } - ... on UpdateMarketLogNormalRiskModel { - logNormal { - riskAversionParameter - tau - params { - r - sigma - mu + metadata + priceMonitoringParameters { + triggers { + horizonSecs + probability + auctionExtensionSecs + } + } + liquidityMonitoringParameters { + targetStakeParameters { + timeWindow + scalingFactor + } + } + riskParameters { + ... on UpdateMarketSimpleRiskModel { + simple { + factorLong + factorShort + } + } + ... on UpdateMarketLogNormalRiskModel { + logNormal { + riskAversionParameter + tau + params { + r + sigma + mu + } } } } } } - } - ... on NewAsset { - name - symbol - decimals - quantum - source { - ... on BuiltinAsset { - maxFaucetAmountMint - } - ... on ERC20 { - contractAddress - lifetimeLimit - withdrawThreshold + ... on NewAsset { + name + symbol + decimals + quantum + source { + ... on BuiltinAsset { + maxFaucetAmountMint + } + ... on ERC20 { + contractAddress + lifetimeLimit + withdrawThreshold + } } } - } - ... on UpdateNetworkParameter { - networkParameter { - key - value + ... on UpdateNetworkParameter { + networkParameter { + key + value + } } - } - ... on UpdateAsset { - quantum - assetId - source { - ... on UpdateERC20 { - lifetimeLimit - withdrawThreshold + ... on UpdateAsset { + quantum + assetId + source { + ... on UpdateERC20 { + lifetimeLimit + withdrawThreshold + } } } } } - } - votes { - yes { - totalTokens - totalNumber - totalEquityLikeShareWeight - } - no { - totalTokens - totalNumber - totalEquityLikeShareWeight + votes { + yes { + totalTokens + totalNumber + totalEquityLikeShareWeight + } + no { + totalTokens + totalNumber + totalEquityLikeShareWeight + } } } } diff --git a/libs/proposals/src/lib/proposals-hooks/Proposal.graphql b/libs/proposals/src/lib/proposals-hooks/Proposal.graphql index 54441be42..009fa78dd 100644 --- a/libs/proposals/src/lib/proposals-hooks/Proposal.graphql +++ b/libs/proposals/src/lib/proposals-hooks/Proposal.graphql @@ -39,22 +39,26 @@ subscription OnProposal { query ProposalOfMarket($marketId: ID!) { proposal(id: $marketId) { - id - terms { - enactmentDatetime + ... on Proposal { + id + terms { + enactmentDatetime + } } } } query SuccessorMarketProposalDetails($proposalId: ID!) { proposal(id: $proposalId) { - id - terms { - change { - ... on NewMarket { - successorConfiguration { - parentMarketId - insurancePoolFraction + ... on Proposal { + id + terms { + change { + ... on NewMarket { + successorConfiguration { + parentMarketId + insurancePoolFraction + } } } } @@ -75,11 +79,13 @@ query InstrumentDetails($marketId: ID!) { query NewTransferDetails($proposalId: ID!) { proposal(id: $proposalId) { - id - terms { - change { - ... on NewTransfer { - ...NewTransferFields + ... on Proposal { + id + terms { + change { + ... on NewTransfer { + ...NewTransferFields + } } } } @@ -88,11 +94,13 @@ query NewTransferDetails($proposalId: ID!) { query CancelTransferDetails($proposalId: ID!) { proposal(id: $proposalId) { - id - terms { - change { - ... on CancelTransfer { - ...CancelTransferFields + ... on Proposal { + id + terms { + change { + ... on CancelTransfer { + ...CancelTransferFields + } } } } diff --git a/libs/proposals/src/lib/proposals-hooks/__generated__/Proposal.ts b/libs/proposals/src/lib/proposals-hooks/__generated__/Proposal.ts index 38a12574b..d4e1a5cd4 100644 --- a/libs/proposals/src/lib/proposals-hooks/__generated__/Proposal.ts +++ b/libs/proposals/src/lib/proposals-hooks/__generated__/Proposal.ts @@ -25,14 +25,14 @@ export type ProposalOfMarketQueryVariables = Types.Exact<{ }>; -export type ProposalOfMarketQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', enactmentDatetime?: any | null } } | null }; +export type ProposalOfMarketQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', enactmentDatetime?: any | null } } | null }; export type SuccessorMarketProposalDetailsQueryVariables = Types.Exact<{ proposalId: Types.Scalars['ID']; }>; -export type SuccessorMarketProposalDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', successorConfiguration?: { __typename?: 'SuccessorConfiguration', parentMarketId: string, insurancePoolFraction: string } | null } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } } | null }; +export type SuccessorMarketProposalDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', successorConfiguration?: { __typename?: 'SuccessorConfiguration', parentMarketId: string, insurancePoolFraction: string } | null } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } } | null }; export type InstrumentDetailsQueryVariables = Types.Exact<{ marketId: Types.Scalars['ID']; @@ -46,14 +46,14 @@ export type NewTransferDetailsQueryVariables = Types.Exact<{ }>; -export type NewTransferDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket' } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer', source: string, sourceType: Types.AccountType, destination: string, destinationType: Types.AccountType, fraction_of_balance: string, amount: string, transferType: Types.GovernanceTransferType, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number, quantum: string }, kind: { __typename: 'OneOffGovernanceTransfer', deliverOn?: any | null } | { __typename: 'RecurringGovernanceTransfer', startEpoch: number, endEpoch?: number | null } } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } } | null }; +export type NewTransferDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', change: { __typename?: 'CancelTransfer' } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket' } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer', source: string, sourceType: Types.AccountType, destination: string, destinationType: Types.AccountType, fraction_of_balance: string, amount: string, transferType: Types.GovernanceTransferType, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number, quantum: string }, kind: { __typename: 'OneOffGovernanceTransfer', deliverOn?: any | null } | { __typename: 'RecurringGovernanceTransfer', startEpoch: number, endEpoch?: number | null } } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } } | null }; export type CancelTransferDetailsQueryVariables = Types.Exact<{ proposalId: Types.Scalars['ID']; }>; -export type CancelTransferDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', change: { __typename?: 'CancelTransfer', transferId: string } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket' } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } } | null }; +export type CancelTransferDetailsQuery = { __typename?: 'Query', proposal?: { __typename?: 'BatchProposal' } | { __typename?: 'Proposal', id?: string | null, terms: { __typename?: 'ProposalTerms', change: { __typename?: 'CancelTransfer', transferId: string } | { __typename?: 'NewAsset' } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket' } | { __typename?: 'NewSpotMarket' } | { __typename?: 'NewTransfer' } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket' } | { __typename?: 'UpdateMarketState' } | { __typename?: 'UpdateNetworkParameter' } | { __typename?: 'UpdateReferralProgram' } | { __typename?: 'UpdateSpotMarket' } | { __typename?: 'UpdateVolumeDiscountProgram' } } } | null }; export const ProposalEventFieldsFragmentDoc = gql` fragment ProposalEventFields on Proposal { @@ -146,9 +146,11 @@ export type OnProposalSubscriptionResult = Apollo.SubscriptionResult; + /** Proposal ID that is provided by Vega once proposal reaches the network */ + id?: Maybe; + /** Party that prepared the proposal */ + party: Party; + /** Rationale behind the proposal */ + rationale: ProposalRationale; + /** A UUID reference to aid tracking proposals on Vega */ + reference: Scalars['String']; + /** Reason the proposal was rejected */ + rejectionReason?: Maybe; + /** Equity-like share required for a market amendment proposal to be enacted, represented as a fraction that can be converted to a percentage. If not met, the proposal will not be enacted */ + requiredLpMajority?: Maybe; + /** The market share of LPs' equity-like share that must take part in a market amendment vote for the proposal to pass. This means the votes of LPs that have submitted more liquidity to that market, or have been LPs from the start carry more weight. If it requires 50% of a market's equity-like share for a majority, and the full batch of proposals receives all YES votes but only LPs with 49% of the equity-like share voted, the proposal will not pass */ + requiredLpParticipation?: Maybe; + /** Required majority for this proposal to succeed */ + requiredMajority: Scalars['String']; + /** Required participation for this proposal to succeed */ + requiredParticipation: Scalars['String']; + /** State of the proposal */ + state: ProposalState; + /** Proposals that are part of the batch */ + subProposals?: Maybe>>; + /** Votes cast for this proposal */ + votes: ProposalVotes; +}; + +/** The rationale for the proposal */ +export type BatchProposalTerms = { + __typename?: 'BatchProposalTerms'; + /** Actual changes being introduced by the proposal - actions the proposal triggers if passed and enacted. */ + changes: Array>; + /** + * RFC3339Nano time and date when voting closes for this proposal. + * Constrained by "minClose" and "maxClose" network parameters. + */ + closingDatetime: Scalars['Timestamp']; +}; + +/** Terms for a batch governance proposal */ +export type BatchProposalTermsChange = { + __typename?: 'BatchProposalTermsChange'; + /** Actual change being introduced by the proposal - action the proposal triggers if passed and enacted. */ + change: ProposalChange; + /** + * RFC3339Nano time and date when this proposal will be executed, if it passes. + * Constrained by "minEnactInSeconds" and "maxEnactInSeconds" network parameters. + */ + enactmentDatetime?: Maybe; +}; + export type BenefitTier = { __typename?: 'BenefitTier'; /** The minimum number of epochs the party needs to be in the referral set to be eligible for the benefit */ @@ -444,6 +502,35 @@ export type CandleEdge = { node: Candle; }; +export type CompositePriceConfiguration = { + __typename?: 'CompositePriceConfiguration'; + /** Composite price calculation methodology */ + CompositePriceType: CompositePriceType; + /** Staleness tolerance duration for each given price sources in the order mentioned above */ + SourceStalenessTolerance: Array; + /** Weights for each given price source, first entry is price from trade, then price from book, then first oracle, next oracle, etc. And last entry is for median price */ + SourceWeights?: Maybe>; + /** Cash amount used in calculating mark price from the order book */ + cashAmount: Scalars['String']; + /** Oracle configuration for external composite price sources */ + dataSourcesSpec?: Maybe>>; + /** Spec bindings for external composite price sources */ + dataSourcesSpecBinding?: Maybe>>; + /** Decay power used in calculating time weight for a given trade */ + decayPower: Scalars['Int']; + /** Decay weight used in calculating time weight for a given trade */ + decayWeight: Scalars['String']; +}; + +export enum CompositePriceType { + /** Composite price is set to the last trade (legacy) */ + COMPOSITE_PRICE_TYPE_LAST_TRADE = 'COMPOSITE_PRICE_TYPE_LAST_TRADE', + /** Composite price is calculated as a median of the underlying price sources */ + COMPOSITE_PRICE_TYPE_MEDIAN = 'COMPOSITE_PRICE_TYPE_MEDIAN', + /** Composite price is calculated as a weighted average of the underlying price sources */ + COMPOSITE_PRICE_TYPE_WEIGHTED = 'COMPOSITE_PRICE_TYPE_WEIGHTED' +} + /** Condition describes the condition that must be validated by the data source engine */ export type Condition = { __typename?: 'Condition'; @@ -1135,6 +1222,15 @@ export type Erc20WithdrawalDetails = { receiverAddress: Scalars['String']; }; +/** EstimatedTransferFee Results of estimation of transfer fee and the fee discount */ +export type EstimatedTransferFee = { + __typename?: 'EstimatedTransferFee'; + /** Discount applied to the fee. */ + discount: Scalars['String']; + /** Estimated fee for the transfer. */ + fee: Scalars['String']; +}; + /** * Specifies a data source that derives its content from calling a read method * on an Ethereum contract. @@ -1274,6 +1370,8 @@ export type Fees = { __typename?: 'Fees'; /** The factors used to calculate the different fees */ factors: FeeFactors; + /** Liquidity fee settings for the market describing how the fee was calculated */ + liquidityFeeSettings?: Maybe; }; /** Fees that have been applied on a specific market/asset up to the given epoch. */ @@ -1476,6 +1574,39 @@ export type FutureProduct = { settlementAsset: Asset; }; +/** Game metrics for a given epoch */ +export type Game = { + __typename?: 'Game'; + /** Entities that were rewarded during the epoch. */ + entities: Array; + /** Epoch during which the metrics were calculated. */ + epoch: Scalars['Int']; + /** ID of the game. */ + id: Scalars['ID']; + /** Number of participants that took part in the game during the epoch. */ + numberOfParticipants: Scalars['Int']; +}; + +/** Edge type containing the game metrics and cursor information returned by a GameConnection */ +export type GameEdge = { + __typename?: 'GameEdge'; + /** Cursor identifying the game */ + cursor: Scalars['String']; + /** Game information and metrics. */ + node: Game; +}; + +export type GameEntity = IndividualGameEntity | TeamGameEntity; + +/** Connection type for retrieving cursor-based paginated game information */ +export type GamesConnection = { + __typename?: 'GamesConnection'; + /** Page of game edges for the connection */ + edges?: Maybe>>; + /** Current page information */ + pageInfo?: Maybe; +}; + export type GovernanceTransferKind = OneOffGovernanceTransfer | RecurringGovernanceTransfer; export enum GovernanceTransferType { @@ -1509,6 +1640,23 @@ export type IcebergOrder = { reservedRemaining: Scalars['String']; }; +/** Individual party participating in a game and their metrics */ +export type IndividualGameEntity = { + __typename?: 'IndividualGameEntity'; + /** Party ID of the participant */ + individual: Scalars['ID']; + /** The rank of the individual within the game. If the individual is in a team, then the rank of the individual in the team */ + rank: Scalars['Int']; + /** The rewards earned by the individual during the epoch */ + rewardEarned: Scalars['String']; + /** The reward metric applied to the game */ + rewardMetric: Scalars['String']; + /** Total rewards earned by the individual during the game */ + totalRewardsEarned: Scalars['String']; + /** The volume traded by the individual */ + volume: Scalars['String']; +}; + export enum IndividualScope { /** All parties on the network are within the scope of this reward */ INDIVIDUAL_SCOPE_ALL = 'INDIVIDUAL_SCOPE_ALL', @@ -1576,12 +1724,22 @@ export enum Interval { INTERVAL_I1H = 'INTERVAL_I1H', /** 1 minute interval */ INTERVAL_I1M = 'INTERVAL_I1M', + /** 4 hour interval */ + INTERVAL_I4H = 'INTERVAL_I4H', /** 5 minute interval */ INTERVAL_I5M = 'INTERVAL_I5M', /** 6 hour interval */ INTERVAL_I6H = 'INTERVAL_I6H', + /** 7 day interval */ + INTERVAL_I7D = 'INTERVAL_I7D', + /** 8 hour interval */ + INTERVAL_I8H = 'INTERVAL_I8H', + /** 12 hour interval */ + INTERVAL_I12H = 'INTERVAL_I12H', /** 15 minute interval (default) */ - INTERVAL_I15M = 'INTERVAL_I15M' + INTERVAL_I15M = 'INTERVAL_I15M', + /** 30 minute interval */ + INTERVAL_I30M = 'INTERVAL_I30M' } /** A node's key rotation event */ @@ -1650,6 +1808,8 @@ export type LedgerEntryFilter = { FromAccountFilter?: InputMaybe; /** Used to set values for filtering receiver accounts. Party must be provided in this filter or from_account_filter, or both. */ ToAccountFilter?: InputMaybe; + /** Optional transfer ID to filter by. If provided, all other filters are ignored. */ + TransferId?: InputMaybe; /** List of transfer types that is used for filtering sender and receiver accounts. */ TransferTypes?: InputMaybe>>; }; @@ -1674,6 +1834,37 @@ export type LiquidationPrice = { open_volume_only: Scalars['String']; }; +export type LiquidationStrategy = { + __typename?: 'LiquidationStrategy'; + /** Specifies the fraction of its position the network will try to reduce its position by in a single disposal attempt. */ + disposalFraction: Scalars['String']; + /** Specifies the interval, in seconds, at which point the network will try to unload its position. */ + disposalTimeStep: Scalars['Int']; + /** Specifies the size of the position held by the network that it will try to dispose of in one attempt. */ + fullDisposalSize: Scalars['Int']; + /** Specifies the maximum size by which the network can reduce its position as a fraction of the volume on the book. */ + maxFractionConsumed: Scalars['String']; +}; + +export enum LiquidityFeeMethod { + /** Fee is set by the market to a constant value irrespective of any liquidity provider's nominated fee */ + METHOD_CONSTANT = 'METHOD_CONSTANT', + /** Fee is smallest value of all bids, such that liquidity providers with nominated fees less than or equal to this value still have sufficient commitment to fulfil the market's target stake. */ + METHOD_MARGINAL_COST = 'METHOD_MARGINAL_COST', + METHOD_UNSPECIFIED = 'METHOD_UNSPECIFIED', + /** Fee is the weighted average of all liquidity providers' nominated fees, weighted by their commitment */ + METHOD_WEIGHTED_AVERAGE = 'METHOD_WEIGHTED_AVERAGE' +} + +/** Market settings that describe how the liquidity fee is calculated */ +export type LiquidityFeeSettings = { + __typename?: 'LiquidityFeeSettings'; + /** Constant liquidity fee used when using the constant fee method */ + feeConstant?: Maybe; + /** Method used to calculate the market's liquidity fee */ + method: LiquidityFeeMethod; +}; + /** Configuration of a market liquidity monitoring parameters */ export type LiquidityMonitoringParameters = { __typename?: 'LiquidityMonitoringParameters'; @@ -1986,8 +2177,14 @@ export type MarginLevels = { initialLevel: Scalars['String']; /** Minimal margin for the position to be maintained in the network (unsigned integer) */ maintenanceLevel: Scalars['String']; + /** Margin factor, only relevant for isolated margin mode, else 0 */ + marginFactor: Scalars['String']; + /** Margin mode of the party, cross margin or isolated margin */ + marginMode: MarginMode; /** Market in which the margin is required for this party */ market: Market; + /** When in isolated margin, the required order margin level, otherwise, 0 */ + orderMarginLevel: Scalars['String']; /** The party for this margin */ party: Party; /** If the margin is between maintenance and search, the network will initiate a collateral search, expressed as unsigned integer */ @@ -2010,8 +2207,14 @@ export type MarginLevelsUpdate = { initialLevel: Scalars['String']; /** Minimal margin for the position to be maintained in the network (unsigned integer) */ maintenanceLevel: Scalars['String']; + /** Margin factor, only relevant for isolated margin mode, else 0 */ + marginFactor: Scalars['String']; + /** Margin mode of the party, cross margin or isolated margin */ + marginMode: MarginMode; /** Market in which the margin is required for this party */ marketId: Scalars['ID']; + /** When in isolated margin, the required order margin level, otherwise, 0 */ + orderMarginLevel: Scalars['String']; /** The party for this margin */ partyId: Scalars['ID']; /** If the margin is between maintenance and search, the network will initiate a collateral search (unsigned integer) */ @@ -2020,6 +2223,13 @@ export type MarginLevelsUpdate = { timestamp: Scalars['Timestamp']; }; +export enum MarginMode { + /** Party is in cross margin mode */ + MARGIN_MODE_CROSS_MARGIN = 'MARGIN_MODE_CROSS_MARGIN', + /** Party is in isolated margin mode */ + MARGIN_MODE_ISOLATED_MARGIN = 'MARGIN_MODE_ISOLATED_MARGIN' +} + /** Represents a product & associated parameters that can be traded on Vega, has an associated OrderBook and Trade history */ export type Market = { __typename?: 'Market'; @@ -2056,6 +2266,8 @@ export type Market = { insurancePoolFraction?: Maybe; /** Linear slippage factor is used to cap the slippage component of maintainence margin - it is applied to the slippage volume */ linearSlippageFactor: Scalars['String']; + /** Optional: Liquidation strategy for the market */ + liquidationStrategy?: Maybe; /** Liquidity monitoring parameters for the market */ liquidityMonitoringParameters: LiquidityMonitoringParameters; /** The list of the liquidity provision commitments for this market */ @@ -2067,6 +2279,10 @@ export type Market = { liquidityProvisionsConnection?: Maybe; /** Optional: Liquidity SLA parameters for the market */ liquiditySLAParameters?: Maybe; + /** Configuration driving the mark price for the market */ + markPriceConfiguration: CompositePriceConfiguration; + /** The proposal that initiated this market */ + marketProposal?: Maybe; /** Timestamps for state changes in the market */ marketTimestamps: MarketTimestamps; /** @@ -2090,9 +2306,15 @@ export type Market = { positionDecimalPlaces: Scalars['Int']; /** Price monitoring settings for the market */ priceMonitoringSettings: PriceMonitoringSettings; - /** The proposal that initiated this market */ + /** + * The proposal that initiated this market + * @deprecated Use marketProposal + */ proposal?: Maybe; - /** Quadratic slippage factor is used to cap the slippage component of maintainence margin - it is applied to the square of the slippage volume */ + /** + * Quadratic slippage factor is used to cap the slippage component of maintainence margin - it is applied to the square of the slippage volume + * @deprecated This field will be removed in a future release + */ quadraticSlippageFactor: Scalars['String']; /** Risk factors for the market */ riskFactors?: Maybe; @@ -2208,6 +2430,8 @@ export type MarketData = { liquidityProviderSla?: Maybe>; /** The mark price (an unsigned integer) */ markPrice: Scalars['String']; + /** The methodology used for the calculation of the mark price */ + markPriceType: CompositePriceType; /** Market of the associated mark price */ market: Market; /** The market growth factor for the last market time window */ @@ -2222,6 +2446,8 @@ export type MarketData = { midPrice: Scalars['String']; /** RFC3339Nano time indicating the next time positions will be marked to market */ nextMarkToMarket: Scalars['String']; + /** RFC3339Nano time indicating the next time the network will attempt to close part of its position */ + nextNetworkCloseout: Scalars['String']; /** The sum of the size of all positions greater than 0. */ openInterest: Scalars['String']; /** A list of valid price ranges per associated trigger */ @@ -2406,6 +2632,15 @@ export enum MarketUpdateType { MARKET_STATE_UPDATE_TYPE_UNSPECIFIED = 'MARKET_STATE_UPDATE_TYPE_UNSPECIFIED' } +/** Generic structure holding a key/value pair. */ +export type Metadata = { + __typename?: 'Metadata'; + /** Key of the metadata. */ + key: Scalars['String']; + /** Value of the metadata. */ + value: Scalars['String']; +}; + /** Information about whether proposals are enabled, if the markets are still bootstrapping, etc.. */ export type NetworkLimits = { __typename?: 'NetworkLimits'; @@ -2485,17 +2720,26 @@ export type NewMarket = { instrument: InstrumentConfiguration; /** Linear slippage factor is used to cap the slippage component of maintenance margin - it is applied to the slippage volume */ linearSlippageFactor: Scalars['String']; + /** Liquidation strategy for the market */ + liquidationStrategy?: Maybe; + /** Specifies how the liquidity fee for the market will be calculated */ + liquidityFeeSettings?: Maybe; /** Liquidity monitoring parameters */ liquidityMonitoringParameters: LiquidityMonitoringParameters; /** Liquidity SLA Parameters */ liquiditySLAParameters?: Maybe; + /** Configuration for mark price calculation for the market */ + markPriceConfiguration: CompositePriceConfiguration; /** Metadata for this instrument, tags */ metadata?: Maybe>; /** Decimal places for order sizes, sets what size the smallest order / position on the market can be */ positionDecimalPlaces: Scalars['Int']; /** Price monitoring parameters */ priceMonitoringParameters: PriceMonitoringParameters; - /** Quadratic slippage factor is used to cap the slippage component of maintenance margin - it is applied to the square of the slippage volume */ + /** + * Quadratic slippage factor is used to cap the slippage component of maintenance margin - it is applied to the square of the slippage volume + * @deprecated This field will be removed in a future release + */ quadraticSlippageFactor: Scalars['String']; /** New market risk configuration */ riskParameters: RiskModel; @@ -2510,6 +2754,8 @@ export type NewSpotMarket = { decimal_places: Scalars['Int']; /** New spot market instrument configuration */ instrument: InstrumentConfiguration; + /** Specifies how the liquidity fee for the market will be calculated */ + liquidityFeeSettings?: Maybe; /** Specifies the liquidity provision SLA parameters */ liquiditySLAParams: LiquiditySLAParameters; /** Optional spot market metadata tags */ @@ -2798,6 +3044,8 @@ export type ObservableMarketData = { liquidityProviderSla?: Maybe>; /** The mark price (an unsigned integer) */ markPrice: Scalars['String']; + /** The methodology used to calculated mark price */ + markPriceType: CompositePriceType; /** The market growth factor for the last market time window */ marketGrowth: Scalars['String']; /** Market ID of the associated mark price */ @@ -3118,6 +3366,8 @@ export enum OrderRejectionReason { ORDER_ERROR_INVALID_TIME_IN_FORCE = 'ORDER_ERROR_INVALID_TIME_IN_FORCE', /** Invalid type */ ORDER_ERROR_INVALID_TYPE = 'ORDER_ERROR_INVALID_TYPE', + /** Party has insufficient funds to cover for the order margin for the new or amended order */ + ORDER_ERROR_ISOLATED_MARGIN_CHECK_FAILED = 'ORDER_ERROR_ISOLATED_MARGIN_CHECK_FAILED', /** Margin check failed - not enough available margin */ ORDER_ERROR_MARGIN_CHECK_FAILED = 'ORDER_ERROR_MARGIN_CHECK_FAILED', /** Market is closed */ @@ -3138,6 +3388,8 @@ export enum OrderRejectionReason { ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO = 'ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO', /** Order is out of sequence */ ORDER_ERROR_OUT_OF_SEQUENCE = 'ORDER_ERROR_OUT_OF_SEQUENCE', + /** Pegged orders are not allowed for a party in isolated margin mode */ + ORDER_ERROR_PEGGED_ORDERS_NOT_ALLOWED_IN_ISOLATED_MARGIN_MODE = 'ORDER_ERROR_PEGGED_ORDERS_NOT_ALLOWED_IN_ISOLATED_MARGIN_MODE', /** A post-only order would produce an aggressive trade and thus it has been rejected */ ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE = 'ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE', /** A reduce-ony order would not reduce the party's position and thus it has been rejected */ @@ -3345,6 +3597,15 @@ export type PaidLiquidityFeesEdge = { node: PaidLiquidityFees; }; +/** Connection type for retrieving cursor-based paginated profile information for multiple parties */ +export type PartiesProfilesConnection = { + __typename?: 'PartiesProfilesConnection'; + /** The profiles in this connection */ + edges: Array; + /** The pagination information */ + pageInfo: PageInfo; +}; + /** Represents a party on Vega, could be an ethereum wallet address in the future */ export type Party = { __typename?: 'Party'; @@ -3482,7 +3743,9 @@ export type PartyrewardSummariesArgs = { export type PartyrewardsConnectionArgs = { assetId?: InputMaybe; fromEpoch?: InputMaybe; + gameId?: InputMaybe; pagination?: InputMaybe; + teamId?: InputMaybe; toEpoch?: InputMaybe; }; @@ -3504,8 +3767,12 @@ export type PartytradesConnectionArgs = { /** Represents a party on Vega, could be an ethereum wallet address in the future */ export type PartytransfersConnectionArgs = { direction?: InputMaybe; + fromEpoch?: InputMaybe; isReward?: InputMaybe; pagination?: InputMaybe; + scope?: InputMaybe; + status?: InputMaybe; + toEpoch?: InputMaybe; }; @@ -3586,6 +3853,60 @@ export type PartyLockedBalance = { untilEpoch: Scalars['Int']; }; +/** Margin mode selected for the given party and market. */ +export type PartyMarginMode = { + __typename?: 'PartyMarginMode'; + /** Epoch at which the update happened. */ + atEpoch: Scalars['Int']; + /** Selected margin mode. */ + marginMode: MarginMode; + /** Margin factor for the market. Isolated mode only. */ + margin_factor?: Maybe; + /** Unique ID of the market. */ + marketId: Scalars['ID']; + /** Maximum theoretical leverage for the market. Isolated mode only. */ + max_theoretical_leverage?: Maybe; + /** Minimum theoretical margin factor for the market. Isolated mode only. */ + min_theoretical_margin_factor?: Maybe; + /** Unique ID of the party. */ + partyId: Scalars['ID']; +}; + +/** Edge type containing the deposit and cursor information returned by a PartyMarginModeConnection */ +export type PartyMarginModeEdge = { + __typename?: 'PartyMarginModeEdge'; + cursor: Scalars['String']; + node: PartyMarginMode; +}; + +/** Connection type for retrieving cursor-based paginated party margin modes information */ +export type PartyMarginModesConnection = { + __typename?: 'PartyMarginModesConnection'; + /** The party margin modes */ + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Holds metadata associated to a party. */ +export type PartyProfile = { + __typename?: 'PartyProfile'; + /** Alias given to the party. */ + alias: Scalars['String']; + /** Metadata to associate to a party, in a key/value format where the key describes the type of metadata in the value field. */ + metadata: Array; + partyId: Scalars['ID']; +}; + +/** Edge type containing the party and cursor information returned by a PartiesProfilesConnection */ +export type PartyProfileEdge = { + __typename?: 'PartyProfileEdge'; + /** The cursor for this party's profile */ + cursor: Scalars['String']; + /** The party's profile */ + node: PartyProfile; +}; + /** * All staking information related to a Party. * Contains the current recognised balance by the network and @@ -3662,6 +3983,14 @@ export type Perpetual = { dataSourceSpecForSettlementData: DataSourceSpec; /** Data source specification describing the data source for settlement schedule */ dataSourceSpecForSettlementSchedule: DataSourceSpec; + /** Lower bound for the funding-rate such that the funding-rate will never be lower than this value */ + fundingRateLowerBound: Scalars['String']; + /** Factor applied to funding-rates. This scales the impact that spot price deviations have on funding payments */ + fundingRateScalingFactor: Scalars['String']; + /** Upper bound for the funding-rate such that the funding-rate will never be higher than this value */ + fundingRateUpperBound: Scalars['String']; + /** Optional configuration driving the index price calculation for perpetual product */ + indexPriceConfig?: Maybe; /** Continuously compounded interest rate used in funding rate calculation, in the range [-1, 1] */ interestRate: Scalars['String']; /** Controls how much the upcoming funding payment liability contributes to party's margin, in the range [0, 1] */ @@ -3681,8 +4010,18 @@ export type PerpetualData = { fundingPayment?: Maybe; /** Percentage difference between the time-weighted average price of the external and internal data point. */ fundingRate?: Maybe; + /** The index price used for external VWAP calculation */ + indexPrice: Scalars['String']; + /** The methodology used to calculated index price for perps */ + indexPriceType: CompositePriceType; /** Time-weighted average price calculated from data points for this period from the internal data source. */ internalTwap?: Maybe; + /** RFC3339Nano time indicating the next time index price will be calculated for perps where applicable */ + nextIndexPriceCalc: Scalars['String']; + /** Funding period sequence number */ + seqNum: Scalars['Int']; + /** Time at which the funding period started */ + startTime: Scalars['Timestamp']; }; export type PerpetualProduct = { @@ -3697,6 +4036,12 @@ export type PerpetualProduct = { dataSourceSpecForSettlementData: DataSourceDefinition; /** Data source specification describing the data source for settlement schedule */ dataSourceSpecForSettlementSchedule: DataSourceDefinition; + /** Lower bound for the funding-rate such that the funding-rate will never be lower than this value */ + fundingRateLowerBound: Scalars['String']; + /** Factor applied to funding-rates. This scales the impact that spot price deviations have on funding payments. */ + fundingRateScalingFactor: Scalars['String']; + /** Upper bound for the funding-rate such that the funding-rate will never be higher than this value */ + fundingRateUpperBound: Scalars['String']; /** Continuously compounded interest rate used in funding rate calculation, in the range [-1, 1] */ interestRate: Scalars['String']; /** Controls how much the upcoming funding payment liability contributes to party's margin, in the range [0, 1] */ @@ -3970,6 +4315,10 @@ export type ProposalChange = CancelTransfer | NewAsset | NewFreeform | NewMarket export type ProposalDetail = { __typename?: 'ProposalDetail'; + /** Batch proposal ID that is provided by Vega once proposal reaches the network */ + batchId?: Maybe; + /** Terms of the proposal for a batch proposal */ + batchTerms?: Maybe; /** RFC3339Nano time and date when the proposal reached the Vega network */ datetime: Scalars['Timestamp']; /** Error details of the rejectionReason */ @@ -3994,8 +4343,8 @@ export type ProposalDetail = { requiredParticipation: Scalars['String']; /** State of the proposal */ state: ProposalState; - /** Terms of the proposal */ - terms: ProposalTerms; + /** Terms of the proposal for proposal */ + terms?: Maybe; }; /** Edge type containing the proposals and cursor information returned by a ProposalsConnection */ @@ -4003,10 +4352,17 @@ export type ProposalEdge = { __typename?: 'ProposalEdge'; /** Cursor identifying the proposal */ cursor: Scalars['String']; - /** The proposal data */ + /** + * The proposal data + * @deprecated Use proposalNode + */ node: Proposal; + /** The data of either single or batch proposal */ + proposalNode?: Maybe; }; +export type ProposalNode = BatchProposal | Proposal; + export type ProposalRationale = { __typename?: 'ProposalRationale'; /** @@ -4310,6 +4666,14 @@ export type PubKey = { key?: Maybe; }; +export type QuantumRewardsPerEpoch = { + __typename?: 'QuantumRewardsPerEpoch'; + /** Epoch for which this information is valid. */ + epoch: Scalars['Int']; + /** Total of rewards accumulated over the epoch period expressed in quantum value. */ + total_quantum_rewards: Scalars['String']; +}; + /** Queries allow a caller to read data and filter data via GraphQL. */ export type Query = { __typename?: 'Query'; @@ -4354,6 +4718,8 @@ export type Query = { estimateOrder: OrderEstimate; /** Return a margin range for the specified position and liquidation price range if available collateral is supplied */ estimatePosition?: Maybe; + /** Estimate transfer fee */ + estimateTransferFee?: Maybe; /** Query for historic ethereum key rotations */ ethereumKeyRotations: EthereumKeyRotationsConnection; /** Get fees statistics */ @@ -4369,6 +4735,8 @@ export type Query = { fundingPeriodDataPoints: FundingPeriodDataPointConnection; /** Funding periods for perpetual markets */ fundingPeriods: FundingPeriodConnection; + /** Get a list of games and their metrics. */ + games: GamesConnection; /** Get market data history for a specific market. If no dates are given, the latest snapshot will be returned. If only the start date is provided all history from the given date will be provided, and if only the end date is provided, all history from the start up to and including the end date will be provided. */ getMarketDataHistoryConnectionByID?: Maybe; /** Query for historic key rotations */ @@ -4384,10 +4752,10 @@ export type Query = { * At least one party ID must be specified in the from or to account filter. * * Entries can be filtered by: - * - the sending account (market ID, asset ID, account type) - * - receiving account (market ID, asset ID, account type) - * - sending AND receiving account - * - transfer type either in addition to the above filters or as a standalone option + * - the sending account (market ID, asset ID, account type) + * - receiving account (market ID, asset ID, account type) + * - sending AND receiving account + * - transfer type either in addition to the above filters or as a standalone option * * Note: The date range is restricted to any 5 days. * If no start or end date is provided, only ledger entries from the last 5 days will be returned. @@ -4432,16 +4800,24 @@ export type Query = { orderByReference: Order; /** Order versions (created via amendments if any) found by orderID */ orderVersionsConnection?: Maybe; - /** List paid liquidity fees statistics */ + /** List statistics about paid liquidity fees */ paidLiquidityFees?: Maybe; /** One or more entities that are trading on the Vega network */ partiesConnection?: Maybe; + /** List parties' profiles by their IDs. If no ID is set, all profiles are returned. */ + partiesProfilesConnection?: Maybe; /** An entity that is trading on the Vega network */ party?: Maybe; + /** + * List margin modes per party per market + * + * Get a list of all margin modes, or for a specific market ID, or party ID. + */ + partyMarginModes?: Maybe; /** Fetch all positions */ positions?: Maybe; /** A governance proposal located by either its ID or reference. If both are set, ID is used. */ - proposal?: Maybe; + proposal?: Maybe; /** All governance proposals in the Vega network */ proposalsConnection?: Maybe; /** List protocol upgrade proposals, optionally filtering on status or approver */ @@ -4461,6 +4837,12 @@ export type Query = { stopOrders?: Maybe; /** List markets in a succession line */ successorMarkets?: Maybe; + /** + * List team members' statistics for a given team + * Get the statistics of all team members for a given team ID, or for a specific member by using party ID, over a number of epochs. + * If a team does not have at least the number of epochs worth of data, it is ignored. + */ + teamMembersStatistics?: Maybe; /** List a referee's team history */ teamRefereeHistory?: Maybe; /** List all referees for a team */ @@ -4473,10 +4855,18 @@ export type Query = { * If both team ID and party ID is provided, only the team ID will be used. */ teams?: Maybe; + /** + * List teams statistics + * Get the statistics of all teams, or for a specific team by using team ID, over a number of epochs. + * If a team does not have at least the number of epochs worth of data, it is ignored. + */ + teamsStatistics?: Maybe; + /** Get total transfer fee discount available */ + totalTransferFeeDiscount?: Maybe; /** Get a list of all trades and apply any given filters to the results */ trades?: Maybe; /** Find a transfer using its ID */ - transfer?: Maybe; + transfer?: Maybe; /** Get a list of all transfers for a public key */ transfersConnection?: Maybe; /** Get volume discount statistics */ @@ -4620,6 +5010,16 @@ export type QueryestimatePositionArgs = { }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QueryestimateTransferFeeArgs = { + amount: Scalars['String']; + assetId: Scalars['String']; + fromAccount: Scalars['ID']; + fromAccountType: AccountType; + toAccount: Scalars['ID']; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QueryethereumKeyRotationsArgs = { nodeId?: InputMaybe; @@ -4669,6 +5069,16 @@ export type QueryfundingPeriodsArgs = { }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QuerygamesArgs = { + entityScope?: InputMaybe; + epochFrom?: InputMaybe; + epochTo?: InputMaybe; + gameId?: InputMaybe; + pagination?: InputMaybe; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QuerygetMarketDataHistoryConnectionByIDArgs = { end?: InputMaybe; @@ -4807,12 +5217,27 @@ export type QuerypartiesConnectionArgs = { }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QuerypartiesProfilesConnectionArgs = { + ids?: InputMaybe>; + pagination?: InputMaybe; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QuerypartyArgs = { id: Scalars['ID']; }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QuerypartyMarginModesArgs = { + marketId?: InputMaybe; + pagination?: InputMaybe; + partyId?: InputMaybe; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QuerypositionsArgs = { filter?: InputMaybe; @@ -4892,6 +5317,15 @@ export type QuerysuccessorMarketsArgs = { }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QueryteamMembersStatisticsArgs = { + aggregationEpochs?: InputMaybe; + pagination?: InputMaybe; + partyId?: InputMaybe; + teamId: Scalars['ID']; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QueryteamRefereeHistoryArgs = { pagination?: InputMaybe; @@ -4914,6 +5348,21 @@ export type QueryteamsArgs = { }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QueryteamsStatisticsArgs = { + aggregationEpochs?: InputMaybe; + pagination?: InputMaybe; + teamId?: InputMaybe; +}; + + +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QuerytotalTransferFeeDiscountArgs = { + assetId: Scalars['String']; + partyId: Scalars['String']; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QuerytradesArgs = { dateRange?: InputMaybe; @@ -4931,9 +5380,13 @@ export type QuerytransferArgs = { /** Queries allow a caller to read data and filter data via GraphQL. */ export type QuerytransfersConnectionArgs = { direction?: InputMaybe; + fromEpoch?: InputMaybe; isReward?: InputMaybe; pagination?: InputMaybe; partyId?: InputMaybe; + scope?: InputMaybe; + status?: InputMaybe; + toEpoch?: InputMaybe; }; @@ -5150,18 +5603,27 @@ export type Reward = { asset: Asset; /** Epoch for which this reward was distributed */ epoch: Epoch; + /** Optional game ID for rewards that are paid for participation in a game */ + gameId?: Maybe; /** The epoch when the reward is released */ lockedUntilEpoch: Epoch; - /** The market ID for which this reward is paid if any */ + /** + * The market ID for which this reward is paid if any + * @deprecated Use gameId + */ marketId: Scalars['ID']; /** Party receiving the reward */ party: Party; /** Percentage out of the total distributed reward */ percentageOfTotal: Scalars['String']; + /** Amount paid as a reward, expressed in asset's quantum unit */ + quantumAmount: Scalars['String']; /** RFC3339Nano time when the rewards were received */ receivedAt: Scalars['Timestamp']; /** The type of reward */ rewardType: AccountType; + /** Optional team ID for rewards that are paid if the party is a member of a team, and for participation in a game. */ + teamId?: Maybe; }; /** Edge type containing the reward and cursor information returned by a RewardsConnection */ @@ -5321,6 +5783,15 @@ export type SimpleRiskModelParams = { factorShort: Scalars['Float']; }; +/** + * Describes which property of the data source data should be + * used as composite price source. + */ +export type SpecBindingForCompositePrice = { + __typename?: 'SpecBindingForCompositePrice'; + priceSourceProperty: Scalars['String']; +}; + /** Spot FX product */ export type Spot = { __typename?: 'Spot'; @@ -5515,6 +5986,10 @@ export type StopOrder = { partyId: Scalars['ID']; /** Optional rejection reason for an order */ rejectionReason?: Maybe; + /** Size override setting */ + sizeOverrideSetting: StopOrderSizeOverrideSetting; + /** Size override value */ + sizeOverrideValue?: Maybe; /** Status of the stop order */ status: StopOrderStatus; /** Order to submit when the stop order is triggered. */ @@ -5585,6 +6060,8 @@ export enum StopOrderRejectionReason { REJECTION_REASON_MAX_STOP_ORDERS_PER_PARTY_REACHED = 'REJECTION_REASON_MAX_STOP_ORDERS_PER_PARTY_REACHED', /** Stop orders submission must be reduce only */ REJECTION_REASON_MUST_BE_REDUCE_ONLY = 'REJECTION_REASON_MUST_BE_REDUCE_ONLY', + /** Stop order cannot have matching OCO expiry times */ + REJECTION_REASON_STOP_ORDER_CANNOT_MATCH_OCO_EXPIRY_TIMES = 'REJECTION_REASON_STOP_ORDER_CANNOT_MATCH_OCO_EXPIRY_TIMES', /** Stop orders are not allowed during the opening auction */ REJECTION_REASON_STOP_ORDER_NOT_ALLOWED_DURING_OPENING_AUCTION = 'REJECTION_REASON_STOP_ORDER_NOT_ALLOWED_DURING_OPENING_AUCTION', /** Stop orders are not allowed without a position */ @@ -5595,6 +6072,16 @@ export enum StopOrderRejectionReason { REJECTION_REASON_TRADING_NOT_ALLOWED = 'REJECTION_REASON_TRADING_NOT_ALLOWED' } +/** Stop order size override settings */ +export enum StopOrderSizeOverrideSetting { + /** No size override, the size within the contained normal order submission will be used */ + SIZE_OVERRIDE_SETTING_NONE = 'SIZE_OVERRIDE_SETTING_NONE', + /** Use the total position of the trader */ + SIZE_OVERRIDE_SETTING_POSITION = 'SIZE_OVERRIDE_SETTING_POSITION', + /** The size override has not been specified, this should never happen! */ + SIZE_OVERRIDE_SETTING_UNSPECIFIED = 'SIZE_OVERRIDE_SETTING_UNSPECIFIED' +} + /** Valid stop order statuses, these determine several states for a stop order that cannot be expressed with other fields in StopOrder. */ export enum StopOrderStatus { /** Stop order has been cancelled. This could be by the trader or by the network. */ @@ -5807,9 +6294,11 @@ export type TargetStakeParameters = { /** Team record containing the team information. */ export type Team = { __typename?: 'Team'; + /** List of public keys that are allowed to join the team. Only applicable to closed teams. */ + allowList: Array; /** Link to an image of the team's avatar. */ - avatarURL: Scalars['String']; - /** Tells if a party can join the team or not. */ + avatarUrl: Scalars['String']; + /** Whether or not the team is closed to new party members. When closed, only parties specified in the allow list can join the team. */ closed: Scalars['Boolean']; /** Time in RFC3339Nano format when the team was created. */ createdAt: Scalars['Timestamp']; @@ -5822,7 +6311,7 @@ export type Team = { /** Unique ID of the team. */ teamId: Scalars['ID']; /** Link to the team's homepage. */ - teamURL: Scalars['String']; + teamUrl: Scalars['String']; }; /** Connection type for retrieving cursor-based paginated team data */ @@ -5843,6 +6332,67 @@ export type TeamEdge = { node: Team; }; +/** Team participating in a game and their metrics. */ +export type TeamGameEntity = { + __typename?: 'TeamGameEntity'; + /** Rank of the team within the game. */ + rank: Scalars['Int']; + /** Total rewards earned by the team during the epoch */ + rewardEarned: Scalars['String']; + /** Reward metric applied to the game. */ + rewardMetric: Scalars['String']; + /** Breakdown of the team members and their contributions to the total team metrics. */ + team: TeamParticipation; + /** Total rewards earned by the team for the game */ + totalRewardsEarned: Scalars['String']; + /** Total volume traded by the team */ + volume: Scalars['String']; +}; + +/** Team member's statistics record containing the member's information. */ +export type TeamMemberStatistics = { + __typename?: 'TeamMemberStatistics'; + /** List of games played over the requested epoch period. */ + gamesPlayed: Array; + /** Party ID the statistics are related to. */ + partyId: Scalars['String']; + /** List of rewards over the requested epoch period, expressed in quantum value for each epoch */ + quantumRewards: Array; + /** Total number of games played. */ + totalGamesPlayed: Scalars['Int']; + /** Total of rewards accumulated over the requested epoch period, expressed in quantum value. */ + totalQuantumRewards: Scalars['String']; + /** Total of volume accumulated over the requested epoch period, expressed in quantum value. */ + totalQuantumVolume: Scalars['String']; +}; + +/** Edge type containing a team member statistics cursor and its associated statistics data */ +export type TeamMemberStatisticsEdge = { + __typename?: 'TeamMemberStatisticsEdge'; + /** Cursor identifying the team data */ + cursor: Scalars['String']; + /** Team member's statistics data */ + node: TeamMemberStatistics; +}; + +/** Connection type for retrieving cursor-based paginated team member statistics data */ +export type TeamMembersStatisticsConnection = { + __typename?: 'TeamMembersStatisticsConnection'; + /** Team members' statistics in this connection */ + edges: Array; + /** Pagination information */ + pageInfo: PageInfo; +}; + +/** Team participation information, i.e. the team ID and the metrics for each participating team member. */ +export type TeamParticipation = { + __typename?: 'TeamParticipation'; + /** List of participating team members and their metrics. */ + membersParticipating: Array; + /** Team ID */ + teamId: Scalars['ID']; +}; + /** A team's referee info */ export type TeamReferee = { __typename?: 'TeamReferee'; @@ -5903,12 +6453,54 @@ export type TeamRefereeHistoryEdge = { node: TeamRefereeHistory; }; +/** Team's statistics record containing the team information. */ +export type TeamStatistics = { + __typename?: 'TeamStatistics'; + /** List of games played over the requested epoch period. */ + gamesPlayed: Array; + /** List of rewards over the requested epoch period, expressed in quantum value for each epoch */ + quantumRewards: Array; + /** Team ID the statistics are related to. */ + teamId: Scalars['String']; + /** Total of games played. */ + totalGamesPlayed: Scalars['Int']; + /** Total of rewards accumulated over the requested epoch period, expressed in quantum value. */ + totalQuantumRewards: Scalars['String']; + /** Total of volume accumulated over the requested epoch period, expressed in quantum value. */ + totalQuantumVolume: Scalars['String']; +}; + +/** Edge type containing a team statistics cursor and its associated team's statistics data */ +export type TeamStatisticsEdge = { + __typename?: 'TeamStatisticsEdge'; + /** Cursor identifying the team data */ + cursor: Scalars['String']; + /** Team's statistics data */ + node: TeamStatistics; +}; + +/** Connection type for retrieving cursor-based paginated team statistics data */ +export type TeamsStatisticsConnection = { + __typename?: 'TeamsStatisticsConnection'; + /** Teams' statistics in this connection */ + edges: Array; + /** Pagination information */ + pageInfo: PageInfo; +}; + export type TimeUpdate = { __typename?: 'TimeUpdate'; /** RFC3339Nano time of new block time */ timestamp: Scalars['Timestamp']; }; +/** Returns total transfer fee discount available */ +export type TotalTransferFeeDiscount = { + __typename?: 'TotalTransferFeeDiscount'; + /** Total per party per asset discount available. */ + totalDiscount: Scalars['String']; +}; + /** A tradable instrument is a combination of an instrument and a risk model */ export type TradableInstrument = { __typename?: 'TradableInstrument'; @@ -6091,6 +6683,8 @@ export type Transfer = { from: Scalars['String']; /** The account type from which funds have been sent */ fromAccountType: AccountType; + /** An optional game ID to filter for transfers that are made for rewarding participation in games */ + gameId?: Maybe; /** ID of this transfer */ id: Scalars['ID']; /** The type of transfer being made, i.e. a one-off or recurring transfer */ @@ -6174,6 +6768,14 @@ export type TransferResponses = { responses?: Maybe>; }; +/** Defines the types of a dispatch strategy's scope the API can filter on. */ +export enum TransferScope { + /** Matches transfers that have dispatch strategy scope of individual set. */ + SCOPE_INDIVIDUAL = 'SCOPE_INDIVIDUAL', + /** Matches transfers that have dispatch strategy scope of team set. */ + SCOPE_TEAM = 'SCOPE_TEAM' +} + /** All the states a transfer can transition between */ export enum TransferStatus { /** Indication of a transfer cancelled by the user */ @@ -6213,6 +6815,8 @@ export enum TransferType { TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE = 'TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE', /** Infrastructure fee paid from general account */ TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY = 'TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY', + /** Funds moved from order margin account to margin account. */ + TRANSFER_TYPE_ISOLATED_MARGIN_LOW = 'TRANSFER_TYPE_ISOLATED_MARGIN_LOW', /** Allocates liquidity fee earnings to each liquidity provider's network controlled liquidity fee account. */ TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE = 'TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE', /** Liquidity fee received into general account */ @@ -6239,6 +6843,10 @@ export enum TransferType { TRANSFER_TYPE_MTM_LOSS = 'TRANSFER_TYPE_MTM_LOSS', /** Funds added to margin account after mark to market gain */ TRANSFER_TYPE_MTM_WIN = 'TRANSFER_TYPE_MTM_WIN', + /** Funds released from order margin account to general. */ + TRANSFER_TYPE_ORDER_MARGIN_HIGH = 'TRANSFER_TYPE_ORDER_MARGIN_HIGH', + /** Funds moved from general account to order margin account. */ + TRANSFER_TYPE_ORDER_MARGIN_LOW = 'TRANSFER_TYPE_ORDER_MARGIN_LOW', /** Funds deducted from margin account after a perpetuals funding loss. */ TRANSFER_TYPE_PERPETUALS_FUNDING_LOSS = 'TRANSFER_TYPE_PERPETUALS_FUNDING_LOSS', /** Funds added to margin account after a perpetuals funding gain. */ @@ -6312,6 +6920,7 @@ export type UpdateFutureProduct = { export type UpdateInstrumentConfiguration = { __typename?: 'UpdateInstrumentConfiguration'; code: Scalars['String']; + name: Scalars['String']; product: UpdateProductConfiguration; }; @@ -6331,15 +6940,24 @@ export type UpdateMarketConfiguration = { instrument: UpdateInstrumentConfiguration; /** Linear slippage factor is used to cap the slippage component of maintenance margin - it is applied to the slippage volume. */ linearSlippageFactor: Scalars['String']; + /** Liquidation strategy for the market */ + liquidationStrategy?: Maybe; + /** Specifies how the liquidity fee for the market will be calculated */ + liquidityFeeSettings?: Maybe; /** Liquidity monitoring parameters. */ liquidityMonitoringParameters: LiquidityMonitoringParameters; /** Liquidity SLA Parameters. */ liquiditySLAParameters?: Maybe; + /** Configuration for mark price calculation for the market */ + markPriceConfiguration?: Maybe; /** Optional futures market metadata, tags. */ metadata?: Maybe>>; /** Price monitoring parameters. */ priceMonitoringParameters: PriceMonitoringParameters; - /** Quadratic slippage factor is used to cap the slippage component of maintenance margin - it is applied to the square of the slippage volume. */ + /** + * Quadratic slippage factor is used to cap the slippage component of maintenance margin - it is applied to the square of the slippage volume. + * @deprecated This field will be removed in a future release + */ quadraticSlippageFactor: Scalars['String']; /** Updated futures market risk model parameters. */ riskParameters: UpdateMarketRiskParameters; @@ -6385,6 +7003,12 @@ export type UpdatePerpetualProduct = { dataSourceSpecForSettlementData: DataSourceDefinition; /** Data source specification describing the data source for settlement schedule */ dataSourceSpecForSettlementSchedule: DataSourceDefinition; + /** Lower bound for the funding-rate such that the funding-rate will never be lower than this value */ + fundingRateLowerBound: Scalars['String']; + /** Factor applied to funding-rates. This scales the impact that spot price deviations have on funding payments. */ + fundingRateScalingFactor: Scalars['String']; + /** Upper bound for the funding-rate such that the funding-rate will never be higher than this value */ + fundingRateUpperBound: Scalars['String']; /** Continuously compounded interest rate used in funding rate calculation, in the range [-1, 1] */ interestRate: Scalars['String']; /** Controls how much the upcoming funding payment liability contributes to party's margin, in the range [0, 1] */ @@ -6422,6 +7046,8 @@ export type UpdateSpotMarket = { export type UpdateSpotMarketConfiguration = { __typename?: 'UpdateSpotMarketConfiguration'; + /** Specifies how the liquidity fee for the market will be calculated */ + liquidityFeeSettings?: Maybe; /** Specifies the liquidity provision SLA parameters */ liquiditySLAParams: LiquiditySLAParameters; /** Optional spot market metadata tags */