From a27a69b592c07adf6e1f017b950e854f5f39f059 Mon Sep 17 00:00:00 2001 From: Vincent Chau <99756290+vincentwschau@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:14:55 -0500 Subject: [PATCH] Fix vaults PnL endpoint. --- .../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