Every engine
03Engine

Hold'em market

Three hold'em hands are dealt face up; the board comes by street; the player buys an outcome at its exact probability and may sell at any street.

Kind
a traded market on a hold'em hand
Largest win
Set by the play, not by a table
Name in the files
holdem_market
Version
72052857e4d0

Download this engine as one file

What the player sets

Nothing before the round: the choices are made during it.

Every round also takes the return dial in basis points, 9600 to 9900, and a stake.

The round, in order

  1. the cards left are 0..51. At the start the three hands are dealt and shown: six take(left), the first hand's two cards, then the second's, then the third's. The board is not drawn until it is dealt: each "next" draws its street with take(left), the flop three cards, the turn one, the river one
  2. four outcomes: hand 1, hand 2, hand 3 wins alone, or a tie for best
  3. a hand is the best five cards out of its two and the five of the board, by the usual order: straight flush, four of a kind, full house, flush, straight, three of a kind, two pair, a pair, high card; within one kind the higher ranks win, compared in the usual order (the four, the three or the pairs first, then the other cards from the top); an ace also makes the five-high straight; suits never break a tie
  4. the price of an outcome is its exact probability: of every set of cards that can still complete the board, taken from the 52 less the hands and the board so far, the share on which that outcome happens. Kept as two whole numbers, n boards of d
  5. a position can be bought while its price is between 2% and 98% (2 x d <= 100 x n <= 98 x d)

int_below(m) is a whole number from 0 to m-1: limit = 2^64 - (2^64 mod m); take values until v < limit; return v mod m. shuffle: Fisher-Yates from the end, j = int_below(i+1). Words: HMAC-SHA256(key = seed, "STORM-DRBG|" || u64be(j)), cut into big-endian u64s.

What the player may do

  • next: deal the next street
  • buy_p1, buy_p2, buy_p3, buy_push: buy that outcome (push is the tie for best)
  • sell

What it pays

A position bought at probability p pays rtp / p if it wins; sold at a street it pays rtp x (probability now / p). Both are worked in whole counts of boards, not rounded prices: bought when the outcome wins n of d boards, it pays rtp x d div n; sold when it wins c of t boards, rtp x c x d div (t x n). With no position at the river the stake comes back.

Tables

No table: a traded market, not a table. What is paid follows from the steps above.

On Storm

In Storm’s core this engine is built from this page as written, with the settings and the largest win above, and is right when it reproduces the test rounds below. The rest of this part is about the templates Storm has live today, which is the way onto Storm until then.

Our reading against Storm’s templates: does not fit. A traded market, not a table.

On the templates it would take: a card template. Storm lists it as not enabled.

Check a build against ours

51 whole rounds, each from a seed given in the file. A build is right when, from the same seed, settings, dial and actions, it makes the same draws in the same order and pays the same amount. The seed of a test round is sha256("rain-engine-vector|<engine>|<case>|<rtp_bps>|<i>"), given in hex in each vector.

buy on the flop, hold, dial 9900
seed f498cbe2a53fde2fec3cd28df30634480450300f3570036d176ee3ae4bafcd5a
settings {}
actions [["next"],["buy_p1"],["next"],["next"]]
draws int_below(52) = 21, int_below(51) = 46, int_below(50) = 6, int_below(49) = 15, int_below(48) = 31, int_below(47) = 35, int_below(46) = 41, int_below(45) = 15, int_below(44) = 26, int_below(43) = 18, int_below(42) = 14
pays 1.2031x (payX10k 12031)
buy on the turn, hold, dial 9900
seed 61a620991a2d0b5efd922c893d2b31bf98d71156b5e63eb4a374cec007f86594
settings {}
actions [["next"],["next"],["buy_p1"],["next"]]
draws int_below(52) = 7, int_below(51) = 25, int_below(50) = 9, int_below(49) = 10, int_below(48) = 25, int_below(47) = 29, int_below(46) = 9, int_below(45) = 23, int_below(44) = 5, int_below(43) = 30, int_below(42) = 12
pays 1.7325x (payX10k 17325)

The rest are in this engine’s file, with the full result of each round. The reference build plays this engine and reproduces every one of them.

Nothing hidden is fixed when a round starts: what a step shows is drawn at that step. So the same file holds 51 more rounds played with a seed of its own for the start and for every action after it, as a round runs where each step’s randomness is formed only after the player has acted. The rules are the same; only the generator is started afresh at each step.