From 84467d7236121b36c32446f3b1dd130612cfc7fd Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 27 Jul 2026 19:43:05 +0200 Subject: [PATCH] Task/handle delisted asset profiles in FMP service (#7442) * Handle delisted asset profiles * Update changelog --- CHANGELOG.md | 2 ++ .../financial-modeling-prep.service.ts | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 286b2a27c..00a5607dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,12 +14,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Deprecated `firstOrderDate` in favor of `dateOfFirstActivity` in the `GET api/v2/portfolio/performance` endpoint +- Improved the log output in the get asset profile functionality of the _Financial Modeling Prep_ service for delisted asset profiles - Refreshed the cryptocurrencies list - Upgraded `prettier` from version `3.8.4` to `3.9.6` ### Fixed - Resolved an exception in the user service when getting a non-existent user +- Fixed the missing currency in the get quotes functionality of the _Financial Modeling Prep_ service for cryptocurrencies without an asset profile ## 3.34.0 - 2026-07-25 diff --git a/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts b/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts index 83e7fb6c2..05df65ad1 100644 --- a/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts +++ b/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts @@ -111,6 +111,12 @@ export class FinancialModelingPrepService ) .then((res) => res.json()); + if (!quote) { + throw new AssetProfileDelistedError( + `No data found, ${symbol} (${this.getName()}) may be delisted` + ); + } + response.assetClass = AssetClass.LIQUIDITY; response.assetSubClass = AssetSubClass.CRYPTOCURRENCY; response.currency = symbol.substring( @@ -259,7 +265,11 @@ export class FinancialModelingPrepService ).toFixed(3)} seconds`; } - this.logger.error(message); + if (error instanceof AssetProfileDelistedError) { + this.logger.warn(error.message); + } else { + this.logger.error(message); + } } return response; @@ -478,6 +488,8 @@ export class FinancialModelingPrepService currencyBySymbolMap[symbol] = { currency: assetProfile.currency }; + } else if (this.cryptocurrencyService.isCryptocurrency(symbol)) { + currencyBySymbolMap[symbol] = { currency: DEFAULT_CURRENCY }; } }) );