jonnify·bcs /bcs/codemojex/scoring-and-settlement/settlement-strategies

B7.4.3 · dive 3 of 3 · module B7.4

Settlement strategies.

A live room settles continuously as the board moves; a blind room settles once at the close with a single idempotent batch that pays the top entrants by accuracy from the bank, guarded by a claim so a retry pays no one twice.

Live continuous standings, a sealed batch top-K at the close, and an idempotent claim. Select a part.
live roomrunning standingsthe board moves per guess blind roomone batch at the closepays the top-K by accuracy settled onceguarded by a claim in Valkeya retry pays no one twicethe record of truth is Postgres
readout · Select a part. A live room settles continuously as standings move; a blind room settles once at the close with a batch that pays the top-K by accuracy; both pass through an idempotent claim so a winner is paid one time.
§1

The idea

codemojex · settlement strategies

How a game pays out depends on its mode. A live room settles continuously: each scored guess updates the standings, the board moves, and a player sees their rank shift in the moment. There is no separate payout step beyond keeping the sorted set current, because the standing itself is the result.

A blind room settles once, at the close. When the timer ends, a single batch pass reads the final standings and pays the top entrants by accuracy — the most-accurate few share the bank that every paid attempt funded. Nothing is paid before the close, which is what lets the blind mode hold its silence and still be fair to a late entrant.

A batch payout has to be idempotent, because a close can fire more than once and a node can retry. The reference implementation guards the settlement with a claim — a single marker that the game has settled — so the pass runs to completion exactly once and a winner is paid one time. The claim and the standings live in Valkey; the settled outcome and the balances are written to Postgres as the record of truth.

§4

The doors

the sibling courses
§2

References

sources · related

Sources

Related