Integrate skill contests.
Your studio defines the game and its rules. The SDK provides pool preparation, entry receipts and settlement primitives.
Prepare your studio’s pool#
Use epochs.preparePool() to obtain an unsigned transaction and the fee sink. Inspect it, sign from your studio wallet, broadcast, then register ownership with the supported wallet proof. Preparation alone neither broadcasts nor proves readiness.
Create a series with epochs.prepareSeries(), sign its returned transaction, and read the series until created=true. Use the actual pool/series configuration for price, split and timer; do not copy shared sandbox values into a studio release.
Choose the right contest path#
| Path | Use |
|---|---|
| Rolling epochs | Own-pool lifecycle: epochs.preparePool / registerPool / prepareSeries / enter / get / executeSettlement / prize / withdraw |
| Round-based integration | Existing supported round lifecycle: rounds.open / getWithMeta / settle and enterRound. Keep roundKey and identity pinned. |
Verify paid admission#
Your backend checks a paid entry before admitting a scored attempt. Round-based entries must preserve the exact roundKey and wallet#attemptId identity across pay and admission. Epoch integrations use their returned pool, series and epoch identifiers without translating them into the legacy round path.
import { Playmos } from '@playmos/sdk';export async function enterYourRound(playmos: Playmos, gameId: string, roundKey: string,wallet: string, attemptId: string, amount: string,) {return playmos.enterRound({gameId,roundId: roundKey,roundKey, // Use the same exact key for server admission.identity: `${wallet}#${attemptId}`, // A unique identity for each paid attempt.playerId: wallet,amount,idempotencyKey: attemptId,});}
Your game owns score authority#
Record the score only through your trusted game backend. Existing first-party games keep their deterministic replay validation. Studio integrations need their approved validation model; a browser event cannot settle a contest.
Settle, then expose winnings#
A submitted settlement can still be settling. Read the relevant round or epoch until terminal success. Keep allocated, claimable, withdrawn and refunded amounts distinct. Old contest obligations survive release changes and takedown.
Legacy round operations#
On a supported legacy PrizePool, a secret-key backend uses rounds.open, player enterRound, then rounds.lock and rounds.settle. The payout rule can distribute the prize to one or several ranked wallet addresses. closeAt is advisory; it is not the epoch contract’s hard clock. A public key cannot operate or pay winners.
Keep an explicit, persisted attempt identity on your game path. A no-wallet sandbox entry can instead return a synthetic sandbox#entry_… identity; retain that response and never invent a wallet for a player who did not sign. A sandbox smoke is not a game template or production admission proof.
When settlement returns settling, check the same round’s state rather than blindly submitting another settlement. The player then reads payout notices and withdraws credited prizes. A pot balance is not a paid winner.