| name | context-trade |
| description | Place and manage prediction market orders on Context Markets |
Trade Skill
Place, cancel, and manage orders on Context Markets prediction markets.
Prerequisites
- Context MCP server running (
npx context-markets-mcp)
- CONTEXT_API_KEY — API key from context.markets
- CONTEXT_PRIVATE_KEY — Ethereum private key for signing orders
- Account setup — must run
ctx.account.setup() or context_account_setup before first trade
- Funded account — deposit USDC via
ctx.account.deposit() or mint test USDC on testnet
Shared Foundations
Price & Size Encoding
- Prices are in cents (1–99). A price of 65 = 65% implied probability.
- Sizes are in contracts (min 0.01).
- On-chain encoding:
price × 10,000, size × 1,000,000. The SDK handles this automatically.
- YES price + NO price ≈ 100 cents.
SDK Constructor
import { ContextClient } from "context-markets";
const ctx = new ContextClient({
chain: "testnet",
apiKey: "ctx_pk_...",
signer: { privateKey: "0x..." },
});
SDK vs MCP Order Params
The SDK, MCP, and CLI all separate outcome selection from trade direction.
SDK — side is the trade direction, outcome is which side of the market:
ctx.orders.create({ marketId, outcome: "yes", side: "buy", priceCents: 45, size: 10 })
MCP — outcome selects YES/NO, side selects buy/sell:
context_place_order({ marketId, outcome: "yes", side: "buy", size: 10, price: 45 })
CLI — uses both params explicitly:
context orders create --market <id> --outcome yes --side buy --price 45 --size 10
outcome: "yes" | "no" — which outcome to trade
side: "buy" | "sell" — direction ("buy" by default in MCP)
price: number — limit price in cents (1-99); omit for a market order
size: number — number of contracts
Account Setup
ctx.account.setup() is chain-aware:
- Testnet: uses gasless setup (no ETH needed)
- Mainnet: on-chain transactions (requires ETH for gas)
Must run before first trade. Check status with ctx.account.status() or context_account_setup.
MCP Tool Catalog (25 tools)
Markets (8 — read-only, no auth):
context_list_markets · context_get_market · context_get_quotes · context_get_orderbook · context_simulate_trade · context_price_history · context_get_oracle · context_global_activity
Orders (7 — requires API key + private key):
context_place_order · context_cancel_order · context_cancel_replace_order · context_my_orders · context_bulk_create_orders · context_bulk_cancel_orders · context_bulk_orders
Portfolio (2 — requires API key + private key):
context_get_portfolio · context_get_balance
Account (6 — requires API key + private key):
context_generate_wallet · context_wallet_status · context_account_setup · context_deposit · context_withdraw · context_mint_test_usdc
Questions (2 — requires API key + private key):
context_create_market · context_agent_submit_market
CLI Commands
context orders create Place a limit order
context orders market Place a market order
context orders cancel Cancel by nonce
context orders cancel-replace Atomic cancel + new order
context orders bulk-create Batch create
context orders bulk-cancel Batch cancel
context orders bulk Mixed batch (cancels + creates)
Available Workflows
References