Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

269 Commits

Folders and files

Repository files navigation

Polymarket Prediction Market Trading System

This repo now includes a complete end-to-end workflow for discovering Polymarket markets, collecting signals, modeling edge, backtesting, monitoring, and optionally executing bets.

Files Added

  • polymarket_explorer.py — fetches top 100 active/open markets from Polymarket and saves to polymarket_markets.json.
  • data_collector.py — enriches markets with polling, crypto, FRED, and NewsAPI sentiment signals into market_signals.json.
  • probability_model.py — builds model probabilities, computes edge and Kelly sizing, and saves model_predictions.json.
  • backtest_polymarket.py — simulates historical strategy performance on resolved markets and saves backtest_results.json.
  • monitor_polymarket.py — Streamlit dashboard with top opportunities, backtest stats, positions, and PnL.
  • bet_executor.py — auto-bet executor via CLOB endpoint with logging and daily-loss circuit breaker.

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the repo root:
NEWSAPI_KEY=your_newsapi_key
POLYMARKET_PRIVATE_KEY=your_wallet_private_key
POLYMARKET_WALLET_ADDRESS=your_wallet_address
PORTFOLIO_VALUE=1000

Run Order

Run the scripts in this order:

  1. Fetch active markets
python polymarket_explorer.py
  1. Collect market signals
python data_collector.py
  1. Build model predictions
python probability_model.py
  1. Backtest historical performance
python backtest_polymarket.py
  1. Launch monitoring dashboard (auto-refresh every 5 minutes)
streamlit run monitor_polymarket.py
  1. Execute high-edge bets (optional/live risk)
python bet_executor.py

Notes

  • All scripts print progress updates and handle API retries.
  • bet_executor.py stops placing bets if daily realized losses exceed 20% of configured portfolio value.
  • News sentiment requires a valid NewsAPI key.
  • Crypto signal in data_collector.py attempts to use checkpoints/gbm_model.pkl if available.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages