c8c0962e56
Core intelligence for BetonBLK prop analysis: - POST /api/analyze/prop — single prop analysis - POST /api/analyze/batch — multi-prop analysis for parlay scanner - 6-step pipeline: season avg → recent form → situational splits → cross-book lines → kill conditions → grade (A/B/C/D) - 6 kill conditions: low_minutes, small_sample, b2b_high_usage, blowout_risk, split_conflict, no_opponent_data - Composite scoring with confidence (30-95), bonuses, penalties - Added spreads market to Odds API fetch (zero extra credits) - Full reasoning output with step-by-step breakdown 36 new tests (unit + integration), 128 total across all features Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
16 lines
557 B
JavaScript
16 lines
557 B
JavaScript
function deltaToSignal(delta) {
|
|
const abs = Math.abs(delta);
|
|
if (abs < 0.5) return delta >= 0 ? 'neutral' : 'neutral';
|
|
if (abs < 2.0) return delta >= 0 ? 'lean' : 'lean_bearish';
|
|
if (abs < 4.0) return delta >= 0 ? 'bullish' : 'bearish';
|
|
return delta >= 0 ? 'strong_bullish' : 'strong_bearish';
|
|
}
|
|
|
|
function directedDelta(avg, line, direction) {
|
|
// For "over", positive delta is good. For "under", negative delta is good.
|
|
const raw = avg - line;
|
|
return direction === 'under' ? -raw : raw;
|
|
}
|
|
|
|
module.exports = { deltaToSignal, directedDelta };
|