TOP 1

The same Elo race, one uniform recycled into the full ranking, with only the winner paid. Odds are RTP ÷ P(win) = RTP·W / wᵢ, so a 400-Elo gap is a 10:1 odds ratio and every racer returns exactly the RTP with no feasibility condition.

one uniform, recycledwinner takes allodds ∝ 1 / strength
open full screen ↗

The math

Loading ALGORITHM.md…

Live API (browser module)

The engine is published as an ES module that implements the RGS provider contract and rolls locally with crypto.getRandomValues: open, valid-bets, bet, collect, with the observed balance semantics (bet debits the stake, collect credits the win, integer minor units). No server, every round live, and any round replays from its seed. Bet types: RACER_1, RACER_2, RACER_3, RACER_4, RACER_5, RACER_6, RACER_7, RACER_8, RACER_9, RACER_10, RACER_11, RACER_12.

import { createGame } from 'https://danvid1009.github.io/gnarone-game-math/top-1/api/rgs.js';

const g = createGame({ preset: 'field-12', mode: 'top1' });  // presets: field-12, field-8, field-6, field-12-tight
                                                       // bet types: RACER_1, RACER_2, RACER_3, RACER_4, RACER_5, RACER_6, RACER_7, RACER_8, RACER_9, RACER_10, RACER_11, RACER_12
const s = g.open();                                    // session, balance 100000, chipLevels [100,200,500,1000,2500,5000,10000]
const r = g.bet({ sessionId: s.sessionId, betAmount: 1000, betType: 'RACER_2' });   // fresh crypto seed; win in r.totalWinAmount
g.collect({ roundId: r.roundId });                                           // credits the win → { balance }

// Replay any fixture: same seed, same code path, same answer as rounds/007.json
g.bet({ sessionId: s.sessionId, betAmount: 1000, betType: 'RACER_2', seed: 'fixture-007' });

Presets and static fixtures

Presets: field-12, field-8, field-6, field-12-tight (default field-12). Each preset is a frozen configuration and its own folder: the config, derived tables and settlement rule in field.json, plus one hundred pre-drawn rounds from seeds fixture-000 … fixture-099 settled for every bet type. The same seed drives every preset, so round 007 uses the same u everywhere, and the live module reproduces any of them when given the seed.

# presets, their parameters, bet types and realised RTP over the 100 rounds
curl -s https://danvid1009.github.io/gnarone-game-math/top-1/api/index.json

# one preset: parameters, tables (bands / odds / ladder / decks), RN intervals, how to settle
curl -s https://danvid1009.github.io/gnarone-game-math/top-1/api/field-12/field.json

# one round (000–099): seed, full outcome, settlement for every bet type
curl -s https://danvid1009.github.io/gnarone-game-math/top-1/api/field-12/rounds/007.json

# all 100 rounds of a preset (stake and win per bet type)
curl -s https://danvid1009.github.io/gnarone-game-math/top-1/api/field-12/rounds.json

# round 007 played through the real calls: request bodies and every response
curl -s https://danvid1009.github.io/gnarone-game-math/top-1/api/field-12/sample-request.json
curl -s https://danvid1009.github.io/gnarone-game-math/top-1/api/field-12/sample-response.json

Settlement rule is spelled out in each preset's field.json under how_to_settle.

Figures

Win probability per racer and the odds that return the RTP.
Win probability per racer and the odds that return the RTP.

Build it yourself

git clone https://github.com/Danvid1009/gnarone-game-math.git
cd gnarone-game-math/race-engine
npm test
node bin/build-race.js --elo 1850,1780,1720,1680,1640,1600,1560,1520,1480,1430,1380,1300 --rtp 0.95 --win-only --js