Counterparti is running on the Base Sepolia test network. Prize pools use test USDC with no real-world value. Learn more
Counterparti

07 / 10

Prize Mechanics

How prize pools are funded, split, distributed, and what happens when things go wrong.

Fixed vs. open pools

Fixed pool — the organizer deposits a set USDC amount before publishing. Prize breakdown is fixed ($5,000 first / $2,000 second / $1,000 third).

Open pool — anyone can contribute to grow the pool. Prize breakdown is expressed as basis-point percentages ([6000, 3000, 1000] = 60/30/10%). As the pool grows, all prizes scale proportionally.

is_open_pool on the competitions table determines which type. Both types use the same escrow contract; the split is always stored as basis points.

Network fees (gas)

Whoever takes an on-chain action pays its network fee from their own wallet: the organizer for deploying the escrow and announcing winners, contributors for funding, winners for claiming. On Base these are typically a few cents. While Counterparti runs on Base Sepolia, free test ETH is available from public faucets.

Gas handling lives in one place (src/lib/gas.ts and src/hooks/useChainTx.ts) so it can be sponsored later without changing any flows. See Gas.

Platform fee

5% of the pool, taken once, when winners are announced. Hard-coded at escrow creation time — the factory owner cannot raise the fee on existing escrows. Refunds carry no fee.

fee = totalContributed * feeBps / 10_000
netPool = totalContributed - fee
prizeOf[winner_i] = netPool * prizeShareBps[i] / 10_000   (last tier absorbs rounding dust)

The fee is transferred to feeRecipient immediately when announceWinners() is called on the escrow. Winner prizes are pull-based — winners call claimPrize().

Cancellation and refunds

The escrow has three ways to reach Cancelled, after which every contributor calls claimRefund() to reclaim their full contribution:

  1. Organizer cancels — only while the escrow is still empty. Once any funds arrive, the organizer loses the right to cancel.
  2. Platform cancels — Counterparti (feeRecipient) can cancel a funded competition before winners are announced, e.g. if it is abandoned or violates the Terms.
  3. Expiration — if expirationTimestamp passes without announceWinners(), anyone can call cancel().

expirationTimestamp is set when the escrow is deployed:

expirationTimestamp = submissionDeadline + 365 days

Deadline extensions (max 90 days) stay well inside this window.

Deadline extension rules

Organizers can change the submission deadline with constraints:

  • Within 24h of creation: any future deadline allowed (shorten or extend)
  • After 24h: extension only; new deadline must be ≤ original + 90 days
  • After results are announced: no changes

original_submission_deadline is stored on competition creation and never updated, so the cap is always calculated correctly.

Competition lifecycle

1. Organizer creates the competition         → draft in DB (createCompetition)
2. Organizer's wallet calls factory.createEscrow
   → server verifies the EscrowCreated event   (recordEscrowDeployment)
3. Organizer funds the escrow (approve + fund)
4. Organizer publishes                       → server checks totalContributed on-chain
5. Submission deadline passes
6. Organizer picks a winner for every tier
   → server resolves each winner's wallet via Privy (prepareWinnerPayout)
7. Organizer's wallet calls escrow.announceWinners([addr1, addr2, ...])
   → fee sent to feeRecipient, prizeOf[addr_i] assigned
8. Server verifies the WinnersAnnounced event matches the picks, then
   publishes results                         (announceWinners)
9. Winners see "Claim" on the competition page → claimPrize()

Winner wallets are resolved server-side from the winner's Privy account (their embedded wallet, falling back to their first linked wallet), never from client input. The organizer's wallet must be the escrow's on-chain organizer, which is guaranteed by step 2.

Minimum prize pool

$100 USDC minimum for fixed pools, enforced by createCompetition. Publishing requires the escrow to hold the full fixed amount (or any amount, for open pools).