fix: Smart Validation Queue respects symbol enabled status (Bug #79)
CRITICAL FIX - Stops Telegram notification spam for disabled symbols Problem: - User receiving unwanted notifications for FARTCOIN (enabled=false) - Three notification types: QUEUED, VALIDATED, ENTERING NOW - Smart Validation Queue queued quality 50-89 signals WITHOUT checking enabled - Data collection working correctly, but validation queue also triggered Root Cause: - check-risk/route.ts lines 442-455 added signals to queue without enabled check - Validation queue sends Telegram at multiple stages (queued, validated, entering) - Execute endpoint checks enabled (line 290) but TOO LATE (after notifications) The Fix: - Added enabled status check BEFORE queueing signals - Check: getActualPositionSizeForSymbol(symbol, config).enabled - If disabled: Skip queue, save to database silently (data collection only) - If enabled: Queue normally with notifications (SOL/BTC/ETH production trading) Files Changed: - app/api/trading/check-risk/route.ts: Lines 442-470 (added enabled check) - .github/copilot-instructions.md: Bug #79 documented in Common Pitfalls Expected Result: - No more FARTCOIN Telegram notifications - 1-minute data collection continues silently - Only enabled symbols (SOL/BTC/ETH) send validation notifications Severity: 6/10 (annoying but not financially harmful) Status: Code fixed, awaiting deployment verification
This commit is contained in:
@@ -447,23 +447,32 @@ export async function POST(request: NextRequest): Promise<NextResponse<RiskCheck
|
||||
// CRITICAL FIX (Dec 1, 2025): Normalize TradingView symbol format to Drift format
|
||||
const normalizedSymbol = normalizeTradingViewSymbol(body.symbol)
|
||||
|
||||
const queued = await validationQueue.addSignal({
|
||||
blockReason: 'SMART_VALIDATION_QUEUED',
|
||||
symbol: normalizedSymbol,
|
||||
direction: body.direction,
|
||||
originalPrice: currentPrice,
|
||||
qualityScore: qualityScore.score,
|
||||
atr: body.atr,
|
||||
adx: body.adx,
|
||||
rsi: body.rsi,
|
||||
volumeRatio: body.volumeRatio,
|
||||
pricePosition: body.pricePosition,
|
||||
indicatorVersion: body.indicatorVersion || 'v5',
|
||||
timeframe: body.timeframe || '5',
|
||||
})
|
||||
// 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 } = getActualPositionSizeForSymbol(normalizedSymbol, config)
|
||||
|
||||
if (queued) {
|
||||
console.log(`🧠 Signal queued for smart validation: ${normalizedSymbol} ${body.direction} (quality ${qualityScore.score})`)
|
||||
if (!enabled) {
|
||||
console.log(`⛔ Skipping validation queue: ${normalizedSymbol} trading disabled (data collection only)`)
|
||||
console.log(` Signal will be saved to database for analysis without notifications`)
|
||||
} else {
|
||||
const queued = await validationQueue.addSignal({
|
||||
blockReason: 'SMART_VALIDATION_QUEUED',
|
||||
symbol: normalizedSymbol,
|
||||
direction: body.direction,
|
||||
originalPrice: currentPrice,
|
||||
qualityScore: qualityScore.score,
|
||||
atr: body.atr,
|
||||
adx: body.adx,
|
||||
rsi: body.rsi,
|
||||
volumeRatio: body.volumeRatio,
|
||||
pricePosition: body.pricePosition,
|
||||
indicatorVersion: body.indicatorVersion || 'v5',
|
||||
timeframe: body.timeframe || '5',
|
||||
})
|
||||
|
||||
if (queued) {
|
||||
console.log(`🧠 Signal queued for smart validation: ${normalizedSymbol} ${body.direction} (quality ${qualityScore.score})`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(`❌ Signal quality too low for validation: ${qualityScore.score} (need 50-89 range)`)
|
||||
|
||||
Reference in New Issue
Block a user