diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index c15d06c1e..27bb044cc 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -226,7 +226,7 @@ export class PortfolioService { interestInBaseCurrency, transactionCount, valueInBaseCurrency, - allocationInPercentage: null, // TODO + allocationInPercentage: 0, balanceInBaseCurrency: this.exchangeRateDataService.toCurrency( account.balance, account.currency, @@ -298,6 +298,11 @@ export class PortfolioService { transactionCount += account.transactionCount; } + for (const account of accounts) { + account.allocationInPercentage = + account.valueInBaseCurrency / totalValueInBaseCurrency.toNumber(); + } + return { accounts, transactionCount,