Skip to main content
Once a market is resolved or expired, winners and refund-eligible bettors each trigger an Arcium MPC computation to verify their encrypted position and compute the transfer amount - no local private key required.

claimPayout

Claims the winner’s USDC payout from a resolved market. The Arcium MPC circuit verifies the encrypted position against the revealed outcome and computes the transfer amount.
TypeScript
You do not need the local private key to claim. The Arcium reveal circuit already decrypted the bet pools when the market resolved - the payout ratio is now public on-chain. The claim circuit uses your position’s netAmount field (plaintext) to compute your share.

Parameters

PublicKey
required
Transaction fee payer.
PublicKey
required
The bettor’s public key. Must match the position’s user field.
bigint | number
required
A resolved market in claimable phase.
bigint | number
Which position to claim. Defaults to 0n. Users who placed multiple bets on the same market must pass the specific index. Check EncryptedPositionAccount.betIndex on each position to find which ones to claim.
bigint
Arcium computation slot. Random by default.
number
Milliseconds to wait for the MPC callback. Defaults to 60_000.
ProgressCallback
Progress stages: validating → fetching-state → submitting → awaiting-callback → refetching → done.

Return value

string
Transaction signature.
EncryptedPositionAccount | null
Updated position with claimed: true.
MarketAccount | null
Updated market account.
ComputationResult
Arcium callback result.

claimRefund

Claims a full refund when the market’s resolver never posted an outcome and the resolution deadline has passed.
TypeScript
Takes the same parameters as claimPayout. The market must be in refundable phase - past the resolution deadline with no outcome posted (state === Unresolved).
Refunds are available when the resolver fails to post within DEFAULT_RESOLUTION_WINDOW_SECS (7 days after close time). The refunded amount is the user’s original net stake.

Claiming multiple bets

If a user placed multiple bets on the same market, each position must be claimed separately.
TypeScript

Phase requirements

Call marketPhase(market) from @cypher-zk/sdk to check the current phase before showing claim buttons.