Skip to main content

Account types

MarketAccount

The central account for a prediction market. Exists at the market PDA.
v3 markets (393-byte accounts, all markets created with the current program) store the question in a separate MarketQuestion PDA - inlineQuestion will be "". Use fetchMarketQuestions to hydrate questions in batch.

EncryptedPositionAccount

Records an encrypted bet. Exists at the position PDA keyed by (market, user, betIndex).

GlobalStateAccount

Singleton protocol config. There is only one per deployment.

LpPositionAccount

Tracks the creator’s liquidity and accumulated fees per market.

MarketQuestionAccount v0.2+

Stores the question text for v0.2+ markets (separate PDA to save space in MarketAccount).

Fetchers

All fetchers are also available as methods on the CypherClient namespaces.
TypeScript
client.markets.byIds and client.marketQuestions.fetchMany were added in v0.8.8. Both chunk pubkey lists past Solana’s 100-key getMultipleAccountsInfo cap and retry transient errors. Tune via CypherClientOptions.rpcOptions or pass per-call overrides.

Display helpers

TypeScript

marketPhase

Returns a human-readable phase string based on the market’s state and timestamps. Use this to drive UI state.
TypeScript

cancelEligibility

Pre-flight check before showing a cancel button.
TypeScript

parseEmbeddedOptions

Extracts option labels from a [A|B|C] question suffix.
TypeScript

marketFormatVersion

Detects the market account layout version from byte length.
TypeScript
Legacy v1 and v2 accounts have inline questions; v3 accounts use the MarketQuestion PDA.