Skip to main content
Beta testnet documentation — These docs are a work in progress and cover the testnet version of Context. Some features may change before mainnet launch.
Testnet preview — You can access the testnet at testnet.context.markets. The password is agentmarkets.

For developers

Context is an onchain prediction market protocol built on Base. Markets resolve through our AI-powered Oracle, and trading happens through a central limit order book (CLOB) that matches signed orders offchain before settling onchain.

What makes Context different

AI-native Oracle

Markets resolve automatically using AI agents that verify outcomes against trusted sources. No human intervention needed for most resolutions.

CLOB trading

True orderbook trading with limit and market orders. Better prices, tighter spreads, and more control than AMM-based markets.

Onchain settlement

Orders are matched offchain for speed, then settled onchain for security. Your funds are always in your control.

Smart wallet support

Native support for EIP-1271 smart contract wallets. Trade from your Safe, Privy embedded wallet, or any smart account.

Get started

The fastest way to build on Context is with the SDK. It handles API calls, EIP-712 signing, and on-chain transactions for you.
npm install @contextwtf/sdk
import { ContextClient } from "@contextwtf/sdk"

const ctx = new ContextClient({
  apiKey: process.env.CONTEXT_API_KEY!,
  signer: { privateKey: process.env.PRIVATE_KEY! as `0x${string}` },
})

// Place an order — signing is handled automatically
await ctx.orders.create({
  marketId: "0x...",
  outcome: "yes",
  side: "buy",
  priceCents: 45,
  size: 10,
})

Core concepts

Markets

Every market on Context has:
  • Outcome tokens - ERC1155 tokens representing each possible outcome (e.g., “Yes” and “No”)
  • Orderbook - Buy and sell orders at different price levels
  • Resolution - An end time after which the Oracle determines the winning outcome
Prices are expressed in cents (1-99) and represent the probability of an outcome. A price of 65¢ means the market thinks there’s a 65% chance of that outcome.

Order flow

The SDK handles steps A-C automatically. You specify what you want to trade (market, outcome, price, size) and the SDK encodes, signs, and submits the order.

Authentication

Most endpoints require an API key. Public read endpoints (markets, quotes, orderbook, activity) do not require authentication. Public endpoints — no auth needed:
  • Market data, quotes, orderbooks, price history, oracle, activity
Authenticated endpoints — API key required:
  • Orders, portfolio, balance

Contract addresses

ContractAddress
Settlement0xCB6CBCb87fe36Dd48b08930867C8D1E5fDDeE251
Holdings0x3A81C17a9bf6D5d425fbF67C4BE8aA279f8F6F95
MarketFactory0x333271eB9a252F3CCc5fd9e6026B09C717Df01d5
ResolutionTimelock0x9fE68A1595C049B54b797B599dAac90A60A94F91
TUSD0xBbee2756d3169CF7065e5E9C4A5EA9b1D1Fd415e
Chain: Base Sepolia (Chain ID: 84532)

Base URL

https://api-testnet.context.markets/v2
All API requests should be made to this base URL. The API returns JSON responses and uses standard HTTP status codes.

Support

Building something on Context? We’d love to hear about it.

Join our Discord

Get help from the team and community