How is house edge written into an on-chain roulette contract?

0
1

House edge in an on-chain roulette contract comes from one of three places: a payout multiplier that is smaller than the true odds, a fee line that takes a percentage off each win, or a combination of both. The contract stores multipliers and fees, and the edge is what falls out when those are set against the number of pockets.

The three designs below cover almost every on-chain table, and each shows its edge in a different line of code. Guides to the best crypto roulette sites that run on-chain sometimes quote an edge without saying which design produces it.

Edge from the zero only

The contract has 37 pockets, pays 36 times the stake on a straight up, and takes no fee.

  1. True odds of a straight up are 1 in 37.
  2. Fair payout at those odds would be 37 times the stake.
  3. The contract pays 36 times the stake, so the player receives 36 divided by 37 of fair value, which is 0.973.
  4. Edge is 1 minus 0.973, or 2.7 per cent on every bet type, because every multiplier in the table is built on 36 pockets rather than 37.

A 38-pocket contract paying the same 36 gives 0.947, an edge of 5.3 per cent.

Edge from a fee on wins

The contract has 37 pockets, pays the full 37 times the stake on a straight up, and takes a fee in basis points from every payout.

  1. Fair payout is 37 times the stake, and the contract pays it, so the wheel itself has no edge.
  2. HOUSE_FEE_BPS is set to 270, meaning 2.7 per cent is deducted from each win.
  3. Player receives 0.973 of fair value on a win, the same 2.7 per cent edge as design one.

This appears on tables that advertise “true odds” and apply the fee in the settlement function. The edge has moved, not shrunk.

Edge from both

The contract has 37 pockets, pays 36 times the stake, and takes a fee of 100 basis points.

  1. Multiplier edge from the zero is 2.7 per cent, as in design one.
  2. Fee reduces every win by a further 1 per cent.
  3. Player receives 0.973 times 0.99, or 0.963, of fair value.
  4. Edge is 3.7 per cent.

Here, the page can say “single zero wheel” while the contract takes more. The fee line is the part to look for.

A quick way to compare tables is to compute the straight-up return for each: multiply the win probability, 1 divided by the pocket count, by the multiplier, then by 1 minus the fee. Whatever the design, that one product is the share of fair value the player keeps, and 1 minus it is the edge.

Edge can also hide in three places outside the multipliers:

  • Rounding – Payouts computed in integer units round down, and on very small stakes, the rounding can take a further fraction of a per cent.
  • Zero on even money – With no la partage rule, zero takes the full stake on red, black, odd, even, high and low. With it, half comes back and the even money edge halves to 1.35 per cent.
  • Gas – On a main-chain table, the player pays gas on every bet. On a layer 2, it rounds to nothing.

In a verified contract, the edge is spread across three or four numbers, and one division per number adds them up.

Comments are closed.