@sdk.markets/sdk is currently a preview package. These docs show the SDK surface we're building toward.Join the waitlist
markets sdk

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/sdk for TypeScript
  • @sdk.markets/react for 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, and account modules
  • async jobs for 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:

  1. set up providers with wagmi, TanStack Query, and MarketsProvider
  2. read market data through hooks or the TypeScript client
  3. generate a draft through client.drafts.generate(...)
  4. create markets through client.markets.createAndWait(...) or use client.markets.createDirect(...) in advanced mode
  5. participate in parimutuel markets with direct chain actions
  6. 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.

If you are new to the project:

  1. Quickstart
  2. TypeScript SDK
  3. React SDK
  4. Hosted flows
  5. Creating markets
  6. Concepts

If you are implementing a host or agent:

  1. Creating markets
  2. Participation
  3. Resolution
  4. Agents
  5. Oracles
  6. Reference

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

Next

On this page