Command reference
Global flags
| Flag | Description |
|---|
--output json | Return machine-readable JSON instead of formatted text. Available on all commands. |
JSON output is automatic when the CLI detects a non-TTY environment (e.g., when piped to another process). Shell navigation supports back and prev commands for paginated results.
Markets
Read-only commands. No authentication required.
context markets <subcommand> [options]
| Command | Description |
|---|
list | Browse markets with filters |
search <query> | Search markets by keyword |
get <id> | Get a single market |
link <id> | Print a clickable market URL |
quotes <id> | Current bid/ask/last prices |
orderbook <id> | Visual color-coded orderbook (green bids, red asks, spread) |
simulate <id> | Preview trade execution |
price-history <id> | Historical price data |
oracle <id> | Oracle resolution info |
oracle-quotes <id> | Oracle probability estimates |
request-oracle-quote <id> | Request new oracle analysis |
activity <id> | Market event feed |
global-activity | Activity across all markets |
markets list flags:
| Flag | Description |
|---|
--status <status> | Filter by status (e.g., active) |
--limit <n> | Max results |
--sort-by <field> | Sort field (e.g., trending) |
--sort <asc|desc> | Sort direction |
--category <slug> | Filter by category |
--creator <address> | Filter by market creator |
--cursor <token> | Pagination cursor |
markets search flags:
| Flag | Description |
|---|
--limit <n> | Max results |
--offset <n> | Result offset for pagination |
markets orderbook flags:
| Flag | Description |
|---|
--depth <n> | Number of price levels |
--outcome-index <n> | Outcome index |
markets simulate flags:
| Flag | Description |
|---|
--side <yes|no> | Outcome side (required) |
--amount <n> | Trade amount (required) |
--amount-type <usd|contracts> | Amount denomination |
--trader <address> | Trader address |
markets price-history flags:
| Flag | Description |
|---|
--timeframe <1h|6h|1d|1w|1M|all> | Time range |
markets activity / global-activity flags:
| Flag | Description |
|---|
--limit <n> | Max results |
--cursor <token> | Pagination cursor |
Orders
Trading commands require --private-key or CONTEXT_PRIVATE_KEY.
context orders <subcommand> [options]
| Command | Description | Auth |
|---|
list | Query orders with filters | Read-only |
mine | Your open orders | Signer |
get <id> | Single order by ID | Read-only |
recent | Orders in a time window | Signer |
simulate | Preview order execution | Read-only |
create | Place a signed limit order | Signer |
cancel <nonce> | Cancel by nonce | Signer |
cancel-replace <nonce> | Cancel and place new order | Signer |
bulk-create | Create multiple orders | Signer |
bulk-cancel | Cancel multiple orders | Signer |
bulk | Mixed create + cancel | Signer |
orders create flags:
| Flag | Description |
|---|
--market <id> | Market ID (required) |
--outcome <yes|no> | Outcome (required) |
--side <buy|sell> | Order side (required) |
--price <1-99> | Price in cents (required) |
--size <n> | Number of contracts (required) |
--expiry-seconds <n> | Order expiry |
orders cancel-replace <nonce> flags: Same as create.
orders list flags:
| Flag | Description |
|---|
--trader <address> | Filter by trader |
--market <id> | Filter by market |
--status <status> | Filter by status |
--limit <n> | Max results |
--cursor <token> | Pagination cursor |
orders mine flags:
| Flag | Description |
|---|
--market <id> | Filter by market |
orders recent flags:
| Flag | Description |
|---|
--trader <address> | Filter by trader |
--market <id> | Filter by market |
--status <status> | Filter by status |
--limit <n> | Max results |
--window-seconds <n> | Time window |
orders simulate flags:
| Flag | Description |
|---|
--market <id> | Market ID (required) |
--outcome <yes|no> | Outcome |
--side <bid|ask> | Side |
--price <n> | Price |
--size <n> | Size |
--trader <address> | Trader address |
orders bulk-create flags:
| Flag | Description |
|---|
--orders <json> | JSON array of order objects (required) |
orders bulk-cancel flags:
| Flag | Description |
|---|
--nonces <hex,hex,...> | Comma-separated nonces (required) |
orders bulk flags:
| Flag | Description |
|---|
--creates <json> | JSON array of order objects |
--cancels <hex,hex,...> | Comma-separated nonces |
Portfolio
context portfolio <subcommand> [options]
If --address is provided, uses read-only access. Otherwise uses your signer address.
| Command | Description |
|---|
overview | Combined view of balance, stats, and active positions |
get | All positions |
claimable | Winnings from resolved markets |
stats | Portfolio value and performance |
balance | USDC balance (wallet + settlement) |
token-balance <address> <token> | Balance of a specific token |
portfolio get flags:
| Flag | Description |
|---|
--address <addr> | Wallet address (optional) |
--kind <all|active|won|lost|claimable> | Position filter |
--market <id> | Filter by market |
--cursor <token> | Pagination cursor |
--page-size <n> | Results per page |
portfolio claimable / stats / balance flags:
| Flag | Description |
|---|
--address <addr> | Wallet address (optional) |
Account
All account commands require a signer.
context account <subcommand> [options]
| Command | Description |
|---|
status | Check wallet balances (formatted ETH and USDC breakdown: total, settlement, wallet) and approvals |
setup | Approve contracts for trading |
mint-test-usdc | Mint testnet USDC (default: 1000) |
deposit <amount> | Deposit USDC into the exchange |
withdraw <amount> | Withdraw USDC from the exchange |
mint-complete-sets <market-id> <amount> | Mint YES + NO token pairs |
burn-complete-sets <market-id> <amount> | Burn token pairs to recover USDC |
account mint-test-usdc flags:
| Flag | Description |
|---|
--amount <n> | Amount to mint (default: 1000) |
account burn-complete-sets flags:
| Flag | Description |
|---|
--credit-internal <true|false> | Credit internally (default: true) |
Questions
Commands for submitting market drafts to the oracle for review.
context questions <subcommand> [options]
| Command | Description |
|---|
agent-submit | Submit a fully-formed market draft for oracle review |
agent-submit-and-wait | Submit a market draft and poll until processing completes |
questions agent-submit / agent-submit-and-wait flags:
| Flag | Description |
|---|
--formatted-question <text> | Full question text |
--short-question <text> | Short display title |
--market-type <type> | Market type |
--evidence-mode <mode> | Evidence collection mode |
--resolution-criteria <text> | Criteria for resolving the market |
--end-time <timestamp> | Market end time |
--timezone <tz> | Timezone for end time |
--sources <urls> | Sources for resolution evidence |
--explanation <text> | Explanation of the market |
Onboarding
Top-level convenience commands for wallet setup.
| Command | Description |
|---|
context setup | Generate new wallet or check status |
context approve | Approve operator for trading |
context deposit <amount> | Deposit USDC |
context gasless-approve | Gasless operator approval via relayer |
context gasless-deposit <amount> | Gasless USDC deposit via permit |
Running context setup without a CONTEXT_PRIVATE_KEY generates a new wallet and displays the private key.