Skip to main content

Command reference

Markets

Read-only commands. No authentication required.
context-cli markets <subcommand> [options]
CommandDescription
listSearch and browse markets
get <id>Get a single market
quotes <id>Current bid/ask/last prices
orderbook <id>Bid/ask ladder
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-activityActivity across all markets
markets list flags:
FlagDescription
--query <text>Search by keyword
--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 orderbook flags:
FlagDescription
--depth <n>Number of price levels
--outcome-index <n>Outcome index
markets simulate flags:
FlagDescription
--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:
FlagDescription
--timeframe <1h|6h|1d|1w|1M|all>Time range
markets activity / global-activity flags:
FlagDescription
--limit <n>Max results
--cursor <token>Pagination cursor

Orders

Trading commands require --private-key or CONTEXT_PRIVATE_KEY.
context-cli orders <subcommand> [options]
CommandDescriptionAuth
listQuery orders with filtersRead-only
mineYour open ordersSigner
get <id>Single order by IDRead-only
recentOrders in a time windowSigner
simulatePreview order executionRead-only
createPlace a signed limit orderSigner
cancel <nonce>Cancel by nonceSigner
cancel-replace <nonce>Cancel and place new orderSigner
bulk-createCreate multiple ordersSigner
bulk-cancelCancel multiple ordersSigner
bulkMixed create + cancelSigner
orders create flags:
FlagDescription
--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:
FlagDescription
--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:
FlagDescription
--market <id>Filter by market
orders recent flags:
FlagDescription
--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:
FlagDescription
--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:
FlagDescription
--orders <json>JSON array of order objects (required)
orders bulk-cancel flags:
FlagDescription
--nonces <hex,hex,...>Comma-separated nonces (required)
orders bulk flags:
FlagDescription
--creates <json>JSON array of order objects
--cancels <hex,hex,...>Comma-separated nonces

Portfolio

context-cli portfolio <subcommand> [options]
If --address is provided, uses read-only access. Otherwise uses your signer address.
CommandDescription
getAll positions
claimableWinnings from resolved markets
statsPortfolio value and performance
balanceTUSD balance (wallet + settlement)
token-balance <address> <token>Balance of a specific token
portfolio get flags:
FlagDescription
--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:
FlagDescription
--address <addr>Wallet address (optional)

Account

All account commands require a signer.
context-cli account <subcommand> [options]
CommandDescription
statusCheck wallet balances and approvals
setupApprove contracts for trading
mint-test-usdcMint testnet TUSD (default: 1000)
deposit <amount>Deposit TUSD into the exchange
withdraw <amount>Withdraw TUSD 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 TUSD
account mint-test-usdc flags:
FlagDescription
--amount <n>Amount to mint (default: 1000)
account burn-complete-sets flags:
FlagDescription
--credit-internal <true|false>Credit internally (default: true)

Onboarding

Top-level convenience commands for wallet setup.
CommandDescription
context-cli setupGenerate new wallet or check status
context-cli approveApprove operator for trading
context-cli deposit <amount>Deposit TUSD
context-cli gasless-approveGasless operator approval via relayer
context-cli gasless-deposit <amount>Gasless TUSD deposit via permit
Running context-cli setup without a CONTEXT_PRIVATE_KEY generates a new wallet and displays the private key.