{"id":47089908,"url":"https://github.com/quantweb3-com/nexustrader","last_synced_at":"2026-05-03T03:05:13.329Z","repository":{"id":267098111,"uuid":"855224562","full_name":"Quantweb3-com/NexusTrader","owner":"Quantweb3-com","description":"NexusTrader is a professional-grade open-source quantitative trading platform","archived":false,"fork":false,"pushed_at":"2026-03-28T11:33:17.000Z","size":9266,"stargazers_count":557,"open_issues_count":3,"forks_count":103,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-04-02T00:56:37.816Z","etag":null,"topics":["cryptocurrency","quantitative-finance","tradingbot"],"latest_commit_sha":null,"homepage":"https://nexustrader.quantweb3.ai/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quantweb3-com.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2024-09-10T14:24:03.000Z","updated_at":"2026-03-30T07:42:39.000Z","dependencies_parsed_at":"2024-12-08T11:19:08.477Z","dependency_job_id":"26e6b299-d191-487c-b0b7-2944a7b52831","html_url":"https://github.com/Quantweb3-com/NexusTrader","commit_stats":null,"previous_names":["rivertrading/tradebot-pro","rivertrading/nexustrader","quantweb3-com/nexustrader"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/Quantweb3-com/NexusTrader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantweb3-com%2FNexusTrader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantweb3-com%2FNexusTrader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantweb3-com%2FNexusTrader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantweb3-com%2FNexusTrader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quantweb3-com","download_url":"https://codeload.github.com/Quantweb3-com/NexusTrader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantweb3-com%2FNexusTrader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cryptocurrency","quantitative-finance","tradingbot"],"created_at":"2026-03-12T09:30:13.810Z","updated_at":"2026-04-13T09:01:15.402Z","avatar_url":"https://github.com/Quantweb3-com.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/source/_static/logo-dark.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"docs/source/_static/logo-light.png\"\u003e\n  \u003cimg alt=\"nexustrader Logo\" src=\"docs/source/_static/logo-light.png\"\u003e\n\u003c/picture\u003e\n\n# NexusTrader\n\n\u003e **Make every trade deterministic.**\n\n---\n\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n![Python](https://img.shields.io/badge/python-3.11%20|%203.12%20|%203.13-blue)\n![Version](https://img.shields.io/pypi/v/nexustrader?color=blue)\n![Stars](https://img.shields.io/github/stars/Quantweb3-com/NexusTrader?style=social)\n\n---\n\nNexusTrader is built for one thing: making live trading execution reliable.\n\nAnd now, with [NexusTrader MCP](https://github.com/Quantweb3-com/NexusTrader-mcp), AI agents can trade through the same execution-safe stack.\n\nIf you care about reliable trading, a star helps others discover the project.\n\n## Links\n\n- Website: [https://nexustrader.quantweb3.ai/](https://nexustrader.quantweb3.ai/)\n- Docs: [https://nexustrader.readthedocs.io/en/latest/](https://nexustrader.readthedocs.io/en/latest/)\n- NexusTrader MCP: [https://github.com/Quantweb3-com/NexusTrader-mcp](https://github.com/Quantweb3-com/NexusTrader-mcp)\n- Releases: [https://github.com/Quantweb3-com/NexusTrader/releases](https://github.com/Quantweb3-com/NexusTrader/releases)\n- Support: [quantweb3.ai@gmail.com](mailto:quantweb3.ai@gmail.com)\n\n## The Problem\n\nIf you trade live, you have probably seen at least one of these failures:\n\n- An order was sent, but you were not sure whether it was actually confirmed.\n- Network jitter, retries, or replayed signals created duplicate trades.\n- A WebSocket disconnect left balances, positions, or open orders out of sync.\n- A fast market exposed race conditions that looked fine in backtests.\n- Debugging execution failures turned into guesswork.\n\n## What Is NexusTrader?\n\nNexusTrader is an **execution reliability layer** for live trading systems.\n\nIt is designed to help a strategy remain correct under delayed ACKs, reconnects, retries, and exchange-side uncertainty.\n\nIt is not just an exchange connector. It is the layer that keeps execution correct when markets, networks, and APIs behave badly.\n\n## AI-Native Trading With MCP\n\n[NexusTrader MCP](https://github.com/Quantweb3-com/NexusTrader-mcp) exposes NexusTrader through the Model Context Protocol so AI systems can trade through the same deterministic execution layer.\n\nWhat this means in practice:\n\n- Trade from AI agents\n- Trigger trades from natural language workflows\n- Connect the same trading backend to multiple MCP-compatible tools\n\nWorks with:\n\n- OpenClaw\n- Cursor\n- Codex\n- Claude Code\n\nExample intent:\n\n\u003e \"Buy BTC if funding rate \u003c 0 and log it.\"\n\nWith MCP in the loop, AI can analyze the condition, generate the signal, submit the order through NexusTrader, and log the result through one connected workflow.\n\n## Core Capabilities\n\n- **Deterministic Order Execution**: WebSocket orders are tracked until ACK, and ACK timeout triggers REST confirmation before the system decides the request failed.\n- **Idempotent Orders**: `client_oid` and `idempotency_key` help suppress duplicate creates and make retries safe.\n- **Auto-Recovery After Disconnect**: Private WS reconnect can automatically resync balances, positions, and open orders, then emit a diff to the strategy layer.\n- **Safer Failure Handling**: WS send failure, ACK timeout, and explicit rejection are surfaced as different failure paths instead of being mixed together.\n- **Observable Execution State**: Failed orders carry a `reason`, WS lifecycle events are published, and pending ACK state is tracked explicitly.\n- **MCP-Friendly AI Integration**: The NexusTrader MCP layer lets you connect the trading stack to MCP-compatible assistants such as Codex, Claude Code, Cursor, and OpenClaw without building a separate adapter for each tool.\n\n## Why Not Other Tools?\n\n| Capability | CCXT | Hummingbot | NexusTrader |\n| --- | --- | --- | --- |\n| Order confirmation path | ❌ | ❌ | ✅ |\n| Duplicate order protection | ❌ | ❌ | ✅ |\n| Reconnect reconciliation | ❌ | ⚠️ | ✅ |\n| WS ACK timeout recovery | ❌ | ❌ | ✅ |\n| AI trading support via MCP | ❌ | ❌ | ✅ |\n| Natural language trading workflows | ❌ | ❌ | ✅ |\n| Multi-exchange live trading | ⚠️ | ✅ | ✅ |\n\n## One-Liner\n\n\u003e Others let you trade. NexusTrader helps ensure the trade is correct, even when AI is part of the loop.\n\n## Architecture\n\n```text\nStrategy\n   ↓\nNexusTrader\n   ↓\nExchange APIs\n```\n\n## Use Cases\n\n- Cross-exchange arbitrage\n- Market making\n- High-frequency trading\n- Multi-symbol strategies\n- Fully automated live trading systems\n- TradFi workflows via Bybit TradFi (MT5)\n\n## Performance Highlights\n\n- `uvloop` for a faster event loop on non-Windows systems\n- `picows` for low-latency WebSocket handling\n- `msgspec` for fast serialization and structured models\n- Batched subscriptions and inflight tracking for high-symbol-count strategies\n- Lightweight pure-Python runtime plus `loguru` (zero build requirements, built-in time-based log rotation)\n\n## Installation\n\n```bash\npip install nexustrader\n```\n\nTradFi support on Windows:\n\n```bash\npip install nexustrader MetaTrader5\n```\n\n## Quick Start\n\nInside a strategy, submit orders with deterministic identifiers:\n\n```python\nfrom decimal import Decimal\nfrom nexustrader.constants import OrderSide, OrderType\n\nself.create_order_ws(\n    symbol=\"BTCUSDT-PERP.OKX\",\n    side=OrderSide.BUY,\n    type=OrderType.LIMIT,\n    amount=Decimal(\"0.001\"),\n    price=Decimal(\"90000\"),\n    client_oid=\"entry_001\",\n    idempotency_key=\"signal:btc:entry\",\n)\n```\n\nWhy this matters:\n\n- The strategy makes the decision.\n- NexusTrader makes execution safer.\n- MCP lets AI systems access the same trading workflow.\n\n## Start Here\n\n- Read the [installation guide](https://nexustrader.readthedocs.io/en/latest/installation.html)\n- Read the [quickstart docs](https://nexustrader.readthedocs.io/en/latest/quickstart/index.html)\n- Read the [release notes](https://nexustrader.readthedocs.io/en/latest/release_notes.html)\n- Check runnable examples in [`strategy/`](strategy)\n\n## Supported Exchanges\n\n- Binance\n- Bybit\n- OKX\n- Bitget\n- HyperLiquid\n- Bybit TradFi (MT5)\n\n## Bybit TradFi\n\nNexusTrader also supports traditional financial markets through [Bybit TradFi](https://www.bybit.com/en/trade/tradfi/) with MetaTrader 5 as the execution backend.\n\n- Windows only\n- Supports Forex, Gold, Indices, and Stocks\n- Symbol mapping is normalized into NexusTrader format such as `XAUUSD_s.BYBIT_TRADFI`\n\nSee the docs for installation, credentials, and runnable examples.\n\n## Contributing\n\nContributions are welcome.\n\n- Open an issue first if you are planning a feature or non-trivial change.\n- Read [`CONTRIBUTING.md`](./CONTRIBUTING.md) before opening a pull request.\n- Target the `main` branch for pull requests.\n\n## Social\n\n[![X (Twitter)](https://img.shields.io/badge/X_(Twitter)-000000?logo=x\u0026logoColor=white)](https://x.com/quantweb3_ai)\n[![Discord](https://img.shields.io/badge/Discord-5865F2?logo=discord\u0026logoColor=white)](https://discord.gg/BR8VGRrXFr)\n[![Telegram](https://img.shields.io/badge/Telegram-26A5E4?logo=telegram\u0026logoColor=white)](https://t.me/+6e2MtXxoibM2Yzlk)\n\n## License\n\nNexusTrader is released under the MIT License. See [`LICENSE`](./LICENSE) for details.\n\n## Star History\n\n\u003ca href=\"https://www.star-history.com/#Quantweb3-com/NexusTrader\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=Quantweb3-com/NexusTrader\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=Quantweb3-com/NexusTrader\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=Quantweb3-com/NexusTrader\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantweb3-com%2Fnexustrader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantweb3-com%2Fnexustrader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantweb3-com%2Fnexustrader/lists"}