{"id":48915339,"url":"https://github.com/deonmenezes/opentradex","last_synced_at":"2026-04-17T02:02:42.423Z","repository":{"id":349492241,"uuid":"1201737664","full_name":"deonmenezes/opentradex","owner":"deonmenezes","description":"Dashboard-first agent harness for AI-assisted trading workflows.","archived":false,"fork":false,"pushed_at":"2026-04-13T18:44:30.000Z","size":892,"stargazers_count":38,"open_issues_count":0,"forks_count":13,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T20:25:55.992Z","etag":null,"topics":["agent-harness","ai","codex-cli","dashboard","kalshi","nextjs","prediction-markets","python","trading"],"latest_commit_sha":null,"homepage":"https://discord.gg/rFdwJC8z","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deonmenezes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-05T04:51:49.000Z","updated_at":"2026-04-13T18:44:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deonmenezes/opentradex","commit_stats":null,"previous_names":["deonmenezes/opentradex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deonmenezes/opentradex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deonmenezes%2Fopentradex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deonmenezes%2Fopentradex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deonmenezes%2Fopentradex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deonmenezes%2Fopentradex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deonmenezes","download_url":"https://codeload.github.com/deonmenezes/opentradex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deonmenezes%2Fopentradex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31911846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-harness","ai","codex-cli","dashboard","kalshi","nextjs","prediction-markets","python","trading"],"created_at":"2026-04-17T02:02:39.779Z","updated_at":"2026-04-17T02:02:42.400Z","avatar_url":"https://github.com/deonmenezes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# OpenTradex\n\n**The open-source trading cockpit.**\nOne harness. Every market. Paper by default. Your keys, your rules.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-3FB68B.svg?style=flat-square)](LICENSE)\n[![Node](https://img.shields.io/badge/Node-%E2%89%A520-3FB68B?style=flat-square\u0026logo=node.js\u0026logoColor=white)](https://nodejs.org)\n[![Electron](https://img.shields.io/badge/Electron-31-47848F?style=flat-square\u0026logo=electron\u0026logoColor=white)](https://www.electronjs.org)\n[![React](https://img.shields.io/badge/React-18-61DAFB?style=flat-square\u0026logo=react\u0026logoColor=black)](https://react.dev)\n[![Tailwind](https://img.shields.io/badge/Tailwind-3-38BDF8?style=flat-square\u0026logo=tailwindcss\u0026logoColor=white)](https://tailwindcss.com)\n[![Platforms](https://img.shields.io/badge/platforms-win%20%7C%20mac%20%7C%20linux%20%7C%20ios%20%7C%20android-8B97A8?style=flat-square)](#install)\n[![Status](https://img.shields.io/badge/status-paper--first-F59E0B?style=flat-square)](#trading-modes)\n\n![Dashboard Preview](docs/dashboard-preview.png)\n\n\u003c/div\u003e\n\n---\n\n## Why OpenTradex\n\nEvery serious trader ends up juggling ten tabs, three terminals, a TradingView chart,\na half-broken Polymarket script, and a Slack channel full of signals nobody has time to read.\n\n**OpenTradex is the command cockpit that replaces the tab sprawl.**\nA single dashboard that speaks to prediction markets, equities, crypto, and forex\nthrough one AI-driven harness — local-first, paper-by-default, and fully yours.\n\n```\n scan markets -\u003e AI filters signal -\u003e you approve trade -\u003e paper fill -\u003e review\n```\n\nNo SaaS. No account. No telemetry. Your API keys stay on your machine.\n\n---\n\n## Highlights\n\n| | |\n|---|---|\n| **12 connectors** | Polymarket · Kalshi · TradingView · Alpaca · IBKR · Binance · Coinbase · OANDA · MetaTrader 5 · Dukascopy · Robinhood · DraftKings |\n| **Houston-style cockpit** | Resizable 3-pane dark terminal inspired by pro trading desks |\n| **AI harness** | Bring your own model — Anthropic, Google, OpenAI-compatible, or local CLIs |\n| **Real-time wire** | Native WebSocket with SSE fallback for positions, trades, and news |\n| **Paper-first safety** | Live trading is gated behind a 24h lock + explicit mode flip |\n| **Ships everywhere** | npm CLI · Web dashboard · Electron desktop · iOS SwiftUI · Expo mobile |\n| **Your keys only** | All creds in `~/.opentradex/config.json` — nothing leaves the machine |\n\n---\n\n## Install\n\n### One-line (CLI + gateway + web UI)\n\n```bash\nnpx opentradex onboard --paper-only \u0026\u0026 npx opentradex run\n```\n\n### Desktop (Windows / macOS / Linux)\n\nGrab the installer from [**Releases**](https://github.com/deonmenezes/opentradex/releases)\nor build it yourself:\n\n```bash\ngit clone https://github.com/deonmenezes/opentradex.git\ncd opentradex\nnpm install\nnpm run build:all\nnpm run build:desktop:win   # or :mac / :linux\n```\n\nInstaller lands in `packages/desktop/release/`.\n\n### Mobile\n\n```bash\n# iOS (SwiftUI, native)\nopen packages/ios/OpenTradex/OpenTradex.xcodeproj\n\n# Android / iOS (Expo)\ncd packages/mobile \u0026\u0026 npm install \u0026\u0026 npx expo start\n```\n\n---\n\n## Quickstart\n\n```bash\n# 1. First-time setup — pick your rails, set paper mode, drop in API keys\nopentradex onboard\n\n# 2. Boot the gateway (HTTP + WS on :3210)\nopentradex run\n\n# 3. Open the cockpit\nnpm run ui                  # web\nnpm run desktop             # Electron\n```\n\nThen tell it what to do:\n\n```\n\u003e scan all markets and propose the best trade under $50 risk\n\u003e close BTC-EOY-120K on kalshi\n\u003e analyze \"Fed cut September\" news from reuters\n\u003e panic\n```\n\n---\n\n## The Cockpit\n\n\u003cdiv align=\"center\"\u003e\n\n```\n┌────────────────────────────────────────────────────────────────────────────────┐\n│  OPENTRADEX  Live  PAPER          PORTFOLIO $15,238   DAY +$184.27   [Run]▶   │\n├────────────────┬──────────────────────────────────────────┬───────────────────┤\n│ POSITIONS   2  │       What should we trade next?         │  Live feed   12  │\n│ BTC-EOY-120K   │                                          │  Reuters    14m   │\n│ FED-SEP-CUT    │   ⚡ Connector Audit                      │  Bloomberg  28m   │\n│                │   ⚡ Cross-Market Scan                    │  FT         45m   │\n│ MARKET SCANNER │   ⚡ TradingView Pass                     │  CNBC       33m   │\n│ FED-SEP 43¢    │                                          │  WSJ        48m   │\n│ BTC-EOY 38¢    │   COMMAND · _                            │  CoinDesk   62m   │\n└────────────────┴──────────────────────────────────────────┴───────────────────┘\n```\n\n\u003c/div\u003e\n\n- **Left rail** — open positions, recent fills, live market scanner\n- **Center** — chat interface to the AI harness with quick-start missions\n- **Right rail** — unified news + social feed with `$TICKER` tagging\n- **Top bar** — capital, day P\u0026L, run cycle, auto-loop cron (1/2/5/10/15/30 min)\n- **Markets page** — the Houston-style **Connectors** grid with logos, status pills, and one-click `Connect`\n\n---\n\n## Connectors\n\n| Connector | Category | Type | Status |\n|---|---|---|---|\n| **Polymarket** | Prediction markets | USDC / CLOB | Built-in |\n| **Kalshi** | Prediction markets | CFTC-regulated | Built-in |\n| **TradingView** | Charts \u0026 signals | Webhook + MCP bridge | Built-in |\n| **Alpaca** | Equities \u0026 options | Paper + live | Bring key |\n| **Interactive Brokers** | Equities \u0026 options | TWS API | Bring key |\n| **Binance** | Crypto | Spot + perp | Bring key |\n| **Coinbase** | Crypto | Advanced Trade | Bring key |\n| **OANDA** | Forex | 70+ pairs | Bring key |\n| **MetaTrader 5** | Forex | MT5 Python bridge | Beta |\n| **Dukascopy** | Forex | Tick-level JForex | Bring key |\n| **Robinhood** | Equities, options, crypto | Unofficial API | Beta |\n| **DraftKings** | Sportsbook | Odds feed | Bring key |\n\nWant to wire a new one? Drop a file into `src/markets/\u003cname\u003e.ts` that exports `scan`, `quote`, and\n`send` — the harness auto-discovers it.\n\n---\n\n## AI Providers\n\nThe harness speaks to whichever model you already have:\n\n| Provider | Where it runs | File |\n|---|---|---|\n| Anthropic Claude | Cloud API | `src/ai/providers/anthropic.ts` |\n| Google Gemini | Cloud API | `src/ai/providers/google.ts` |\n| OpenAI-compatible | OpenAI, Groq, OpenRouter, Ollama, LM Studio | `src/ai/providers/openai-compatible.ts` |\n| Claude CLI | Local (Claude Code) | `src/ai/providers/claude-cli.ts` |\n| OpenCode CLI | Local | `src/ai/providers/opencode-cli.ts` |\n\nConfigure in `~/.opentradex/config.json`:\n\n```jsonc\n{\n  \"ai\": {\n    \"provider\": \"anthropic\",\n    \"model\":    \"claude-opus-4-7\",\n    \"apiKey\":   \"sk-ant-...\"\n  }\n}\n```\n\n---\n\n## Monorepo map\n\n```\nopentradex/\n├── src/                        # The harness — the thing that actually trades\n│   ├── agent/                  # scanner, executor, risk, runner, logger\n│   ├── ai/                     # provider registry + adapters\n│   ├── markets/                # per-exchange connectors\n│   ├── gateway/                # HTTP + WebSocket + SSE server (:3210)\n│   ├── mcp/                    # MCP bridge for TradingView etc.\n│   ├── risk.ts                 # Kelly sizing, daily-loss caps, kill switches\n│   ├── config.ts               # Config + mode lock\n│   ├── onboard.ts              # Interactive setup wizard\n│   └── bin/cli.ts              # `opentradex` CLI entry\n│\n├── packages/\n│   ├── dashboard/              # React + Vite + Tailwind cockpit\n│   │   └── src/components/     #   TopBar · LeftSidebar · ChatCockpit · RightSidebar\n│   │       ConnectorLogo.tsx   #   Branded SVG marks for all 12 rails\n│   │\n│   ├── desktop/                # Electron shell (Windows / macOS / Linux)\n│   │   ├── src/main.ts         #   Boots gateway + loads dashboard\n│   │   └── electron-builder    #   NSIS · APPX · DMG · MAS · AppImage · deb · snap\n│   │\n│   ├── ios/                    # Native SwiftUI client\n│   └── mobile/                 # Expo React Native (iOS + Android)\n│\n└── docs/                       # Screenshots, design notes\n```\n\n---\n\n## Gateway API\n\nThe gateway is the only thing the dashboard, desktop, and mobile clients talk to.\nIt's a plain HTTP server — you can curl it, hit it from another app, or wire it into n8n.\n\n| | |\n|---|---|\n| `GET /api/` | Harness status + health |\n| `GET /api/scan` | `?exchange=kalshi\u0026limit=20` — markets list |\n| `GET /api/search` | `?q=bitcoin` — search across all rails |\n| `GET /api/quote` | `?exchange=\u0026symbol=` — orderbook snapshot |\n| `GET /api/risk` | Current risk state + caps |\n| `GET /api/config` | Sanitized config (no secrets) |\n| `POST /api/command` | `{\"command\":\"scan markets\"}` — send AI instruction |\n| `POST /api/panic` | Flatten everything, halt trading |\n| `WS  /ws` | Live event stream — primary transport |\n| `GET /api/events` | SSE fallback — same events as `/ws` |\n\n**Event types on the wire:** `position` · `trade` · `feed` · `market` · `command` · `panic` · `heartbeat`\n\n```javascript\nconst ws = new WebSocket('ws://localhost:3210/ws');\nws.onmessage = (e) =\u003e {\n  const { type, payload } = JSON.parse(e.data);\n  // type: 'position' | 'trade' | 'feed' | 'market' | ...\n};\n```\n\n---\n\n## Trading modes\n\n| Mode | Behaviour | Flip to live |\n|---|---|---|\n| `paper-only` | Everything routes to paper endpoints. Live calls throw. | **Not possible** — must re-onboard |\n| `paper-default` | Paper by default. Can flip after 24h lock. | CLI + email confirmation |\n| `live-allowed` | Trades live immediately when called. | Direct |\n\nThe mode is persisted in `~/.opentradex/config.json` and enforced by `src/config.ts` on\n**every** outbound order. There is no runtime override.\n\n---\n\n## Remote access\n\nWant to run the harness on a VM and drive it from your laptop / phone?\n\n```bash\nopentradex onboard         # pick \"lan\" or \"tunnel\" bind mode\n```\n\nThat generates a bearer token — printed once, never stored elsewhere. Pass it on every call:\n\n```bash\ncurl -H \"Authorization: Bearer $OPENTRADEX_TOKEN\" http://vm.lan:3210/api/\n```\n\nThe mobile apps prompt for host + token on first launch.\n\n---\n\n## Design tokens\n\nThe cockpit is calibrated for 8-hour sessions in a dark room:\n\n| Token | Hex | Role |\n|---|---|---|\n| `--bg`        | `#0B0F14` | App background |\n| `--surface`   | `#121821` | Cards |\n| `--surface-2` | `#1A2230` | Inset panels |\n| `--border`    | `#222C3B` | Hairlines |\n| `--text`      | `#E6EDF3` | Primary text |\n| `--text-dim`  | `#8B97A8` | Secondary text |\n| `--accent`    | `#3FB68B` | Positive · brand · \"live\" |\n| `--warning`   | `#F59E0B` | Beta · caution |\n| `--danger`    | `#E5484D` | Negative P\u0026L · panic |\n\n---\n\n## Develop\n\n```bash\nnpm install                  # root workspaces install everything\n\nnpm run build                # compile src/  -\u003e dist/\nnpm run build:dashboard      # Vite build\nnpm run dev:dashboard        # HMR dashboard on :5173\nnpm run desktop              # Electron dev with live gateway\nnpm run ui                   # Web-only (no Electron)\n```\n\n`packages/desktop` talks to `:3210` whether it spawns the gateway itself or finds one already running.\n`packages/dashboard` is served by the gateway at `/` in production — single source of truth, no double port.\n\n---\n\n## Shipping your own fork\n\nThis repo is the public, ready-to-fork mirror. Clone it, wire your own keys, and you're live on paper\nin under a minute:\n\n```bash\ngit clone https://github.com/deonmenezes/opentradex.git\ncd opentradex\nnpm install \u0026\u0026 npm run build:all\nnpx opentradex onboard --paper-only\nnpx opentradex run\n```\n\n---\n\n## License\n\nMIT. Trade responsibly. No warranty — this is paper-first for a reason.\n\n\u003cdiv align=\"center\"\u003e\n\n**Built by [@deonmenezes](https://github.com/deonmenezes).**\nPull requests welcome. Stars even more.\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeonmenezes%2Fopentradex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeonmenezes%2Fopentradex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeonmenezes%2Fopentradex/lists"}