Causal forecasting and execution

Gridiron Oracle

Forecasts every NFL player's weekly stats from data known before kickoff, checks each new model against a frozen release before it ships, and runs signals through a C++ engine in under half a microsecond.

  • Python
  • C++
  • XGBoost
  • LightGBM
  • CatBoost
  • FastAPI
  • PostgreSQL
  • React

Key numbers

  • 0.46µs

    p99 message latency in the C++ ring

  • 17–23×

    lower p99 than a mutex queue

  • 100M+msg/s

    ring buffer throughput

  • 74 of 75

    stat-position seasons beat naive baselines, about 7% better MAE

How it works

  1. Public NFL datanflverse
  2. Validate and storePostgreSQL
  3. Featuresonly the past
  4. Four model typesGBDTs and a transformer
  5. BlendRidge per stat, position
  6. Release gatevs a frozen release
  7. APIpinned results only
  8. WebsiteReact
  9. C++ enginelock-free ring, Kelly sizing
Public NFL data is validated and stored, turned into features that use only the past, and fed to four model types. A small linear blend per stat and position combines them. A frozen release gate decides what ships; the API serves only pinned results to the website, and a separate C++ engine handles fast simulation and bet sizing.

Decisions that matter

  • Only data known before kickoff

    Every feature is built from games already played. Player form is tracked with a Kalman filter that only looks backward, so the model cannot peek at the result it is predicting.

  • Nothing ships without passing a frozen gate

    A new model is compared against a frozen earlier release, and the server refuses any result whose fingerprint does not match what passed. That is how served predictions stay identical to the offline ones: all 80,404 rows checked match exactly.

  • Risk limits live in the engine

    The C++ engine sizes bets at a quarter of the Kelly amount and caps exposure at 5% per player and 20% per game, so one bad forecast cannot sink the bankroll.

Results

My lock-free ring has a p99 17–23× lower than a mutex queue.

0.1 µs1 µs10 µs100k messages / s18× lower9.1 µs0.50 µs500k messages / s17× lower7.9 µs0.46 µs1M messages / s23× lower10.5 µs0.46 µs
  • Lock-free ring
  • Mutex + std::queue
  • Dot is p50, tick is p99

Tap a rate

Cold open-loop latency, median of 3 reps (2 s warmup, 8 s measure, 30 s cooldown). Quote p50 and p99 only; p99.9 and max are scheduler tail. Apple M2 Pro, one machine; numbers do not transfer.

Latency as a table
Messages / sQueuep50 (µs)p99 (µs)p99 ratio
100kLock-free ring0.120.518.3× lower
100kMutex + std::queue6.299.13baseline
500kLock-free ring0.120.4617.2× lower
500kMutex + std::queue2.427.92baseline
1MLock-free ring0.120.4622.8× lower
1MMutex + std::queue1.2910.5baseline

Limits. In-season forecasts need games that have not been played yet, and the site says so instead of guessing. The engine is built and tested on its own; its link to a live odds feed was not verified.

Next projectMemory-constrained forecasting