From 6aee32b75ee0a980ea071f75075c7362cdf66056 Mon Sep 17 00:00:00 2001 From: vincentwschau <99756290+vincentwschau@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:36:19 -0500 Subject: [PATCH] Fix vaults PnL endpoint. (#2612) --- .../comlink/src/controllers/api/v4/vault-controller.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indexer/services/comlink/src/controllers/api/v4/vault-controller.ts b/indexer/services/comlink/src/controllers/api/v4/vault-controller.ts index bd2c489478..b4e75197e7 100644 --- a/indexer/services/comlink/src/controllers/api/v4/vault-controller.ts +++ b/indexer/services/comlink/src/controllers/api/v4/vault-controller.ts @@ -163,6 +163,9 @@ class VaultController extends Controller { ]); const groupedVaultPnlTicks: VaultHistoricalPnl[] = _(vaultPnlTicks) + .filter((pnlTickFromDatabsae: PnlTicksFromDatabase): boolean => { + return vaultSubaccounts[pnlTickFromDatabsae.subaccountId] !== undefined; + }) .groupBy('subaccountId') .mapValues((pnlTicks: PnlTicksFromDatabase[], subaccountId: string): VaultHistoricalPnl => { const market: PerpetualMarketFromDatabase | undefined = perpetualMarketRefresher