fix: FARTCOIN symbol normalization priority
- Problem: FARTCOIN signals being treated as SOL-PERP
- Root cause: Symbol normalization checked includes('SOL') before FARTCOIN
- Since TradingView may send symbols with 'SOL' in name, order matters
Files changed:
- config/trading.ts: Reordered checks (FARTCOIN before SOL)
- app/api/trading/market-data/route.ts: Added FARTCOIN mappings
Symbol matching now checks:
1. FARTCOIN/FART (most specific)
2. SOL (catch-all for Solana)
3. BTC, ETH (other majors)
4. Default fallback
This fixes TradingView alerts for FARTCOIN 5-min and 1-min data
collection being incorrectly stored as SOL-PERP in BlockedSignal table.
Status: ✅ DEPLOYED Dec 7, 2025 19:30 CET
Next FARTCOIN signal will correctly save as FARTCOIN-PERP
This commit is contained in:
@@ -255,10 +255,12 @@ export const SUPPORTED_MARKETS: Record<string, MarketConfig> = {
|
||||
export function normalizeTradingViewSymbol(tvSymbol: string): string {
|
||||
const upper = tvSymbol.toUpperCase()
|
||||
|
||||
// Check FARTCOIN before SOL (FARTCOIN may contain SOL in ticker name)
|
||||
if (upper.includes('FARTCOIN')) return 'FARTCOIN-PERP'
|
||||
if (upper.includes('FART')) return 'FARTCOIN-PERP'
|
||||
if (upper.includes('SOL')) return 'SOL-PERP'
|
||||
if (upper.includes('BTC')) return 'BTC-PERP'
|
||||
if (upper.includes('ETH')) return 'ETH-PERP'
|
||||
if (upper.includes('FARTCOIN')) return 'FARTCOIN-PERP'
|
||||
|
||||
// Default to SOL if unknown
|
||||
console.warn(`Unknown symbol ${tvSymbol}, defaulting to SOL-PERP`)
|
||||
|
||||
Reference in New Issue
Block a user