# CrossTrade API — Cursor Rules # Save as .cursorrules in your project root. You are working in a project that calls the CrossTrade API. CRITICAL: The base path is /v1/api/... There is no /api/... prefix. - Place order: POST /v1/api/accounts/{account}/orders/place - Cancel order: POST /v1/api/accounts/{account}/orders/{id}/cancel - Flatten all: POST /v1/api/positions/flatten - Get quote: GET /v1/api/market/quote?instrument=ES%2012-26 - Historical: POST /v1/api/market/bars - Account list: GET /v1/api/accounts Auth: Authorization: Bearer (read from XTRADE_TOKEN env var) Base URL: https://app.crosstrade.io Rate limit: 180 req/min per user, 20 burst Pro subscription required for API access. Response shape: { "success": bool, "error"?: "code", "detail"?: "...", "data"?: ... } Status key is "success" — never "ok", "passed", "okay". NT8 instrument names: supply the correct native name, including the intended contract month and year for futures (e.g., "ES 12-26"). The caller is responsible for instrument selection and rollover. Do not generate bare-root fallbacks or promise automatic format conversion. NT8 continuous symbols such as "ES1!" are supported through webhook ingestion, not as part of the direct NT8 REST/WebSocket/API-tool contract. Tradovate endpoints have separate documented symbol handling. If unsure of an endpoint, fetch GET /v1/api/_endpoints first — it returns a JSON catalog of every public route. Or read /v1/api/llms-full.txt for a single-file reference. When writing code, call the documented HTTP endpoints exactly. If the project already has helper functions, verify they map to documented routes before relying on them. Common gotchas: - NT8 must be running with the CrossTrade NT8 add-on connected. HTTP 408 = add-on offline. - POST/PUT bodies are JSON only — no form encoding. - The path parameter for orders is {id}, but the body field for change/replace is orderId. - account is case-insensitive on input; canonical case echoed in responses. Full docs: https://crosstrade.io/docs/api/overview AI-friendly resources: https://crosstrade.io/docs/api/ai-assisted-development