Inspiration

I test trading strategies in a quantitative approach and wanted to apply the same idea to poker. I wanted a way to model how someone plays, test that strategy and see how it does. I was thinking about this because of a conversation I had with a friend. He said this one casino always had "nits" (people who only play really goods hands) and I thought how cool it would be to test your strategy and see which players you play better than.

What it does

It creates a model of the users poker strategy, then allows them to test that against simulated opponents over thousands of hands. Users can review the hands then verify the accuracy of the model, the model then learns.

How I built it

I began by researching common poker strategies and translating them into rule-based opponent profiles. I then built a poker engine capable of enforcing legal actions, managing betting rounds, evaluating hands, and simulating complete games.

The application uses Next.js and React with simulations running directly in the browser. A bucketed behavioral policy learns from the user’s calibration decisions, including position, hand context, bet sizing, and timing. Seeded simulations make experiments reproducible, while Supabase provides authentication and secure cloud storage for strategies, experiments, reviews, and hand histories.

Challenges we ran into

One of the biggest challenges was ensuring every simulated action remained legal, especially around all-ins, short raises, and situations where betting action is reopened.

Another challenge was learning a useful strategy from a relatively small calibration sample. I created a fallback hierarchy so the model can use broader behavioral patterns when it does not have enough examples for an exact situation.

We also had to balance realism with performance. Opponents have realistic decision times and timing tendencies during calibration, but large simulations use virtual time so thousands of hands can run quickly. Designing a full poker table and detailed analytics that remained usable on phones introduced an additional interface challenge.

Accomplishments that we're proud of

I am proud of building a model that backtests and analyzes a poker strategy.

The simulator supports reproducible experiments, position-specific starting ranges, timing-aware decisions, multiple table sizes and stakes, detailed hand histories, and 14 distinct opponent archetypes. It also provides advanced metrics in a beginner-friendly way, including win rate, uncertainty, maximum drawdown, decision confidence, and performance against each opponent type.

I am mainly proud that users can review simulated decisions, submit corrections, and measurably update the strategy model instead of treating each simulation as a static result. I think this is the most important part of the whole engine and I tried to put emphasis on it.

What I learned

I learned that a poker strategy cannot be represented well by a single aggression or tightness score. Position, bet sizing, previous actions, opponent behavior, and sample size all have a major effect on a decision.

I learned how to use 5.6 in an effective way.

What's next for Quantitative Poker Simulation

Adding a something to help improve users poker strategies against different people. I also want to get enough data to better represent the opponent bots in the backtesting engine. Currently I believe they could use some work but It would be very useful to have more data to fix this problem. I also know my video isnt the best but the website's worth a shot, the model's pretty accurate even on the first pass.

Built With

Share this project:

Updates