fix: v11 worker missing use_quality_filters + RSI bounds + wrong import path

THREE critical bugs in cluster/v11_test_worker.py:

1. Missing use_quality_filters parameter when creating MoneyLineV11Inputs
   - Parameter defaults to True but wasn't being passed explicitly
   - Fix: Added use_quality_filters=True to inputs creation

2. Missing fixed RSI parameters (rsi_long_max, rsi_short_min)
   - Worker only passed rsi_long_min and rsi_short_max (sweep params)
   - Missing rsi_long_max=70 and rsi_short_min=30 (fixed params)
   - Fix: Added both fixed parameters to inputs creation

3. Import path mismatch - worker imported OLD version
   - Worker added cluster/ to sys.path, imported from parent directory
   - Old v11_moneyline_all_filters.py (21:40) missing use_quality_filters
   - Fixed v11_moneyline_all_filters.py was in backtester/ subdirectory
   - Fix: Deployed corrected file to /home/comprehensive_sweep/

Result: 0 signals → 1,096-1,186 signals per config ✓

Verified: Local test (314 signals), EPYC dataset test (1,186 signals),
Worker log now shows signal variety across 27 concurrent configs.

Progressive sweep now running successfully on EPYC cluster.
This commit is contained in:
mindesbunister
2025-12-06 22:52:35 +01:00
parent c7f2df09b9
commit 4291f31e64
6 changed files with 155 additions and 3 deletions

View File

@@ -0,0 +1,78 @@
import { NextRequest, NextResponse } from 'next/server'
import { initializeDriftService, getDriftService } from '@/lib/drift/client'
/**
* GET /api/drift/markets
*
* Query Drift Protocol perpetual markets
* Optional query param: ?search=FARTCOIN to filter by symbol
*/
export async function GET(request: NextRequest) {
try {
const searchParams = request.nextUrl.searchParams
const searchSymbol = searchParams.get('search')?.toUpperCase()
await initializeDriftService()
const driftService = getDriftService()
const driftClient = driftService.getClient()
const perpMarketAccounts = driftClient.getPerpMarketAccounts()
if (!perpMarketAccounts || perpMarketAccounts.length === 0) {
return NextResponse.json({ markets: [] })
}
const markets = perpMarketAccounts.map((market, index) => {
if (!market) return null
// Decode market name from bytes
const nameBytes = market.name as unknown as number[]
const symbol = nameBytes
? String.fromCharCode(...Array.from(nameBytes).filter((b: number) => b !== 0)).trim()
: `Market-${index}`
const minOrderSize = market.amm?.minOrderSize
? Number(market.amm.minOrderSize) / 1e9
: 0
const tickSize = market.amm?.orderTickSize
? Number(market.amm.orderTickSize) / 1e6
: 0.0001
const oracleAddress = market.amm?.oracle?.toString() || 'N/A'
return {
index,
symbol,
oracleAddress,
minOrderSize,
tickSize,
marginRatioInitial: market.marginRatioInitial
? Number(market.marginRatioInitial) / 10000
: 0,
marginRatioMaintenance: market.marginRatioMaintenance
? Number(market.marginRatioMaintenance) / 10000
: 0,
}
}).filter(Boolean)
// Filter by search if provided
const filtered = searchSymbol
? markets.filter(m => m && m.symbol.toUpperCase().includes(searchSymbol))
: markets
await driftService.disconnect()
return NextResponse.json({
total: markets.length,
filtered: filtered.length,
markets: filtered,
})
} catch (error: any) {
console.error('❌ Error fetching markets:', error)
return NextResponse.json(
{ error: 'Failed to fetch markets', message: error.message },
{ status: 500 }
)
}
}