diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index e4b0ca60a..80a46b39a 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -1136,19 +1136,19 @@ export class PortfolioService { withSummary: true }); - const hasOpenHoldings = Object.keys(holdings).length > 0; - - const emergencyFundHoldingsValueInBaseCurrency = - this.getEmergencyFundHoldingsValueInBaseCurrency({ holdings }); - - const emergencyFundInBaseCurrency = userSettings.emergencyFund ?? 0; - const { balanceInBaseCurrency: cashBalanceInBaseCurrency } = await this.accountService.getCashDetails({ userId, currency: this.getUserCurrency() }); + const emergencyFundInBaseCurrency = userSettings.emergencyFund ?? 0; + + const emergencyFundHoldingsValueInBaseCurrency = + this.getEmergencyFundHoldingsValueInBaseCurrency({ holdings }); + + const hasOpenHoldings = Object.keys(holdings).length > 0; + const marketsAdvancedTotalInBaseCurrency = getSum( Object.values(marketsAdvanced).map(({ valueInBaseCurrency }) => { return new Big(valueInBaseCurrency);