Skip to main content

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 context-markets
import { ContextClient } from "context-markets";

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,
});

Quickstart

Get up and running in 2 minutes

SDK reference

Full SDK documentation

Place your first order

Fund your account and trade

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

ContractMainnet (Base 8453)Testnet (Base Sepolia 84532)
Settlement0x00000000008c286A2aaa99c6Be3b3D405A9295000xa9b830f4496b88c2d3C103fB96Df8f413031eBDD
Holdings0x0000000000CcA5bC44912C63d63e1673FeE923f60xBed9a1A6CB168D60aD2C7770Be6B62bD9244D6d3
Collateral tokenUSDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913USDC 0xBbee2756d3169CF7065e5E9C4A5EA9b1D1Fd415e
Permit20x000000000022D473030F116dDEE9F6B43aC78BA30x000000000022D473030F116dDEE9F6B43aC78BA3
For testnet addresses and configuration, see the Testnet guide.

Base URL

https://api.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