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