Win Odds

Contract 0.1.1. The adapter publishes table.odds; the operator switch is Show win odds to players on a table style. The standard layout does not show odds; a theme layout can.

A table layout can show the seated player their chance to win the hand: "Win odds vs 2 · 62%". The host works the number out; the layout only draws it. Odds are off by default and appear only on tables whose style the operator switched on, so rooms where assistance is not allowed keep them off.

What the number is built from

Only what the viewer legitimately knows:

  • their own hole cards;
  • the visible board;
  • how many opponents are still in the hand (not folded, dealt in);
  • hands opponents have shown publicly, for example at an all-in showdown, and cards a folded player showed.

Nothing else is read. The derivation (deriveWinOddsRequest in client/src/core/theme/sdk/table/odds/request.ts) uses an opponent’s cards only when the seat has hasRevealedCards, the same rule the seats use to draw faces, so a layout can never learn more from the odds than from the table itself. Spectators get no odds. The server is not involved: it neither sends extra data nor computes anything, and it keeps validating every action as before.

The estimate is the viewer’s equity: the expected share of the pot. win is the chance to win the whole pot alone (a scoop in hi-lo), tie the chance to split it (or take one half in hi-lo), and equity is win plus the split shares.

table.odds

useTableView() (and the table prop of a layout) carries odds: WinOddsView:

FieldMeaning
enabledThe operator’s switch on the table style. Render odds only when this is true.
statusoff, calculating, ready or unavailable (see below).
win, tie, equity0..1, rounded to four decimals; null unless ready.
opponentsLive opponents the estimate is against; 0 when off.
streetpreflop, flop, turn or river; null when off.
methodexact or monte-carlo; null unless ready.
statusWhen
offThe switch is off, or the viewer has no live hand: watching, folded, not dealt in, between hands, the hand is decided, everyone else folded, or the hole cards have not arrived yet.
calculatingA new street, opponent count or shown hand is being worked out. Keep the meter’s space and show a placeholder, so nothing moves. Usually a few frames.
readyThe numbers are current.
unavailableThe switch is on but the variant is not supported (seven-card stud and stud hi-lo, and a mixed game while it deals stud), or the cards cannot be dealt (inconsistent data). Hide the meter.

Hosts before contract 0.1.1 do not set odds. A layout that pins engines.contract to ^0.1.0 reads it as table.odds?.enabled and renders nothing when it is undefined.

function OddsMeter({ table }: { table: TableView }) {
  const odds = table.odds as TableView['odds'] | undefined;
  if (!odds?.enabled || (odds.status !== 'ready' && odds.status !== 'calculating')) return null;
  const percent = odds.status === 'ready' && odds.equity !== null ? Math.round(odds.equity * 100) : null;
  return (
    <div data-pe="win-odds" data-pe-status={odds.status} data-pe-opponents={odds.opponents} data-pe-street={odds.street ?? undefined} data-pe-equity={percent ?? undefined}>
      Win odds vs {odds.opponents} <b>{percent === null ? '—' : `${percent}%`}</b>
    </div>
  );
}

The win-odds DOM node

win-odds is an optional, experimental contract node. A layout that shows odds should mark the meter with it; a layout that does not show odds emits nothing and certifies as before. Properties: status (calculating, ready, unavailable), equity (whole percent, when ready), opponents, street. Certification’s value check fails a layout that shows the node while the adapter’s odds are off or absent, and checks the status, the opponent count, the street and the percentage against the adapter.

The engine

client/src/core/theme/sdk/table/odds/:

  • evaluator.ts: an allocation-free evaluator over card integers, cross-checked against the server’s evaluators (src/game/hand-evaluator/). It covers the best five of seven, the A-2-3-4-5 wheel, Short Deck’s A-6-7-8-9 wheel with a flush above a full house, Omaha’s exactly-two-plus-three rule and the 8-or-better low.
  • equity.ts: createEquityJob(input), an incremental job. Exact enumeration when one unknown opponent (or none) and the remaining board fit EXACT_EVALUATION_BUDGET (2.5 million hand evaluations): every Hold’em turn and river, and a heads-up Hold’em flop. Otherwise Monte-Carlo with a fixed number of deals (MONTE_CARLO_ITERATIONS: 20,000 for Hold’em and Short Deck, 6,000 for Omaha, 5,000 for Omaha hi-lo) from a generator seeded by the inputs, so the same hand always shows the same number. Results are cached per input (hole cards, board, shown hands, opponent count) in a 128-entry LRU.
  • useWinOdds.ts: runs the job in slices of about 8 ms between macrotasks, so dealing, animations and input never wait on it; a new street cancels the job in flight.
VariantOdds
Texas Hold’emyes
Short Deckyes (36-card deck)
Omaha, Omaha 5yes
Omaha Hi-Loyes, as the expected share of a split pot
Seven-card stud, stud hi-lounavailable
Mixed gamethe game it deals now

The operator switch

Games › Table Styles › (edit a style) › Layout & HUD › Show win odds to players stores TableStyle.showWinOdds (column show_win_odds, default false). The public style endpoint (GET /api/v1/lobby/tables/:tableId/style) delivers it with the rest of the style, and TableHostProvider reads it from the page’s style. An edit reaches open tables through the existing style refresh.

Try the live demo Pricing

Have questions about Poker Engine? We reply fast.