{ data, isLoading, isError, error } and handle caching, deduplication, and background refetching automatically.
useGlobalState
Fetches the protocol config: fee rates and accepted USDC mint.TypeScript
Always read
globalState.acceptedMint at runtime. Don’t hardcode the USDC mint address - it differs between devnet and mainnet.useMarkets
Fetches markets. Filter by creator, state, or a known list of IDs.TypeScript
{ publicKey: PublicKey, account: MarketAccount }.
The
{ ids } filter mode was added in v0.8.8. It’s the recommended path once a deployment has more than a few hundred markets — useMarkets() with no filter still calls getProgramAccounts and returns the full payload.refetchInterval: 4000 for live odds updates.
useMarketQuestions
Batch-fetches the question text for a list of markets (typically the output ofuseMarkets). Routes through the SDK’s RPC batching layer, so it scales past Solana’s 100-key getMultipleAccountsInfo cap.
TypeScript
Map<marketPdaBase58, questionString>. Markets without a MarketQuestion PDA (legacy v1/v2 inline-question markets) are omitted from the map - fall back to account.inlineQuestion for those.
Cache TTL: 60 seconds. Questions are immutable after market creation. Query is automatically disabled when the markets list is empty. Available since v0.8.8.
useMarket
Fetches a single market by ID.TypeScript
enabled option to gate on prerequisites:
TypeScript
useUserPositions
Fetches all positions (bets) for a wallet across all markets.TypeScript
usePosition
Fetches a single position by market, user, and bet index.TypeScript
Cache TTL reference
Manual cache invalidation
If you send raw instructions outside of mutation hooks, invalidate the cache yourself using the query key factories:TypeScript