client.actions and handle the full lifecycle of a prediction market on Cyphers - from creation through cancellation or post-settlement withdrawal. Every market creation locks a creator bond of at least $20 USDC, which is returned (plus any LP fees) once the market is settled and you call withdrawCreatorFunds.
createMarket
Creates a binary (Yes / No) prediction market.Parameters
The market question displayed to bettors. Maximum 200 bytes. For YesNo markets, keep this a plain question without any bracket notation.
Categorises the market in the UI. One of:
Crypto, Politics, Sports, Tech, Economy, Culture, Beyond.Unix timestamp (seconds) at which betting closes. Must be at least 60 seconds in the future; the SDK validates this client-side before submitting.
Unix timestamp (seconds) by which the market must be resolved. Must be after
lockTimestamp. If unresolved by this time the market enters the refundable phase and bettors can reclaim their stake.Who is authorised to call
resolveMarket. Use "creator" for manually resolved markets or "pyth" for automated price-feed resolution.Required when
oracleType is "pyth". The Pyth price account public key for the asset being tracked.Return value
Solana transaction signature for the
createMarket instruction.The
PublicKey of the newly created market PDA. Use this as the market argument in all subsequent calls.createMarketMulti
Creates a MultiOutcome prediction market with 2–4 discrete outcomes.Parameters
The market question with embedded outcome labels as a
[Label1|Label2|…] suffix. Maximum 200 bytes total including the suffix.Same categories as
createMarket.Unix timestamp when betting closes.
Unix timestamp by which the market must be resolved.
Resolver authority type.
Number of outcomes. Must match the number of labels in the
[…] suffix exactly.Return value
Solana transaction signature.
Public key of the new market PDA.
cancelMarket
Cancels an active market, returning the creator bond to your wallet. The market must have zero bets placed; once any user has bet, cancellation is permanently blocked on-chain. Always callcancelEligibility first to surface the reason before hitting the RPC:
Parameters
The market PDA returned when you created the market.
Return value
Solana transaction signature.
Only legacy v1/v2 market accounts (577 or 594 bytes) are not cancellable due to a seed change between program versions. The
isLegacyMarketAccount helper identifies these accounts and cancelEligibility will return ok: false for them.withdrawCreatorFunds
Withdraws the creator bond plus any accumulated LP fees from a settled market. The market must be in theclaimable or expired phase (i.e., state = Resolved).
Parameters
The market PDA for the market you created.
Return value
Solana transaction signature. Once confirmed, your wallet receives the bond and LP fee balance.
