fix: Simplify enabled check to use config directly without async call
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { getMergedConfig, TradingConfig, getMinQualityScoreForDirection, normalizeTradingViewSymbol, getActualPositionSizeForSymbol } from '@/config/trading'
|
||||
import { getMergedConfig, TradingConfig, getMinQualityScoreForDirection, normalizeTradingViewSymbol } from '@/config/trading'
|
||||
import { getInitializedPositionManager, ActiveTrade } from '@/lib/trading/position-manager'
|
||||
import { getLastTradeTime, getLastTradeTimeForSymbol, getTradesInLastHour, getTodayPnL, createBlockedSignal } from '@/lib/database/trades'
|
||||
import { getPythPriceMonitor } from '@/lib/pyth/price-monitor'
|
||||
@@ -449,7 +449,14 @@ export async function POST(request: NextRequest): Promise<NextResponse<RiskCheck
|
||||
|
||||
// CRITICAL FIX (Dec 15, 2025): Check if symbol trading is enabled BEFORE queueing
|
||||
// Don't send Telegram notifications for data-collection-only symbols
|
||||
const { enabled } = await getActualPositionSizeForSymbol(normalizedSymbol, config)
|
||||
let enabled = true
|
||||
if (normalizedSymbol === 'SOL-PERP' && config.solana) {
|
||||
enabled = config.solana.enabled
|
||||
} else if (normalizedSymbol === 'ETH-PERP' && config.ethereum) {
|
||||
enabled = config.ethereum.enabled
|
||||
} else if (normalizedSymbol === 'FARTCOIN-PERP' && config.fartcoin) {
|
||||
enabled = config.fartcoin.enabled
|
||||
}
|
||||
|
||||
if (!enabled) {
|
||||
console.log(`⛔ Skipping validation queue: ${normalizedSymbol} trading disabled (data collection only)`)
|
||||
|
||||
Reference in New Issue
Block a user