Math validators
Math Preflight for Stake Engine — check your math files before upload
By Namz Games
Check a Stake Engine math folder before you upload it. preflight.mjs reads index.json and every lookup table, and in a few seconds tells you:
- whether the folder passes the critical tests that block publication: base mode at 1.0x and cheapest, RTP between 96.0 % and 96.7 % (adjustable), at most 0.5 point between modes, max payout ≤ 500,000x, cost ≤ 2,000x, base standard deviation ≥ 0.6, a win at least once in 50 rounds, file sizes and format;
- which risk classes lower the bet caps of your template, for the 2-Star and 3-Star ratings, and the largest base bet that still fits;
- the review issues studios keep running into: payouts off the 0.10x grid, the exact max win to state in the rules, gaps in the win distribution, books that disagree with the lookup table.
node preflight.mjs path/to/publish --books
Exit code 1 on a critical failure, so it can guard a build or a CI job. --json gives a machine-readable report.
Includes a worked example: a small seeded 5×3, 10-line slot with wilds, scatters and free spins, exported in the publication format, with an honest way to land an exact RTP.
Zero dependencies. Unofficial, not affiliated with Stake or Engine; Engine's own checks at upload remain authoritative.