diff --git a/libs/accounts/src/lib/Accounts.graphql b/libs/accounts/src/lib/Accounts.graphql index d1a83ed0b..ca7bb9ba3 100644 --- a/libs/accounts/src/lib/Accounts.graphql +++ b/libs/accounts/src/lib/Accounts.graphql @@ -31,5 +31,6 @@ subscription AccountEvents($partyId: ID) { balance assetId marketId + partyId } } diff --git a/libs/accounts/src/lib/__generated__/Accounts.ts b/libs/accounts/src/lib/__generated__/Accounts.ts index 0f40e9e85..6246bb756 100644 --- a/libs/accounts/src/lib/__generated__/Accounts.ts +++ b/libs/accounts/src/lib/__generated__/Accounts.ts @@ -17,7 +17,7 @@ export type AccountEventsSubscriptionVariables = Types.Exact<{ }>; -export type AccountEventsSubscription = { __typename?: 'Subscription', accounts: Array<{ __typename?: 'AccountUpdate', type: Types.AccountType, balance: string, assetId: string, marketId?: string | null }> }; +export type AccountEventsSubscription = { __typename?: 'Subscription', accounts: Array<{ __typename?: 'AccountUpdate', type: Types.AccountType, balance: string, assetId: string, marketId?: string | null, partyId: string }> }; export const AccountFieldsFragmentDoc = gql` fragment AccountFields on AccountBalance { @@ -83,6 +83,7 @@ export const AccountEventsDocument = gql` balance assetId marketId + partyId } } `; diff --git a/libs/accounts/src/lib/accounts-data-provider.spec.ts b/libs/accounts/src/lib/accounts-data-provider.spec.ts index 3b695fddd..752cd2dbf 100644 --- a/libs/accounts/src/lib/accounts-data-provider.spec.ts +++ b/libs/accounts/src/lib/accounts-data-provider.spec.ts @@ -26,6 +26,7 @@ describe('getId', () => { balance: '1', assetId: 'assetId', marketId: '', + partyId: '', }) ); expect( @@ -41,6 +42,7 @@ describe('getId', () => { balance: '1', assetId: 'assetId', marketId: 'testId', + partyId: 'partyId', }) ); }); diff --git a/libs/accounts/src/lib/accounts-data-provider.ts b/libs/accounts/src/lib/accounts-data-provider.ts index e33c844ce..db126049a 100644 --- a/libs/accounts/src/lib/accounts-data-provider.ts +++ b/libs/accounts/src/lib/accounts-data-provider.ts @@ -66,6 +66,7 @@ const update = ( balance: delta.balance, market: delta.marketId ? { id: delta.marketId } : null, asset: { id: delta.assetId }, + party: { id: delta.partyId }, }); } }); @@ -182,6 +183,7 @@ export const accountsDataProvider = makeDerivedDataProvider( if (asset) { return { ...account, + partyId: account.party?.id, asset: { ...asset, }, diff --git a/libs/accounts/src/lib/accounts.mock.ts b/libs/accounts/src/lib/accounts.mock.ts index 6f205c399..15ab0891b 100644 --- a/libs/accounts/src/lib/accounts.mock.ts +++ b/libs/accounts/src/lib/accounts.mock.ts @@ -122,6 +122,7 @@ export const accountEventsSubscription = ( balance: '100000000', assetId: 'asset-id', marketId: null, + partyId: 'vega-0', }, ], }; diff --git a/libs/liquidity/src/lib/liquidity-table.tsx b/libs/liquidity/src/lib/liquidity-table.tsx index 3209c6b9f..b46952eb9 100644 --- a/libs/liquidity/src/lib/liquidity-table.tsx +++ b/libs/liquidity/src/lib/liquidity-table.tsx @@ -43,10 +43,10 @@ export const LiquidityTable = forwardRef( if (!value) return '-'; return `${addDecimalsFormatNumber(value, assetDecimalPlaces ?? 0, 5)}`; }; - const stakeToCcySiskasFormatter = ({ value }: ValueFormatterParams) => { + const stakeToCcyVolumeFormatter = ({ value }: ValueFormatterParams) => { if (!value) return '-'; const newValue = new BigNumber(value) - .times(stakeToCcySiskas ?? 1) + .times(Number(stakeToCcySiskas) || 1) .toString(); return `${addDecimalsFormatNumber(newValue, assetDecimalPlaces ?? 0, 5)}`; }; @@ -121,7 +121,7 @@ export const LiquidityTable = forwardRef( headerTooltip={t( `The liquidity provider's obligation to the market, calculated as the liquidity commitment amount multiplied by the value of the stake_to_ccy_siskas network parameter to convert into units of liquidity volume. The obligation can be met by a combination of LP orders and limit orders on the order book.` )} - valueFormatter={stakeToCcySiskasFormatter} + valueFormatter={stakeToCcyVolumeFormatter} /> ( )} field="balance" type="rightAligned" - valueFormatter={stakeToCcySiskasFormatter} + valueFormatter={stakeToCcyVolumeFormatter} />