Command reference
Markets
Read-only commands. No authentication required.
context-cli markets <subcommand> [options]
| Command | Description |
|---|
list | Search 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-activity | Activity across all markets |
markets list flags:
| Flag | Description |
|---|
--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:
| 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-cli 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-cli portfolio <subcommand> [options]
If --address is provided, uses read-only access. Otherwise uses your signer address.
| Command | Description |
|---|
get | All positions |
claimable | Winnings from resolved markets |
stats | Portfolio value and performance |
balance | TUSD 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-cli account <subcommand> [options]
| Command | Description |
|---|
status | Check wallet balances and approvals |
setup | Approve contracts for trading |
mint-test-usdc | Mint 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:
| Flag | Description |
|---|
--amount <n> | Amount to mint (default: 1000) |
account burn-complete-sets flags:
| Flag | Description |
|---|
--credit-internal <true|false> | Credit internally (default: true) |
Onboarding
Top-level convenience commands for wallet setup.
| Command | Description |
|---|
context-cli setup | Generate new wallet or check status |
context-cli approve | Approve operator for trading |
context-cli deposit <amount> | Deposit TUSD |
context-cli gasless-approve | Gasless 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.