All projects
Trading / MLactiveFeatured

Polymarket Backtesting Strategies

ML-driven prediction market trading system that fuses ensemble models, Kelly-optimal sizing, and walk-forward validation to exploit mispricings in real-money crypto markets 127% return, 3.15 Sharpe ratio.

Pythonscikit-learnVectorBTBacktraderQuantStatsPlotlyDocker

Skills involved

PythonDockerMachine LearningData ScienceQuantitative Finance

What This Is

A fully live ML trading system for Polymarket one of the largest real-money prediction markets on crypto. The core challenge: prediction markets price probabilities, not prices. That means standard financial ML models don't apply. We had to learn what features predict mispricing in a crowd-wisdom market, when the crowd is wrong, and how to size positions under genuine uncertainty.

Result: 127% return over the test period. 3.15 Sharpe ratio.

The Hard Problems

Prediction markets are adversarial. The market corrects fast. Any alpha you find has a half-life. The interesting engineering is in the full loop signal → sizing → execution → feedback without leaking future information during training.

Walk-forward validation isn't optional here. Standard cross-validation will give you fake results on time-series data. We use expanding-window walk-forward: train on everything up to time T, test on T+1, advance the window, repeat. This is the only honest way to validate a trading strategy.

Kelly Criterion for position sizing. Not fixed fractional, not arbitrary. Kelly gives you the mathematically optimal bet size given your edge and odds maximising long-run geometric growth. In practice we use fractional Kelly (0.25–0.5x) to account for model uncertainty and fat tails.

Current Models and Techniques

  • Ensemble of XGBoost, LightGBM, and logistic regression each captures different non-linearities
  • Feature engineering: volume anomalies, resolution timing patterns, market maker withdrawal signals, sentiment from related news
  • Live execution pipeline fires every 10 minutes via a scheduled job
  • QuantStats for full performance attribution (drawdown, CAGR, VaR, Calmar)
  • Plotly dashboard for real-time P&L and position monitoring

What We're Optimising

  • Signal decay: identifying which features stay predictive vs. which are arbitraged away
  • Model refresh cadence: how often to retrain on live data without overfitting to recent noise
  • Execution slippage: prediction markets have wide spreads; smart order routing matters
  • Feature selection: running SHAP analysis to understand which features drive alpha

What's Next

  • Deploy with real capital on Polymarket
  • Explore deep learning approaches (LSTM, Temporal Fusion Transformer) for sequential bet resolution patterns
  • Implement regime detection: separate models for high-vol vs. low-vol market regimes
  • Add order book microstructure features

Last updated Feb 23, 2026

← Back to all projects