Open a paper long position on any enabled rail — Kalshi, Polymarket, Alpaca, or Coinbase. Invoke when the user says "buy", "go long", "paper long", "yes on <market>", or confirms a suggested entry. Requires rail, symbol, qty; price is optional (defaults to a mid-market mark).
Open a local web dashboard showing open positions, exposure, daily P&L, and recent trades. Invoke when the user says "dashboard", "open dashboard", "show my book", "pnl screen", or asks to visualise their paper-trading state. Runs a zero-dependency HTTP server on 127.0.0.1 and prints the URL.
One-time interactive setup that stores API keys for Kalshi, Polymarket, Alpaca, and Coinbase so OpenTradex can scan markets and paper-trade. Invoke this the very first time a user says "set up OpenTradex", "add my keys", or "start trading". Safe to re-run to add or update a rail.
Emergency flatten — closes ALL open paper positions at their last mark and sets a 30-minute trading cooldown. Never auto-invoke. Only run when the user explicitly types "panic", "flatten", "close everything", or "stop".
Show all open paper positions with entry, mark, and unrealized P&L. Invoke when the user says "positions", "what am I holding", "book", "blotter", or checks in on open trades.
Summarize today's risk — open positions, total exposure, daily realized/unrealized P&L, and panic-cooldown status. Invoke when the user says "risk", "how am I doing today", "P&L", "daily", "blotter", or checks before a new entry.
Scan live markets across enabled rails — Kalshi, Polymarket, Alpaca, Coinbase — and return a ranked list the user can pick from. Use whenever the user asks "what's trading", "what markets are hot", "scan crypto", "show me prediction markets", or any exploration request before a trade.
Close a paper position by id, booking realized P&L to the ledger. Invoke when the user says "sell", "close", "take profit", "cut it", or references a position id. Price is optional — defaults to the last mark.