polymarket-paper-trader
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PM_TRADER_ACCOUNT | No | Named account to operate on (for multi-account support) | |
| PM_TRADER_DATA_DIR | No | Path to the data directory (default: ~/.pm-trader) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| init_accountA | Create a paper trading account with a starting USD balance. Writes the local account database; calling it again on an existing account replaces its balance. Run it before any trade; use reset_account to wipe trades and positions instead. |
| get_balanceA | Get an account's cash, reserved and available cash, positions value and P&L. Reads the local account and prices positions with live market data. Use portfolio for per-position detail and stats for performance metrics. |
| reset_accountA | Delete an account's trades, positions and orders and reset its balance. Irreversible local change. Use init_account to set a new starting balance afterwards; use cancel_all_orders to remove only pending orders. |
| search_marketsA | Search Polymarket markets by text and return slug, question, prices and volume. Queries the live Polymarket API and changes nothing. Searches Polymarket only: use kalshi_markets to find Kalshi markets, list_markets to browse by volume, or get_markets_by_tag to browse a category. |
| list_marketsA | List active Polymarket markets, highest volume or liquidity first. Queries the live Polymarket API and changes nothing. Use search_markets for a keyword, get_markets_by_tag for a category, or kalshi_markets for Kalshi. |
| get_marketA | Get one market's question, outcome prices, volume, liquidity and status. Takes a Polymarket slug or condition ID, or a Kalshi market as 'kalshi:'. Reads live data and changes nothing; use get_order_book for depth. |
| get_order_bookA | Get the live asks and bids (price and size) for one market outcome. Works for Polymarket slugs and for Kalshi markets as 'kalshi:'. Reads live data and changes nothing; check it before sizing a buy or sell. |
| kalshi_marketsA | List Kalshi markets for discovery; this tool is read-only and places no trade. Reads the live Kalshi API. To trade a result, pass 'kalshi:' as slug_or_id to buy, sell or place_limit_order. Use search_markets or list_markets for Polymarket instead. |
| kalshi_marketA | Get one Kalshi market by ticker; read-only discovery, no trade is placed. Reads the live Kalshi API. To trade it, pass 'kalshi:' as slug_or_id to buy or sell. The same slug also works in get_market. |
| kalshi_bookA | Get the live YES order book for a Kalshi market, best levels first; read-only. Kalshi publishes bids only, so asks are derived from NO bids (a NO bid at p is a YES ask at 1 - p). get_order_book returns the same book for the slug 'kalshi:' and also covers the NO side. |
| get_tagsA | List all Polymarket market categories (tags) with their slugs. Reads the live Polymarket API and changes nothing. Pass a returned slug to get_markets_by_tag. |
| get_markets_by_tagA | List open Polymarket markets in one category tag. Reads the live Polymarket API and changes nothing. Get slugs from get_tags; use search_markets for a keyword or list_markets for the top markets overall. |
| get_eventA | Get a Polymarket event: the group of related markets sharing one topic. Reads the live Polymarket API and changes nothing. Use get_market for a single market. |
| watch_pricesA | Get live midpoint prices for several markets and outcomes in one call. Reads live data and changes nothing. Use get_order_book for depth on one market, or portfolio for prices of the positions you hold. |
| buyA | Buy shares of a Polymarket or Kalshi ('kalshi:') outcome with paper money. Fills immediately against the live order book and records the trade and fee (simulated; no real order). Kalshi fees follow the series fee schedule. Use place_limit_order for a resting order at your price, or sell to exit. |
| sellA | Sell held shares of a Polymarket or Kalshi ('kalshi:') outcome for paper cash. Fills immediately against the live order book and records the trade and fee (simulated; no real order). Use place_limit_order with side 'sell' to rest an exit at your price, or resolve to collect payout on a closed market. |
| portfolioA | List an account's open positions with live prices and unrealized P&L. Reads the local account and prices positions with live market data. Use get_balance for cash totals, history for past trades, or stats for performance metrics. |
| historyA | List an account's recent trades with market, side, price, shares, USD and fee. Reads the local database only (no network) and changes nothing. Use portfolio for open positions or stats for aggregate performance. |
| place_limit_orderA | Place a resting paper limit order on a Polymarket or Kalshi ('kalshi:') market. Stores the order locally and reserves cash for a buy; an order that crosses the book fills at once as a taker. Resting orders fill only when check_orders runs. Use buy or sell for an immediate market-price fill. |
| list_ordersA | List an account's pending limit orders. Reads the local database only and changes nothing. Use check_orders to evaluate them against live prices, or cancel_order to remove one. |
| cancel_orderA | Cancel one pending limit order by ID and release its reserved cash. Local change only. Returns a not_found error if the order does not exist or is no longer pending. Use cancel_all_orders to cancel every pending order. |
| cancel_all_ordersA | Cancel every pending limit order of an account and release the reserved cash. Local change only; filled orders and open positions are untouched. Returns the count and the cancelled orders. Use cancel_order to cancel just one. |
| check_ordersA | Evaluate pending limit orders against live prices and execute any that fill. Writes fills and cash changes to the local account. Resting orders never fill on their own, so call this periodically. Use list_orders to only view pending orders. |
| statsA | Get one account's raw performance numbers: win rate, ROI, profit, Sharpe, max drawdown. Reads the local account and prices positions live; changes nothing. Use this for analysis, stats_card for a postable text card, or leaderboard_entry for the ranking record. |
| stats_cardA | Render one account's ROI, Sharpe, win rate and P&L as a postable text card. Reads the local account and posts nothing. Open positions are valued at live midpoints (0 if a lookup fails). Use stats for raw numbers, share_content for platform and template choices, or pk_card to compare two accounts. |
| leaderboard_entryA | Return one account's standardized leaderboard record as JSON. Includes ROI%, Sharpe, win rate, trade count, max drawdown, fees, first and last trade times, and 'qualified' (10+ trades). Reads the local account; Open positions are valued at live midpoints (0 if a lookup fails). Use leaderboard_card to rank many accounts, or stats for analysis. |
| share_contentA | Generate post-ready text for a platform and template from one account's stats. Reads the local account and posts nothing. Open positions are valued at live midpoints (0 if a lookup fails). Use this when you need a template (milestone, daily); use stats_card for a plain stats card or stats for raw numbers. |
| pk_cardA | Compare two existing accounts head-to-head and return a card naming the winner. Compares ROI, Sharpe, win rate, trades and tier from local accounts. Open positions are valued at live midpoints (0 if a lookup fails). Use pk_battle to run two strategies from scratch instead, or stats_card for a single account. |
| leaderboard_cardA | Rank accounts with 10+ trades by ROI% and return a Top 10 leaderboard card. Scans local accounts (~/.pm-trader locally, the caller's own directory in remote mode) and changes nothing. Open positions are valued at live midpoints (0 if a lookup fails). Use leaderboard_entry for one account's record or pk_card for two. |
| pk_battleA | Run two strategies from scratch on equal balances and return stats, a PK card and the winner. Executes the strategy functions against live market data in temporary accounts. Use pk_card to compare accounts that already exist, or backtest to test one strategy on historical data. |
| resolveA | Settle an account's positions in one closed market, paying $1 per winning share. Writes payouts to the local account and cancels resting orders on that market. Fails if the market is not closed, the winner is ambiguous, or no position is held. Use resolve_all to settle every closed market at once. |
| resolve_allA | Settle every open position whose market has closed, paying $1 per winning share. Writes payouts to the local account; open markets are skipped, as are markets that hit a transient network error (retry later). Use resolve to settle a single market. |
| backtestA | Replay a strategy over historical price snapshots on synthetic order books. Reads the data file and returns performance metrics; it does not touch your paper accounts. Use pk_battle to compare two strategies live, or stats for an account's real results. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| trading_playbook | The full pm-trader trading methodology and workflow guide. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| trading_playbook | The full pm-trader trading methodology and workflow guide. |
| portfolio | Interactive portfolio dashboard for the portfolio and stats tools. |
| market | Market card with a paper order ticket for the market lookup tool. |
TDQS
Scored across 33 tools
Descriptions are unusually explicit about cross-references (use X for Y), which cleanly separates most tools like search_markets/list_markets/get_markets_by_tag and stats/stats_card/leaderboard_entry. The main ambiguity is redundant Kalshi tools (kalshi_market, kalshi_book) whose output is already reachable via get_market/get_order_book with 'kalshi:<TICKER>', and the cluster of stat-card variants that overlap in purpose.
Many tools follow verb_noun snake_case (get_balance, search_markets, place_limit_order, cancel_all_orders, resolve_all), but the set mixes in bare verbs (buy, sell, backtest, resolve) and noun/fragment names (stats_card, pk_battle, leaderboard_entry, share_content). It stays readable but there is no single predictable pattern.
33 tools is heavy for this scope, and a noticeable cluster is reporting-oriented variants (stats, stats_card, leaderboard_entry, leaderboard_card, share_content, pk_card, pk_battle) that could arguably be consolidated. The broad domain (discovery, trading, accounts, analytics, social) justifies many of them, but the surface feels larger than necessary.
Coverage is strong: account lifecycle (init_account/reset_account/get_balance), market discovery across both venues, full order lifecycle (buy, sell, place_limit_order, list/cancel/check), portfolio/history, stats, and settlement (resolve/resolve_all). Minor gaps only, such as no order-modify/deposit operation, but these are easily worked around with existing tools.