fixed up eod and added more aggressive skip logic to te

This commit is contained in:
Boki 2025-07-08 08:51:33 -04:00
parent d47f77fdc7
commit f4366f7289
8 changed files with 53 additions and 15 deletions

View file

@ -1,6 +1,7 @@
import type { BaseHandler } from '@stock-bot/handlers';
import type { DataIngestionServices } from '../../../types';
import { EOD_CONFIG } from '../shared';
import { getEodExchangeSuffix } from '../shared/utils';
interface FetchIntradayInput {
symbol: string;
@ -272,8 +273,8 @@ export async function fetchIntraday(
}
// Build URL
// For US symbols (Country: "USA"), use :US suffix instead of specific exchange code
const exchangeSuffix = symbolCountry === 'USA' ? 'US' : exchange;
// Use utility function to handle US symbols and EUFUND special case
const exchangeSuffix = getEodExchangeSuffix(exchange, symbolCountry);
const url = new URL(`https://eodhd.com/api/intraday/${symbol}.${exchangeSuffix}`);
url.searchParams.append('api_token', apiKey);