From 2bfc3abd1570c064eee85e95de41cb3e4be69919 Mon Sep 17 00:00:00 2001 From: Maciek Date: Fri, 31 Mar 2023 15:20:44 +0200 Subject: [PATCH] chore(trading): liquidity provision, change query for set flag live on true (#3335) --- libs/liquidity/src/lib/MarketLiquidity.graphql | 2 +- libs/liquidity/src/lib/MarketsLiquidity.graphql | 2 +- .../src/lib/__generated__/MarketLiquidity.ts | 4 ++-- .../src/lib/__generated__/MarketsLiquidity.ts | 2 +- libs/liquidity/src/lib/liquidity-data-provider.ts | 14 +------------- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/libs/liquidity/src/lib/MarketLiquidity.graphql b/libs/liquidity/src/lib/MarketLiquidity.graphql index 8ef435d56..e7c6941df 100644 --- a/libs/liquidity/src/lib/MarketLiquidity.graphql +++ b/libs/liquidity/src/lib/MarketLiquidity.graphql @@ -57,7 +57,7 @@ fragment LiquidityProvisionFields on LiquidityProvision { query LiquidityProvisions($marketId: ID!) { market(id: $marketId) { - liquidityProvisionsConnection { + liquidityProvisionsConnection(live: true) { edges { node { ...LiquidityProvisionFields diff --git a/libs/liquidity/src/lib/MarketsLiquidity.graphql b/libs/liquidity/src/lib/MarketsLiquidity.graphql index 9d1e009f7..eea0f6c37 100644 --- a/libs/liquidity/src/lib/MarketsLiquidity.graphql +++ b/libs/liquidity/src/lib/MarketsLiquidity.graphql @@ -1,6 +1,6 @@ fragment MarketNode on Market { id - liquidityProvisionsConnection { + liquidityProvisionsConnection(live: true) { edges { node { commitmentAmount diff --git a/libs/liquidity/src/lib/__generated__/MarketLiquidity.ts b/libs/liquidity/src/lib/__generated__/MarketLiquidity.ts index ddedfb438..9e61822eb 100644 --- a/libs/liquidity/src/lib/__generated__/MarketLiquidity.ts +++ b/libs/liquidity/src/lib/__generated__/MarketLiquidity.ts @@ -138,7 +138,7 @@ export type MarketLpQueryResult = Apollo.QueryResult(LiquidityProviderFeeShareUpdateDocument, options); } export type LiquidityProviderFeeShareUpdateSubscriptionHookResult = ReturnType; -export type LiquidityProviderFeeShareUpdateSubscriptionResult = Apollo.SubscriptionResult; \ No newline at end of file +export type LiquidityProviderFeeShareUpdateSubscriptionResult = Apollo.SubscriptionResult; diff --git a/libs/liquidity/src/lib/__generated__/MarketsLiquidity.ts b/libs/liquidity/src/lib/__generated__/MarketsLiquidity.ts index 57c86b73d..47436d32a 100644 --- a/libs/liquidity/src/lib/__generated__/MarketsLiquidity.ts +++ b/libs/liquidity/src/lib/__generated__/MarketsLiquidity.ts @@ -13,7 +13,7 @@ export type LiquidityProvisionMarketsQuery = { __typename?: 'Query', marketsConn export const MarketNodeFragmentDoc = gql` fragment MarketNode on Market { id - liquidityProvisionsConnection { + liquidityProvisionsConnection(live: true) { edges { node { commitmentAmount diff --git a/libs/liquidity/src/lib/liquidity-data-provider.ts b/libs/liquidity/src/lib/liquidity-data-provider.ts index 0c2beb807..572b3c052 100644 --- a/libs/liquidity/src/lib/liquidity-data-provider.ts +++ b/libs/liquidity/src/lib/liquidity-data-provider.ts @@ -65,23 +65,11 @@ export const liquidityProvisionsDataProvider = makeDataProvider< }); }, getData: (responseData: LiquidityProvisionsQuery | null) => { - // to remove dedupe after core fix https://github.com/vegaprotocol/vega/issues/8043 - const dedupeArr: string[] = []; return ( responseData?.market?.liquidityProvisionsConnection?.edges?.map( (e) => e?.node ) ?? [] - ).filter((e) => { - if (e) { - const id = getId(e); - if (dedupeArr.includes(id)) { - return false; - } - dedupeArr.push(id); - return true; - } - return false; - }) as LiquidityProvisionFieldsFragment[]; + ).filter((e) => !!e) as LiquidityProvisionFieldsFragment[]; }, getDelta: ( subscriptionData: LiquidityProvisionsUpdateSubscription