Operator guide

Aggregate retail bets into future positions.

Keep customer accounting in your own ledger, then buy one immutable interval at any open 10,000-block boundary.

Quote and contribute

  1. Choose one of the next ten rounds beginning at roundIdForBlock(block.number).
  2. Read its current aggregate and bankrollAssets().
  3. Quote the post-contribution aggregate, requested target payout, and payout gap limited by your maxEdgeQ32.
  4. Call placeBet(roundId, targetPayout, maxEdgeQ32, beneficiary, positionCommitment) with stake as msg.value.

BetPlaced returns the round-local position index and aggregate; derive the target with targetBlockForRound. Its immutable interval is [aggregate − stake, aggregate). The payout quote remains indicative until the target because no bankroll is reserved.

Commit customer tickets

positionCommitment is an immutable, opaque bytes32 recorded in BetPlaced but not retained in contract storage. Luckotto does not interpret it or include it in the draw. A casino can commit a domain-separated Merkle-sum ticket manifest and terms, then give each player an inclusion proof for their stake-weighted subrange. Use bytes32(0) when no external commitment is needed and archive canonical placement events for long-term retrieval.

Accept variable capacity

Bankroll capital cannot be divested while betting is active. Investments and earlier round outcomes may still change a later settlement bankroll, so the payout gap remains variable within the stored edge cap. At a positioned target, new investment pauses until settlement or expiry.

Reconcile events

Index BetPlaced, RoundResolved, RoundExpired, and BetClaimed by canonical log location. Key positions by (roundId, positionIndex), resolutions by round, and rewind a safety tail before replacing reorged events.

Resolve and claim

Reconstruct the target block's canonical RLP header, derive the first Quicknet round at or after its timestamp plus 1,800 seconds, identify the interval containing the candidate point, and call settle. Anyone may call claimWinner for the stored beneficiary; that beneficiary may instead call claimWinnerTo to recover to another recipient. A winning proof must land within 8,191 blocks after the target; otherwise expireRound forfeits aggregate stake to the bankroll.

Wind-down and failsafe

The owner may freeze() at any time; anyone may freeze after renewable sunsetAt. Existing rounds continue, and divestment opens after all pending rounds finalize. One year after freezing, drain(recipient) lets the owner transfer all cash to a selected external recipient without clearing outstanding accounting.