|
|
@ -1,6 +1,7 @@
|
|
|
|
import { LookupItem } from '@ghostfolio/api/app/symbol/interfaces/lookup-item.interface';
|
|
|
|
import { LookupItem } from '@ghostfolio/api/app/symbol/interfaces/lookup-item.interface';
|
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
|
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
|
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
|
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
|
|
|
|
|
|
|
|
import { ghostfolioFearAndGreedIndexSymbol } from '@ghostfolio/common/config';
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
DATE_FORMAT,
|
|
|
|
DATE_FORMAT,
|
|
|
|
getToday,
|
|
|
|
getToday,
|
|
|
@ -47,11 +48,11 @@ export class RakutenRapidApiService implements DataProviderInterface {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const symbol = aSymbols[0];
|
|
|
|
const symbol = aSymbols[0];
|
|
|
|
|
|
|
|
|
|
|
|
if (symbol === 'GF.FEAR_AND_GREED_INDEX') {
|
|
|
|
if (symbol === ghostfolioFearAndGreedIndexSymbol) {
|
|
|
|
const fgi = await this.getFearAndGreedIndex();
|
|
|
|
const fgi = await this.getFearAndGreedIndex();
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
'GF.FEAR_AND_GREED_INDEX': {
|
|
|
|
[ghostfolioFearAndGreedIndexSymbol]: {
|
|
|
|
currency: undefined,
|
|
|
|
currency: undefined,
|
|
|
|
dataSource: DataSource.RAKUTEN,
|
|
|
|
dataSource: DataSource.RAKUTEN,
|
|
|
|
marketPrice: fgi.now.value,
|
|
|
|
marketPrice: fgi.now.value,
|
|
|
@ -82,7 +83,7 @@ export class RakutenRapidApiService implements DataProviderInterface {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const symbol = aSymbols[0];
|
|
|
|
const symbol = aSymbols[0];
|
|
|
|
|
|
|
|
|
|
|
|
if (symbol === 'GF.FEAR_AND_GREED_INDEX') {
|
|
|
|
if (symbol === ghostfolioFearAndGreedIndexSymbol) {
|
|
|
|
const fgi = await this.getFearAndGreedIndex();
|
|
|
|
const fgi = await this.getFearAndGreedIndex();
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -118,7 +119,7 @@ export class RakutenRapidApiService implements DataProviderInterface {
|
|
|
|
} catch {}
|
|
|
|
} catch {}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
'GF.FEAR_AND_GREED_INDEX': {
|
|
|
|
[ghostfolioFearAndGreedIndexSymbol]: {
|
|
|
|
[format(getYesterday(), DATE_FORMAT)]: {
|
|
|
|
[format(getYesterday(), DATE_FORMAT)]: {
|
|
|
|
marketPrice: fgi.previousClose.value
|
|
|
|
marketPrice: fgi.previousClose.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|