⚠ Beta — This project is under active development / 项目正处于活跃开发阶段。
AI-powered multi-agent quantitative trading engine. Break a leg — good luck.
Brale is a quantitative trading engine. It uses multiple LLM Agents to analyze markets, then applies a deterministic Go rule engine to enforce risk controls. Models propose trading plans; code validates price levels, leverage, stop-loss, take-profit, sizing, and execution safety.
A full decision cycle runs through observe, decide, plan, execute, monitor, and reconcile. Trade execution currently uses Freqtrade. The runtime API, webhooks, MCP server, and CLI are built around that workflow.
The default setup favors safe validation: Freqtrade runs with dry_run=true. Before live trading, inspect data/freqtrade/user_data/config.json and verify your strategy, risk limits, and exchange settings.
Prerequisites:
- Linux server or local development machine
- Docker and Docker Compose v2.20+
- 2 GB memory recommended, 4 GB+ for long-running or multi-symbol deployments
- Network access to Binance API and your selected LLM endpoint
One-click deployment:
curl -fsSL https://raw.githubusercontent.com/laukkw/brale-core/master/scripts/bootstrap.sh | bashRun setup first, optionally install MCP, then continue with init and start:
curl -fsSL https://raw.githubusercontent.com/laukkw/brale-core/master/scripts/bootstrap.sh | bash -s -- --setup --setup-lang enSkip interactive init when .env is already ready:
curl -fsSL https://raw.githubusercontent.com/laukkw/brale-core/master/scripts/bootstrap.sh | bash -s -- --no-initThe default checkout is shallow. Add --full-clone when you need full Git history:
curl -fsSL https://raw.githubusercontent.com/laukkw/brale-core/master/scripts/bootstrap.sh | bash -s -- --full-cloneFor first-time deployment, proxy setup, upgrades, backups, and manual steps, see the Deployment Guide.
| Goal | Document |
|---|---|
| Deploy, upgrade, back up, configure proxy | Deployment Guide |
Configure .env, system, symbols, strategies | Configuration Guide |
Use bralectl | CLI Reference |
| Connect Claude, Codex, OpenCode, Cursor, and other MCP clients | MCP Integration |
| Understand decisions, risk controls, Provider anchors | Trading Logic |
| Runtime API, webhooks, notifications, storage | Runtime API |
| Database, memory, notification, execution internals | Subsystem Guide |
| Startup, network, LLM, and scheduler issues | Troubleshooting |
Main configuration lives under configs/. Runtime data lives under data/. For a first deployment, use make init or the bootstrap init wizard to generate local configuration instead of copying production files by hand.
bralectl is the main CLI for local setup, config checks, observations, decision queries, position views, MCP service management, and E2E tests. See CLI Reference for full usage.
LLM token usage grows linearly with symbol count and decision frequency. One symbol, three timeframes, and a 1-hour cycle usually costs about 300K tokens/day. A 15-minute cycle costs about 1.1M to 1.2M tokens/day.
masteris the stable / production branch.devis the daily integration branch.- Feature branches use
feat/xxx; bug-fix branches usefix/xxx. - Releases use semantic version tags such as
v0.x.y.
GNU Affero General Public License v3.0 only (AGPL-3.0-only). See LICENSE.
- This project is for technical research and workflow validation only. It is not investment advice.
- Digital asset trading is volatile and may result in partial or total loss of funds.
- Users are responsible for evaluating strategies, parameters, and risk controls.
- Historical performance, backtest results, and sample configs do not guarantee future returns.
- Test thoroughly in an isolated environment before production use.
Brale 是一个量化交易引擎。它用多个大语言模型智能体分析行情,再用确定性的 Go 规则引擎执行风控约束。模型负责提出交易计划,代码负责校验价格、杠杆、止损、止盈、仓位和执行安全。
一个完整决策周期会经过观测、决策、规划、执行、监控和对账。交易执行目前对接 Freqtrade,运行状态、Webhook、MCP 和 CLI 工具都围绕这条主链路设计。
默认配置偏向安全验证:Freqtrade 使用模拟盘 dry_run=true 。真实上线前必须检查生成的 data/freqtrade/user_data/config.json ,并自行确认策略、风控和交易所配置。
前置条件:
- Linux 服务器或本地开发机
- Docker 与 Docker Compose v2.20+
- 建议内存 2 GB 起,长期运行或多品种建议 4 GB+
- 需要能访问 Binance API 与所选 LLM 端点
一键部署:
curl -fsSL https://raw.githubusercontent.com/laukkw/brale-core/master/scripts/bootstrap.sh | bash先执行 setup,可选安装 MCP,再进入 init 向导并自动启动:
curl -fsSL https://raw.githubusercontent.com/laukkw/brale-core/master/scripts/bootstrap.sh | bash -s -- --setup --setup-lang zh已有可用 .env 时跳过交互式 init,直接启动:
curl -fsSL https://raw.githubusercontent.com/laukkw/brale-core/master/scripts/bootstrap.sh | bash -s -- --no-init默认使用浅克隆;如需完整 Git 历史可加 --full-clone :
curl -fsSL https://raw.githubusercontent.com/laukkw/brale-core/master/scripts/bootstrap.sh | bash -s -- --full-clone首次部署、代理配置、升级、备份和手动部署步骤见 部署指南。
| 目标 | 文档 |
|---|---|
| 部署、升级、备份、代理 | 部署指南 |
配置 .env / 系统 / 品种 / 策略 | 配置指南 |
使用 bralectl | CLI 参考 |
| 接入 Claude、Codex、OpenCode、Cursor 等 MCP 客户端 | MCP 集成 |
| 理解交易决策、风控、Provider 锚定因子 | 交易逻辑 |
| Runtime API、Webhook、通知、存储 | 运行时 API |
| 数据库、记忆、通知、执行层等内部组件 | 子系统指南 |
| 启动失败、网络、LLM、调度问题 | 故障排查 |
主要配置在 configs/ 下,运行时数据在 data/ 下。首次部署建议用 make init 或一键脚本里的 init 向导生成配置,不建议直接复制生产环境配置。
bralectl 是本项目的主要命令行工具,用来完成本地初始化、配置检查、观测、决策查询、持仓查看、MCP 服务和 E2E 测试。完整命令见 CLI 参考。
LLM Token 用量会随品种数和决策频率线性增长。单品种、三时间框架、1 小时周期通常约 30 万 Token / 日;15 分钟周期约 110 万到 120 万 Token / 日。
master是稳定 / 生产分支,部署和发布默认从此分支进行。dev是日常开发集成分支。- 功能分支使用
feat/xxx,修复分支使用fix/xxx。 - 发布使用语义化版本标签
v0.x.y。
GNU Affero 通用公共许可证 v3.0(AGPL-3.0-only)。详见 LICENSE。
- 本项目仅用于技术研究与流程验证,不构成任何投资建议。
- 数字资产交易波动剧烈,可能导致部分或全部资金损失。
- 用户须自行评估策略、参数及风控措施,并承担全部责任。
- 历史表现、回测结果或示例配置不代表未来收益。
- 投入生产前,请务必在隔离环境中完成充分测试。
ETH: 0x4b4C8041A8154a5AfB87E5589Ea292123E098267