Counter-Strike 2 AI Simulations for Polymarket Betting
A machine learning system that clones professional Counter-Strike 2 players, simulates full matches under fog of war, and prices live betting markets.
This is my largest and most technical project. It brings together data engineering, deep learning, and market modeling into one system that studies how professional Counter-Strike 2 matches play out and turns that understanding into prices for live betting markets.
Data collection
The foundation is a large library of professional match demos. I built a pipeline that pulls GOTV demo files from HLTV and FACEIT, parses them with demoparser2, and pulls out per player positions, view angles, health, economy, grenades, and round events. Movement is sampled at a lower rate while aim is re-parsed at a higher rate to capture each player’s aiming fingerprint. The pipeline downloads a match, extracts only the features it needs, writes them to compressed Parquet, and deletes the raw file so storage stays bounded. The corpus covers roughly 2,000 professional matches plus several thousand additional community demos, stored on Backblaze B2 and queried in place with DuckDB.
Training
Instead of predicting kills directly, the system learns how individual players behave. A transformer learns movement and decision making from the demo data, and each professional player gets a specialized version of that model so their personal tendencies carry through. A separate sequence model captures the shape of their aim and flicks. To keep the clones honest, they are graded by a different family of models that never saw the training setup, along with a held out test set that stays locked away.
Polymarket integration
The system connects to Polymarket to read live Counter-Strike markets. It finds active markets through the Gamma API and captures the live order book over a WebSocket feed, logging the best bid, best ask, and size behind every price change. That gives a continuous record of how a market moves during a match, which is what the model prices against.
Simulation
Ten player clones are dropped into a shared match simulator that plays full five on five rounds under fog of war, so each agent only acts on what it can actually see. Movement runs on a zone graph of the map, duels resolve through player ratings and equipment, and the economy updates from round to round. A team strategy layer sits on top so the five agents play like a coordinated team rather than five individuals.
Layered Monte Carlo methodology
Live win probability is built in layers. A particle filter tracks the current round by pre rolling thousands of possible round states and dropping the ones that no longer match what has happened. An economy aware Monte Carlo tree then rolls the rest of the map forward round by round, updating each team’s buy and score until one side reaches the win. A final analytic layer folds those rounds into map and series probabilities without adding noise. Together these turn a live match into a price that updates as the game unfolds.