From 6e97a3c97871a6660626bc2b9d82fc04619c4cf4 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 22 Jun 2026 21:19:37 +0200 Subject: [PATCH] Task/remove deprecated fear and greed index symbol (#7103) Remove deprecated fear and greed index symbol --- .../rapid-api/rapid-api.service.ts | 19 +++---------------- .../twitter-bot/twitter-bot.service.ts | 4 ++-- .../home-market/home-market.component.ts | 4 ++-- libs/common/src/lib/config.ts | 4 +++- libs/common/src/lib/helper.ts | 2 -- 5 files changed, 10 insertions(+), 23 deletions(-) diff --git a/apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts b/apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts index 9941ae9eb..d8ba1ec67 100644 --- a/apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts +++ b/apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts @@ -8,10 +8,7 @@ import { GetSearchParams } from '@ghostfolio/api/services/data-provider/interfaces/data-provider.interface'; import { FetchService } from '@ghostfolio/api/services/fetch/fetch.service'; -import { - ghostfolioFearAndGreedIndexSymbol, - ghostfolioFearAndGreedIndexSymbolStocks -} from '@ghostfolio/common/config'; +import { ghostfolioFearAndGreedIndexSymbolStocks } from '@ghostfolio/common/config'; import { DATE_FORMAT, getYesterday } from '@ghostfolio/common/helper'; import { DataProviderHistoricalResponse, @@ -64,12 +61,7 @@ export class RapidApiService implements DataProviderInterface { [symbol: string]: { [date: string]: DataProviderHistoricalResponse }; }> { try { - if ( - [ - ghostfolioFearAndGreedIndexSymbol, - ghostfolioFearAndGreedIndexSymbolStocks - ].includes(symbol) - ) { + if (symbol === ghostfolioFearAndGreedIndexSymbolStocks) { const fgi = await this.getFearAndGreedIndex(); return { @@ -106,12 +98,7 @@ export class RapidApiService implements DataProviderInterface { try { const symbol = symbols[0]; - if ( - [ - ghostfolioFearAndGreedIndexSymbol, - ghostfolioFearAndGreedIndexSymbolStocks - ].includes(symbol) - ) { + if (symbol === ghostfolioFearAndGreedIndexSymbolStocks) { const fgi = await this.getFearAndGreedIndex(); return { diff --git a/apps/api/src/services/twitter-bot/twitter-bot.service.ts b/apps/api/src/services/twitter-bot/twitter-bot.service.ts index ffd0c5452..4e6fd5bb2 100644 --- a/apps/api/src/services/twitter-bot/twitter-bot.service.ts +++ b/apps/api/src/services/twitter-bot/twitter-bot.service.ts @@ -3,7 +3,7 @@ import { BenchmarkService } from '@ghostfolio/api/services/benchmark/benchmark.s import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { ghostfolioFearAndGreedIndexDataSourceStocks, - ghostfolioFearAndGreedIndexSymbol + ghostfolioFearAndGreedIndexSymbolStocks } from '@ghostfolio/common/config'; import { resolveFearAndGreedIndex, @@ -49,7 +49,7 @@ export class TwitterBotService implements OnModuleInit { const symbolItem = await this.symbolService.get({ dataGatheringItem: { dataSource: ghostfolioFearAndGreedIndexDataSourceStocks, - symbol: ghostfolioFearAndGreedIndexSymbol + symbol: ghostfolioFearAndGreedIndexSymbolStocks } }); diff --git a/apps/client/src/app/components/home-market/home-market.component.ts b/apps/client/src/app/components/home-market/home-market.component.ts index dd0c38cea..40b8f145b 100644 --- a/apps/client/src/app/components/home-market/home-market.component.ts +++ b/apps/client/src/app/components/home-market/home-market.component.ts @@ -1,6 +1,6 @@ import { GfFearAndGreedIndexComponent } from '@ghostfolio/client/components/fear-and-greed-index/fear-and-greed-index.component'; import { UserService } from '@ghostfolio/client/services/user/user.service'; -import { ghostfolioFearAndGreedIndexSymbol } from '@ghostfolio/common/config'; +import { ghostfolioFearAndGreedIndexSymbolStocks } from '@ghostfolio/common/config'; import { resetHours } from '@ghostfolio/common/helper'; import { Benchmark, @@ -86,7 +86,7 @@ export class GfHomeMarketComponent implements OnInit { .fetchSymbolItem({ dataSource: this.info.fearAndGreedDataSource, includeHistoricalData: this.numberOfDays, - symbol: ghostfolioFearAndGreedIndexSymbol + symbol: ghostfolioFearAndGreedIndexSymbolStocks }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ historicalData, marketPrice }) => { diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.ts index e21271ca1..40412d627 100644 --- a/libs/common/src/lib/config.ts +++ b/libs/common/src/lib/config.ts @@ -5,11 +5,13 @@ import ms from 'ms'; import { ColorScheme, DateRange } from './types'; export const ghostfolioPrefix = 'GF'; + +/* @deprecated */ export const ghostfolioScraperApiSymbolPrefix = `_${ghostfolioPrefix}_`; + export const ghostfolioFearAndGreedIndexDataSourceCryptocurrencies = DataSource.MANUAL; export const ghostfolioFearAndGreedIndexDataSourceStocks = DataSource.RAPID_API; -export const ghostfolioFearAndGreedIndexSymbol = `${ghostfolioScraperApiSymbolPrefix}FEAR_AND_GREED_INDEX`; export const ghostfolioFearAndGreedIndexSymbolCryptocurrencies = `${ghostfolioPrefix}_FEAR_AND_GREED_INDEX_CRYPTOCURRENCIES`; export const ghostfolioFearAndGreedIndexSymbolStocks = `${ghostfolioPrefix}_FEAR_AND_GREED_INDEX_STOCKS`; diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.ts index 5bd6671f2..3219ed553 100644 --- a/libs/common/src/lib/helper.ts +++ b/libs/common/src/lib/helper.ts @@ -38,7 +38,6 @@ import { DEFAULT_CURRENCY, DEFAULT_LOCALE, DERIVED_CURRENCIES, - ghostfolioFearAndGreedIndexSymbol, ghostfolioFearAndGreedIndexSymbolCryptocurrencies, ghostfolioFearAndGreedIndexSymbolStocks, ghostfolioScraperApiSymbolPrefix @@ -157,7 +156,6 @@ export function canDeleteAssetProfile({ !isBenchmark && !isDerivedCurrency(getCurrencyFromSymbol(symbol)) && !isRootCurrency(getCurrencyFromSymbol(symbol)) && - symbol !== ghostfolioFearAndGreedIndexSymbol && symbol !== ghostfolioFearAndGreedIndexSymbolCryptocurrencies && symbol !== ghostfolioFearAndGreedIndexSymbolStocks && watchedByCount === 0