{ p, m }:
p: probability as au64in billionths. Everypis greater than zero, and they sum to exactly 1 000 000 000.m: multiplier as au64in basis points of the stake. 10 000 is 1×, 0 pays nothing, and the ceiling is 100 000 000 (10 000×).
stake × m / 10 000, rounded down, in USDC base units.
The invariant
open_wager computes, in 128-bit integers with no rounding:
f it passes:
bigint.
Examples
Win or nothing. For a target payoutT on stake s at edge e bps:
Refused: pays out more than it takes in.
[{ p: 500_000_000n, m: 21_000n }, { p: 500_000_000n, m: 0n }] returns 105 % on average. open_wager fails with PaytableOverpays.
Refused: fair, but the edge does not cover the split. A 1 % edge paytable with no app fee is fair to the user but leaves the pool less than its 100 bps floor plus the 20 bps protocol fee. open_wager fails with EdgeFloor.
How much a pool can back
The pool reserves each wager’s liability, its worst case net of what the stake brought in:free_balance = assets − reserved liability − open pool credits. The per-wager cap uses the pool edge, net of fees, so inflating the declared edge does not widen it, and every basis point of app fee narrows it. After a drawdown trip the cap is halved for 48 hours.
Sizing a prize
Two consequences matter for an interface:- Only the top multiplier costs capital. A paytable that pays something 90 % of the time can be trivial to back; a single large prize decides what the pool must hold.
- The cap bounds the liability, not the multiplier. On a fixed paytable, a cap
Cadmits a stake of aboutC / (max(m) − 1). The same pool that refuses 25 USDC at 1 000× accepts a few cents at 1 000×.
liability / 0.015:
As the pool fills up, the Kelly term on the free balance can bind instead, so the largest prize the pool accepts falls as utilisation rises.
Show the limit, do not hit it
ReadConfig (for the parameters) and Pool (for totalAssets, totalReservedLiability, openPoolCredits) and apply the checks above in integers to show users the largest prize, or the largest stake, the pool accepts right now. Then simulate the transaction before asking for a signature: the program is the authority, and the pool can move between your read and the user’s click.
Common refusals
The full list is on Errors.