{
  "schema_version": "2025-06-18",
  "serverInfo": {
    "name": "xmr.win",
    "title": "XMR.WIN Prediction Markets",
    "version": "1.1.0"
  },
  "description": "Privacy-first Monero (XMR) prediction market. Trade YES/NO shares on real-world events. Zero KYC, no email verification, programmatic onboarding via SHA-256 proof-of-work captcha. AI agents are first-class users.",
  "vendor": {
    "name": "XMR.WIN",
    "url": "https://xmr.win",
    "support": "support@xmr.win"
  },
  "documentation": {
    "human": "https://xmr.win/docs",
    "openapi": "https://xmr.win/api/v1/openapi.json",
    "markdown": "https://xmr.win/api/docs/markdown",
    "llms_txt": "https://xmr.win/llms.txt"
  },
  "transports": [
    {
      "type": "streamable-http",
      "url": "https://xmr.win/api/mcp",
      "description": "Public MCP endpoint over Streamable HTTP. POST JSON-RPC to /api/mcp; responses returned as application/json. Also reachable at /mcp where the edge proxy supports it."
    }
  ],
  "authentication": [
    {
      "type": "none",
      "description": "Public read-only tools (list_markets, get_market, etc.) require no authentication.",
      "scope": "read-public"
    },
    {
      "type": "api_key",
      "header": "X-API-Key",
      "format": "xmr_<32hex>",
      "description": "Long-lived API key minted programmatically via POST /api/keys (JWT auth required). Humans can also create and manage keys in their account settings on the website. Required for trading, wallet, portfolio tools.",
      "scope": "read | trade | wallet | withdraw",
      "obtain_via": "POST https://xmr.win/api/keys (JWT required)"
    },
    {
      "type": "http_bearer",
      "scheme": "bearer",
      "bearer_format": "JWT",
      "description": "JWT obtained from POST /api/login (24h TTL).",
      "obtain_via": "https://xmr.win/api/login"
    }
  ],
  "tools": [
    {"name": "list_markets",        "title": "List prediction markets",                 "description": "List active prediction markets with optional filters: status, category, search query, sort order. Returns up to 100 markets per call.", "auth": "none"},
    {"name": "get_market",          "title": "Get market details",                      "description": "Fetch a single market's full details including order book, recent trades, and analytics.", "auth": "none"},
    {"name": "get_orderbook",       "title": "Get order book",                          "description": "Read the current bids/asks for both YES and NO outcomes of a market.", "auth": "none"},
    {"name": "get_recent_trades",   "title": "Get recent trades for a market",          "description": "Recent trade history for a specific market.", "auth": "none"},
    {"name": "get_market_stats",    "title": "Get market analytics",                    "description": "Detailed market analytics: daily volumes, price range, unique traders, trade counts.", "auth": "none"},
    {"name": "list_categories",     "title": "List market categories",                  "description": "All distinct market categories with counts.", "auth": "none"},
    {"name": "get_trending",        "title": "Get trending markets",                    "description": "Top markets by 24h volume.", "auth": "none"},
    {"name": "get_resolved",        "title": "Get resolved markets",                    "description": "Recently resolved markets (last 30 days).", "auth": "none"},
    {"name": "get_recent_trades_global", "title": "Get recent trades across all markets", "description": "Recent trades platform-wide with market titles.", "auth": "none"},
    {"name": "get_platform_stats",  "title": "Get platform-wide stats",                 "description": "Total volume, active markets, total users, total trades.", "auth": "none"},
    {"name": "get_leaderboard",     "title": "Get top traders leaderboard",             "description": "Top traders ranked by PnL, volume, or win rate.", "auth": "none"},
    {"name": "get_fee_tiers",       "title": "Get fee schedule",                        "description": "Trading fee tiers (Standard/Silver/Gold/VIP) by 7-day rolling USD volume.", "auth": "none"},
    {"name": "get_user_profile",    "title": "Get public user profile",                 "description": "Public profile for any user by username.", "auth": "none"},
    {"name": "place_order",         "title": "Place an order",                          "description": "Place a limit or market order on a YES/NO outcome. Limit prices: 0.0001-0.9999. Outcomes are case-insensitive on input ('yes'/'Yes'/'YES' all accepted) but the canonical form ('Yes'/'No') is what GET /api/markets/{id} returns. amount is a share count, not an XMR budget. Requires API key with trade permission or JWT.", "auth": "api_key:trade or jwt"},
    {"name": "cancel_order",        "title": "Cancel an open order",                    "description": "Cancel an open order. Reserved balance/shares are refunded.", "auth": "api_key:trade or jwt"},
    {"name": "get_portfolio",       "title": "Get my portfolio",                        "description": "Authenticated user's positions and open orders across all markets.", "auth": "api_key:read or jwt"},
    {"name": "get_balance",         "title": "Get my XMR balance",                      "description": "Available + locked XMR balance.", "auth": "api_key:wallet or jwt"},
    {"name": "get_deposit_address", "title": "Get my deposit address",                  "description": "Unique XMR subaddress for funding the account.", "auth": "api_key:wallet or jwt"},
    {"name": "request_withdrawal",  "title": "Request XMR withdrawal",                  "description": "Withdraw XMR to an external address. Subject to daily limits + cooldown. Requires API key with withdraw permission or JWT. Only completes for accounts with no second factor; 2FA/passkey accounts must withdraw via the website.", "auth": "api_key:withdraw or jwt"},
    {"name": "get_my_fees",         "title": "Get my current fee tier",                 "description": "Current fee tier, 7d trading volume, and fee rate for the authenticated user.", "auth": "api_key:read or jwt"},
    {"name": "get_order_history",   "title": "Get my order history",                    "description": "Past orders across all markets, most recent first. Supports limit and offset pagination.", "auth": "api_key:read or jwt"}
  ],
  "rate_limits": {
    "general": "120 requests/minute per IP",
    "tools_call": "Same as general API rate limit",
    "order_placement": "30 orders/minute per user"
  },
  "policies": {
    "agent_use": "permitted",
    "terms_url": "https://xmr.win/terms",
    "privacy_url": "https://xmr.win/privacy",
    "security_url": "https://xmr.win/.well-known/security.txt"
  }
}
