Overview
The planned SDK and docs surface for custom prediction markets on Base.
markets sdk is evolving from a thin contract wrapper into a full product surface for custom prediction markets:
@sdk.markets/sdkfor TypeScript@sdk.markets/reactfor React hooks- single-key hosted platform flows
- direct onchain parimutuel lifecycle actions
- a wallet-aware model that works with Privy embedded wallets
This docs section is intentionally written around the target public surface we are building toward. The current parimutuel contracts remain the execution layer underneath it.
What we are standardizing around
- a top-level
MarketsClient - separate
markets,drafts, andaccountmodules - async
jobsfor hosted execution - React hooks that mirror product flows instead of raw contract methods
- hosted auth built around:
- one project API key per environment
- an authenticated end-user session
- managed wallet execution behind the scenes
This is the same model that lets us support:
- today's parimutuel contracts
- future CLOB modules
- hosted market creation
- app, agent, and backend flows without changing the mental model again later
Shape of the product
A typical app flow should look like this:
- set up providers with wagmi, TanStack Query, and
MarketsProvider - read market data through hooks or the TypeScript client
- generate a draft through
client.drafts.generate(...) - create markets through
client.markets.createAndWait(...)or useclient.markets.createDirect(...)in advanced mode - participate in parimutuel markets with direct chain actions
- resolve, dispute, finalize, and redeem with typed lifecycle methods
Current market primitive
Today the onchain primitive is still parimutuel:
- one isolated market contract per market
- USDC collateral
- two to eight options
- direct buy-ins, not an orderbook
- single-admin, multi-admin, or AI-oracle resolution
- challenge window and strict-majority void path
- pro-rata redemption from the final pool
That contract model is the foundation the new SDK surface wraps.
Recommended reading order
If you are new to the project:
If you are implementing a host or agent:
What changes from the old docs
The old docs were centered on a thin Markets wrapper and raw contract methods.
These docs are centered on:
MarketsClient- modular SDK design
- a future React hooks package
- hosted creation flows as the default path
- a project-key plus end-user-session model designed for Privy-backed apps