diff --git a/libs/liquidity/src/lib/liquidity-data-provider.spec.tsx b/libs/liquidity/src/lib/liquidity-data-provider.spec.tsx index 6e9098502a..19be5228dc 100644 --- a/libs/liquidity/src/lib/liquidity-data-provider.spec.tsx +++ b/libs/liquidity/src/lib/liquidity-data-provider.spec.tsx @@ -119,6 +119,8 @@ describe('getLiquidityProvision', () => { createdAt: '2022-12-16T09:28:29.071781Z', id: 'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59', fee: '0.001', + partyId: + 'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59', party: { __typename: 'Party', accountsConnection: { diff --git a/libs/liquidity/src/lib/liquidity-data-provider.ts b/libs/liquidity/src/lib/liquidity-data-provider.ts index 6ab1744f89..cabd4104ee 100644 --- a/libs/liquidity/src/lib/liquidity-data-provider.ts +++ b/libs/liquidity/src/lib/liquidity-data-provider.ts @@ -5,17 +5,15 @@ import { } from '@vegaprotocol/data-provider'; import * as Schema from '@vegaprotocol/types'; import BigNumber from 'bignumber.js'; - import { LiquidityProvidersDocument, LiquidityProvisionsDocument, } from './__generated__/MarketLiquidity'; - import type { LiquidityProviderFieldsFragment, + LiquidityProvisionFieldsFragment, LiquidityProvidersQuery, LiquidityProvidersQueryVariables, - LiquidityProvisionFieldsFragment, LiquidityProvisionsQuery, LiquidityProvisionsQueryVariables, } from './__generated__/MarketLiquidity'; @@ -163,7 +161,14 @@ export const getLiquidityProvision = ( const liquidityProvider = liquidityProviders.find( (f) => liquidityProvision.party.id === f.partyId ); - if (!liquidityProvider) return liquidityProvision; + + if (!liquidityProvider) { + return { + ...liquidityProvision, + partyId: liquidityProvision.party.id, + }; + } + const accounts = compact( liquidityProvision.party.accountsConnection?.edges ).map((e) => e.node);