{"id":36223769,"url":"https://github.com/alexanderwanyoike/the0","last_synced_at":"2026-04-19T21:03:47.707Z","repository":{"id":308230217,"uuid":"1032044162","full_name":"alexanderwanyoike/the0","owner":"alexanderwanyoike","description":"Open Source Algorithmic Trading Engine","archived":false,"fork":false,"pushed_at":"2026-03-24T13:09:32.000Z","size":5010,"stargazers_count":210,"open_issues_count":18,"forks_count":25,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2026-03-25T16:53:14.523Z","etag":null,"topics":["algorithmic-trading","quantative-finance","quantitative-finance"],"latest_commit_sha":null,"homepage":"https://the0.app","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/alexanderwanyoike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"ko_fi":"alexanderwanyoike"}},"created_at":"2025-08-04T18:04:55.000Z","updated_at":"2026-03-24T15:45:43.000Z","dependencies_parsed_at":"2025-10-04T13:17:35.457Z","dependency_job_id":"5420b34b-119c-4959-8e98-4125f706b24c","html_url":"https://github.com/alexanderwanyoike/the0","commit_stats":null,"previous_names":["alexanderwanyoike/the0"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/alexanderwanyoike/the0","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderwanyoike%2Fthe0","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderwanyoike%2Fthe0/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderwanyoike%2Fthe0/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderwanyoike%2Fthe0/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexanderwanyoike","download_url":"https://codeload.github.com/alexanderwanyoike/the0/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderwanyoike%2Fthe0/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"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":["algorithmic-trading","quantative-finance","quantitative-finance"],"created_at":"2026-01-11T05:02:37.174Z","updated_at":"2026-04-01T23:09:44.356Z","avatar_url":"https://github.com/alexanderwanyoike.png","language":"TypeScript","funding_links":["https://ko-fi.com/alexanderwanyoike"],"categories":["Open source bots","Backtest + live trading","Python","Trading System"],"sub_categories":["General purpose","Trading \u0026 Backtesting","Traditional Market"],"readme":"# the0\n\n\u003cdiv align=\"center\"\u003e\n\n**Open-Source Algorithmic Trading Platform**\n\n*Production-grade bot execution engine for quantitative trading*\n\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker)](https://www.docker.com/)\n[![Python](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python)](https://www.python.org/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-3178C6?logo=typescript)](https://www.typescriptlang.org/)\n[![Rust](https://img.shields.io/badge/Rust-stable-DEA584?logo=rust)](https://www.rust-lang.org/)\n[![C++](https://img.shields.io/badge/C++-17-00599C?logo=cplusplus)](https://isocpp.org/)\n[![C#](https://img.shields.io/badge/C%23-.NET%208-512BD4?logo=dotnet)](https://dotnet.microsoft.com/)\n[![Scala](https://img.shields.io/badge/Scala-3-DC322F?logo=scala)](https://www.scala-lang.org/)\n[![Haskell](https://img.shields.io/badge/Haskell-GHC%209.6-5D4F85?logo=haskell)](https://www.haskell.org/)\n[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/the0)](https://artifacthub.io/packages/helm/the0/the0)\n\n\u003c/div\u003e\n\n---\n\n## What is the0?\n\n**the0** is an open-source algorithmic trading execution engine that provides production-grade infrastructure for deploying and managing trading bots across multiple markets. Build strategies in your preferred language—Python, TypeScript, Rust, C++, C#, Scala, or Haskell—then deploy them to a self-hosted execution engine with real-time monitoring and custom React dashboards.\n\n\u003e **Status**: Beta - Active development. Not production-ready. Contributions and feedback welcome.\n\n### Key Features\n\n- **Multi-Language Support** - Build bots in Python, TypeScript, Rust, C++, C#, Scala, or Haskell\n- **Custom Frontends** - Create React dashboards tailored to your trading strategies\n- **Real-time Execution** - Deploy scheduled or continuous trading bots with isolated execution\n- **Self-Hosted** - Full control over your infrastructure and data\n- **Docker Ready** - Streamlined deployment with Docker Compose\n- **CLI-First Workflow** - Efficient bot management via command-line interface\n- **Exchange Agnostic** - Design your bots to work with any trading platform\n\n---\n\n## Quick Start\n\nDeploy the0 locally:\n\n### Prerequisites\n\n- **Docker** 20.10+ with **Compose** plugin (the CLI uses Docker Compose under the hood)\n- At least 4GB RAM available for containers\n\n### Option 1: CLI Local Deployment (Recommended)\n\n```bash\n# Install the CLI\ncurl -sSL https://install.the0.app | sh\n\n# Start all services\nthe0 local start\n\n# Access the platform\nopen http://localhost:3001  # Frontend\nopen http://localhost:3000  # API\nopen http://localhost:9001  # MinIO Console (admin/the0password)\n```\n\n### Option 2: Kubernetes (Helm)\n\n```bash\n# Install from the Helm repository\nhelm repo add the0 https://alexanderwanyoike.github.io/the0\nhelm repo update\nhelm install the0 the0/the0 --namespace the0 --create-namespace\n```\n\n**Local development with Minikube:**\n\n```bash\ncd k8s\nmake minikube-up\nmake setup-hosts\n```\n\nSee [k8s/README.md](k8s/README.md) for full Kubernetes deployment documentation.\n\n---\n\n## CLI Installation\n\nThe the0 CLI tool provides a local development interface for managing your bots.\n\n### Quick Install (Recommended)\n\n```bash\ncurl -sSL https://install.the0.app | sh\n```\n\nThis detects your OS and architecture, downloads the latest release binary, verifies its checksum, and installs it to `~/.the0/bin/the0`. Make sure `~/.the0/bin` is in your PATH.\n\n### Install from Source\n\n```bash\n# Clone the repository if you haven't already\ngit clone https://github.com/alexanderwanyoike/the0.git\ncd the0/cli\n\n# Build and install the CLI\nmake install\n\n# Verify installation\nthe0 --help\n```\n\nThe source build installs to `~/bin/the0`. Make sure `~/bin` is in your PATH.\n\n### Prerequisites for CLI\n\n- **Go 1.21+** - Required for building the CLI\n- **Git** - For cloning the repository\n\n### CLI Configuration \u0026 Usage\n\n**Configure API endpoint for local deployments:**\n\n```bash\n# For Docker Compose deployment\nexport THE0_API_URL=http://localhost:3000\n\n# For Kubernetes deployment  \nexport THE0_API_URL=http://api.the0.local:3000\n```\n\n**For CLI bot usage instructions, visit the official documentation:**\n\n📖 [the0 CLI Documentation](https://docs.the0.app/the0-cli/)\n\n---\n\n## MCP Server (Claude Code Integration)\n\nthe0 includes a built-in MCP (Model Context Protocol) server that enables AI assistants like Claude Code to interact directly with the platform. This allows you to manage bots, view logs, and deploy configurations using natural language.\n\n### Configure Claude Code\n\nMCP tools require authentication via API key. Generate one from the web dashboard (Settings → API Keys) or via the CLI (`the0 auth login`).\n\n**Option 1: CLI Command**\n\n```bash\nclaude mcp add the0 --transport http http://localhost:3000/mcp \\\n  --header \"x-api-key: YOUR_API_KEY\"\n```\n\n**Option 2: Configuration File**\n\nAdd to your `.mcp.json` in the project root:\n\n```json\n{\n  \"mcpServers\": {\n    \"the0\": {\n      \"type\": \"http\",\n      \"url\": \"http://localhost:3000/mcp\",\n      \"headers\": {\n        \"x-api-key\": \"YOUR_API_KEY\"\n      }\n    }\n  }\n}\n```\n\nFor team environments, use environment variable expansion to avoid committing secrets:\n\n```json\n{\n  \"mcpServers\": {\n    \"the0\": {\n      \"type\": \"http\",\n      \"url\": \"http://localhost:3000/mcp\",\n      \"headers\": {\n        \"x-api-key\": \"${THE0_API_KEY}\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Code after configuring, then verify with `/mcp` — you should see the0 server as connected.\n\n### Available MCP Tools\n\n| Category | Tool | Description |\n|----------|------|-------------|\n| **Auth** | `auth_status` | Check API key validity |\n| **Bot Instance** | `bot_list` | List deployed bots |\n| | `bot_get` | Get bot details |\n| | `bot_deploy` | Deploy a new bot |\n| | `bot_update` | Update bot configuration |\n| | `bot_delete` | Delete a bot |\n| **Logs** | `logs_get` | Get execution logs |\n| | `logs_summary` | Get log statistics |\n| **Custom Bot** | `custom_bot_list` | List available custom bots |\n| | `custom_bot_get` | Get custom bot details |\n| | `custom_bot_schema` | Get configuration schema |\n\n### Example Usage\n\nOnce configured, ask Claude Code:\n\n- *\"List my deployed bots\"*\n- *\"Show me the logs for my trading bot\"*\n- *\"What custom bots are available?\"*\n- *\"Deploy a new scheduled bot with this configuration\"*\n\nFor detailed MCP documentation including all tool parameters and troubleshooting, see [MCP Integration Guide](docs/integrations/mcp.md).\n\n---\n\n## Architecture\n\nthe0 is built as a microservices execution engine that enables algorithmic trading bot deployment and management:\n\n```mermaid\ngraph TB\n    subgraph \"Users\"\n        DEV[👨‍💻 Bot Developer\u003cbr/\u003eCreates \u0026 tests bots]\n        TRADER[📊 Trader\u003cbr/\u003eDeploys \u0026 monitors]\n    end\n    \n    subgraph \"the0 Platform\"\n        subgraph \"Client Layer\"\n            WEB[🌐 Web Dashboard\u003cbr/\u003eNext.js 15, React 19\u003cbr/\u003eBot management \u0026 monitoring]\n            CLI[🛠️ CLI Tool\u003cbr/\u003eGo, Cobra\u003cbr/\u003eLocal development]\n        end\n        \n        subgraph \"API Layer\"\n            API[🚀 API Server\u003cbr/\u003eNestJS, TypeScript\u003cbr/\u003eREST API \u0026 orchestration]\n        end\n        \n        subgraph \"Runtime Services\"\n            BR[⚡ Bot Runner\u003cbr/\u003eGo, gRPC\u003cbr/\u003eReal-time execution]\n            BS[⏰ Bot Scheduler\u003cbr/\u003eGo, gRPC\u003cbr/\u003eCron execution]\n        end\n\n        subgraph \"Data Layer\"\n            PG[(🐘 PostgreSQL\u003cbr/\u003eUsers, bots, auth)]\n            MONGO[(🍃 MongoDB\u003cbr/\u003eRuntime state, logs)]\n            NATS[📨 NATS JetStream\u003cbr/\u003eEvent streaming]\n            MINIO[📦 MinIO\u003cbr/\u003eCode \u0026 log storage]\n        end\n    end\n    \n    %% User interactions\n    DEV -.-\u003e|HTTPS| WEB\n    DEV -.-\u003e|CLI| CLI\n    TRADER -.-\u003e|HTTPS| WEB\n    \n    %% Client to API\n    WEB --\u003e|REST + JWT| API\n    CLI --\u003e|REST + API Key| API\n    API --\u003e|SSE| WEB\n    \n    %% API to databases\n    API --\u003e|SQL| PG\n    API --\u003e|Events| NATS\n    API --\u003e|S3 API| MINIO\n    \n    %% Runtime services\n    NATS --\u003e|Events| BR\n    NATS --\u003e|Events| BS\n\n    BR --\u003e|State| MONGO\n    BS --\u003e|Schedules| MONGO\n\n    BR --\u003e|Logs| MINIO\n    \n    %% Styling\n    classDef userClass fill:#e1f5fe,stroke:#0277bd,stroke-width:2px\n    classDef clientClass fill:#e8f5e8,stroke:#388e3c,stroke-width:2px\n    classDef apiClass fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px\n    classDef runtimeClass fill:#fff8e1,stroke:#f57c00,stroke-width:2px\n    classDef dataClass fill:#e0f2f1,stroke:#00695c,stroke-width:2px\n\n    class DEV,TRADER userClass\n    class WEB,CLI clientClass\n    class API apiClass\n    class BR,BS runtimeClass\n    class PG,MONGO,NATS,MINIO dataClass\n```\n\n### How It Works\n\n**🌐 Web Dashboard** - Next.js frontend for bot management, real-time monitoring, and documentation system\n\n**🛠️ CLI Tool** - Go-based command-line interface for local bot development, testing, and deployment automation\n\n**🚀 API Server** - NestJS backend providing REST APIs, JWT authentication, and event orchestration across all services\n\n**⚙️ Runtime Services** - Specialized Go microservices using master-worker patterns for different execution models:\n- **Bot Runner**: Real-time trading bot execution\n- **Bot Scheduler**: Cron-based scheduled execution\n\n**💾 Data Architecture** - Multi-database approach:\n- **PostgreSQL**: User accounts, bot definitions, authentication\n- **MongoDB**: Runtime state, job queues, execution logs\n- **MinIO**: Bot code storage and logs\n- **NATS JetStream**: Event streaming and service coordination\n\n### Key Benefits\n\n- **Isolated**: Each bot runs in isolation with resource management\n- **Fast**: Real-time execution with live market data\n- **Scalable**: Handles multiple bots and users across distributed infrastructure\n\n---\n\n## Bot Development\n\n### Supported Languages\n\nBuild trading bots in any of these languages with official SDK support:\n\n| Language | SDK | Documentation | Package Registry |\n|----------|-----|---------------|------------------|\n| **Python** | [sdk/python](sdk/python) | [Quick Start](docs/custom-bot-development/python-quick-start.md) | [PyPI](https://pypi.org/project/the0-sdk/) |\n| **TypeScript/Node.js** | [sdk/nodejs](sdk/nodejs) | [Quick Start](docs/custom-bot-development/nodejs-quick-start.md) | [npm](https://www.npmjs.com/package/@alexanderwanyoike/the0-node) |\n| **Rust** | [sdk/rust](sdk/rust) | [Quick Start](docs/custom-bot-development/rust-quick-start.md) | [crates.io](https://crates.io/crates/the0-sdk) |\n| **C++** | [sdk/cpp](sdk/cpp) | [Quick Start](docs/custom-bot-development/cpp-quick-start.md) | Header-only (FetchContent) |\n| **C#** | [sdk/dotnet](sdk/dotnet) | [Quick Start](docs/custom-bot-development/csharp-quick-start.md) | [NuGet](https://www.nuget.org/packages/The0.Sdk) |\n| **Scala** | [sdk/scala](sdk/scala) | [Quick Start](docs/custom-bot-development/scala-quick-start.md) | [GitHub Packages](https://github.com/alexanderwanyoike/the0/packages) |\n| **Haskell** | [sdk/haskell](sdk/haskell) | [Quick Start](docs/custom-bot-development/haskell-quick-start.md) | Source (cabal) |\n\n### Custom Frontends\n\nBuild React dashboards tailored to your trading strategies using the React SDK:\n\n| SDK | Documentation | Package |\n|-----|---------------|---------|\n| [sdk/react](sdk/react) | [Custom Frontends](docs/custom-bot-development/custom-frontends.md) | [@alexanderwanyoike/the0-react](https://www.npmjs.com/package/@alexanderwanyoike/the0-react) |\n\n### Framework Agnostic\n\nthe0 doesn't lock you into specific libraries or frameworks. Use any packages from your language's ecosystem—pandas for Python, sttp for Scala, reqwest for Rust, or any other libraries you prefer.\n\n### Example: Simple DCA Bot\n\n```python\nfrom typing import Dict, Any\nfrom alpaca.trading.client import TradingClient\n\ndef main(id: str, config: Dict[str, Any]) -\u003e Dict[str, Any]:\n    \"\"\"Dollar Cost Averaging bot - buys a fixed amount regularly\"\"\"\n    \n    # Initialize trading client\n    client = TradingClient(\n        api_key=config[\"api_key\"],\n        secret_key=config[\"secret_key\"],\n        paper=config.get(\"paper\", True)\n    )\n    \n    # Calculate and execute purchase\n    symbol = config[\"symbol\"]\n    amount = config[\"amount\"]\n    \n    # Place market buy order\n    order = client.submit_order(\n        symbol=symbol,\n        notional=amount,\n        side=OrderSide.BUY,\n        type=OrderType.MARKET,\n        time_in_force=TimeInForce.DAY\n    )\n    \n    return {\n        \"status\": \"success\",\n        \"message\": f\"Purchased ${amount} of {symbol}\",\n        \"order_id\": order.id\n    }\n```\n\n### Bot Types\n\n- **Scheduled Bots** - Run on cron schedules (daily, weekly, monthly)\n- **Real-time Bots** - Continuous execution with live data feeds\n\n---\n\n## Documentation\n\n### Getting Started\n- [Welcome to the0](/docs/welcome-to-the0.md) - Platform overview\n- [Custom Bot Development](/docs/custom-bot-development/) - Build your first bot\n- [Quick Start Guide](/docs/custom-bot-development/quick-start-guide.md) - 15-minute DCA bot tutorial\n\n### Deployment Guides\n- [Kubernetes Deployment](k8s/README.md) - Production deployment\n\n### Development Resources\n- [Bot Configuration](docs/custom-bot-development/configuration.md) - Configuration reference\n- [Testing \u0026 Debugging](docs/custom-bot-development/testing.md) - Development best practices\n\n---\n\n## Contributing\n\nWe welcome contributions from developers, traders, and AI enthusiasts! the0 is built by a community that values creativity and innovation.\n\n### AI-Assisted Development\n\nWe encourage the use of AI tools and agents in development:\n\n- **AI Assistants Welcome** - Use Claude, ChatGPT, GitHub Copilot, or any AI tools you prefer\n- **AI-Generated Code** - AI-written code is acceptable when properly tested\n- **Creative Solutions** - We value innovative approaches and problem-solving\n- **Quality First** - Ensure your code is properly tested, regardless of origin\n- **Context Engineering Over Vibe Coding** - Use context engineering when contributing with AI\n\n### Ways to Contribute\n\n- **Bug Reports** - Found an issue? Let us know\n- **Feature Requests** - Have ideas for improvements?\n- **Code Contributions** - Submit pull requests (AI-assisted or manual)\n- **Documentation** - Help improve our docs and examples\n- **Bot Templates** - Share innovative trading strategies and patterns\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.\n\n### Getting Started\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/your-feature`)\n3. Build your solution (with or without AI assistance)\n4. Add tests\n5. Submit a pull request with a clear description\n\n---\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## Support \u0026 Community\n\n- **Discord**: [Join our community for support](https://discord.gg/g5mp57nK)\n- **Documentation**: [docs.the0.app](https://docs.the0.app)\n- **GitHub Issues**: [Report bugs or request features](https://github.com/alexanderwanyoike/the0/issues)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built by AlphaNeuron**\n\n[Website](https://the0.app) • [Documentation](https://docs.the0.app) • [Discord](https://discord.gg/g5mp57nK)\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderwanyoike%2Fthe0","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexanderwanyoike%2Fthe0","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderwanyoike%2Fthe0/lists"}