The Stake Engine Math SDK is a comprehensive framework for building, simulating, and optimizing slot game math. It generates all backend files, lookup tables, and simulation results required to publish a game on Stake Engine — the Remote Gaming Server (RGS) powering Stake.com.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/StakeEngine/math-sdk/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
Run your first game simulation in minutes using a provided sample game.
Installation
Set up Python, virtual environment, and optional Rust for optimization.
Core Concepts
Understand the game format, file structure, and simulation lifecycle.
API Reference
Full reference for all public classes and functions in the SDK.
What the SDK does
The Math SDK handles the complete backend pipeline for a slot game:Define your game
Configure game rules, reelstrips, paytable, and bet modes in
game_config.py using the GameConfig class.Simulate outcomes
Run
create_books() to execute thousands (or millions) of game simulations across multiple CPU threads, producing compressed event books and lookup tables.Optimize win distribution
Run the Rust-powered optimization algorithm to balance your game to a target RTP, adjusting simulation weights to meet payout and hit-rate requirements.
Key features
Four win types
Built-in support for Lines, Ways, Cluster, and Scatter pay calculations with multiplier strategies.
Multi-threaded simulation
Distribute simulations across multiple CPU threads for fast generation of large result sets.
Rust optimization
Iterative weighted sampling algorithm implemented in Rust for high-performance RTP balancing.
Event-driven architecture
All game outcomes are expressed as ordered event sequences, consumed directly by the RGS
play/ API.Sample games
Five complete example games covering Lines, Ways, Cluster, Scatter, and Expanding Wilds mechanics.
PAR sheet generation
Automatic hit-rate and RTP analysis with Excel export for regulatory and design review.
Project structure
The SDK separates reusable engine logic (insrc/) from game-specific implementations (in games/<game_id>/):
Games uploaded to Stake Engine must consist of static pre-computed files. The Math SDK generates all required files — books, lookup tables, and config — in the correct format for the RGS.
