mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
c6d9ef469e
* feat(store): prevent deletion of active strategies and update translations (#1461) Co-authored-by: Dean <afei.wuhao@gmail.com> * fix: allow model switching without re-entering wallet key Users with existing wallets could not switch AI models because the "Start Trading" button required a valid private key even when one was already configured. Now the button is enabled when hasExistingWallet is true, and handleSubmit passes an empty key so the backend preserves the existing key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: replace window.location with useNavigate for routing in auth components (#1470) Co-authored-by: Dean <afei.wuhao@gmail.com> * feat(trader): implement margin mode handling for order and leverage settings * refactor(trader): update SetMarginMode to avoid legacy endpoint and improve logging * feat(api): enhance strategy handling by integrating claw402 wallet key validation Added validation for the claw402 model's wallet key during strategy test runs. If the selected AI model is claw402, the server now checks for a valid wallet key and returns appropriate error messages if it's missing or if the model fails to load. This ensures better error handling and user feedback when working with AI models. * refactor(api): streamline claw402 wallet key retrieval and error handling Refactored the strategy handling logic to encapsulate claw402 wallet key retrieval in a new method, `resolveStrategyDataWalletKey`. This improves code readability and maintains consistent error handling for missing or invalid wallet keys during strategy test runs. The changes enhance the overall robustness of the AI model integration. * feat(trader): add claw402 wallet key resolution for trader configuration Implemented a new method, `resolveTraderDataWalletKey`, to retrieve the claw402 wallet key based on the selected AI model and user ID. This enhancement allows for better integration of the claw402 model within the trader configuration, ensuring that the correct wallet key is used for trading operations. The `AutoTraderConfig` struct has been updated to include the new `Claw402WalletKey` field, improving the overall handling of wallet keys in the trading process. * feat(claw402): preflight USDC balance before AI calls (#1479) * chore: ignore nofx-server build artifact Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(claw402): preflight USDC balance before AI calls Short-circuit claw402 Call/CallWithRequestFull when the wallet balance can't cover the estimated cost of the call, surfacing ErrInsufficientFunds instead of letting x402 fail mid-flight after the sign step. - wallet: cached balance lookup (30s TTL, per-address mutex) to avoid hammering the Base RPC; separate error-returning and display-only APIs so callers can distinguish zero balance from an unreachable RPC. - claw402: 1.5× safety multiplier on the flat per-call estimate, 4.0× for reasoner models whose chain-of-thought cost can blow past the flat rate. Fail-open on RPC errors — x402 still gates actually-empty wallets, and we prefer availability over extra strictness. - shortAddr redacts the wallet in error strings to avoid leaking the full address into telemetry bundles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix(telemetry): report token usage for SSE streaming paths (#1475) * fix(telemetry): report token usage for SSE streaming paths ParseSSEStream already parsed the usage block from SSE chunks but only printed it, so claw402 streaming calls (and native streaming) never fired TokenUsageCallback. GA4 therefore undercounted AI usage on the streaming path. Return the parsed usage from ParseSSEStream and have both callers fire the callback with their own Provider/Model. * chore: drop leftover debug Printf in ParseSSEStream Telemetry is now wired via TokenUsageCallback, so the Printf is redundant noise in the stream path. * fix(gemini): update default model to gemini-3.1-pro Google discontinued gemini-3-pro-preview on 2026-03-26 and directs all callers to gemini-3.1-pro / gemini-3.1-pro-preview. Users on their own API key were getting errors from the native Gemini endpoint because the provider default pointed at the retired ID. Claw402 was unaffected because its route map already used gemini-3.1-pro. Align both the native provider default and the handler's preset list with gemini-3.1-pro so every code path sends a live model ID. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: extract ResolveClaw402WalletKey to store layer and expand OKX margin mode tests - Move duplicated claw402 wallet resolution logic into store.AIModelStore.ResolveClaw402WalletKey - api/strategy.go and manager/trader_manager.go now delegate to the shared method - Add detailed doc comment on OKX SetMarginMode explaining the local-state-only approach and why the legacy /api/v5/account/set-isolated-mode endpoint is not called - Add 3 new test cases: cross mode leverage, OpenShort tdMode, SetTakeProfit tdMode * fix(auth): prevent SetupPage remount from wiping freshly-set auth token (#1481) After #1470 moved routing into react-router, SetupPage is rendered at two different tree positions (top-level guard + /setup Route). When register success flushSync-sets `user`, the top-level guard stops matching and the Route-level SetupPage mounts as a new instance, re-running its cleanup useEffect and removing the auth_token that handlePostAuthSuccess just wrote. Subsequent requests 401 and bounce the user back to /login. Redirect /setup to /welcome when user is already set so SetupPage is never re-mounted during the auth transition. * fix(wallet): handle JSON-RPC null error field in balance query Some RPC implementations return explicit "error": null on success. json.RawMessage deserializes this as the 4-byte literal "null", so len() > 0 was true, causing every balance query to fail with "rpc error: null". Skip the null literal to avoid false positives. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(readme): add quick demo video to localized READMEs (#1486) * docs(README): add quick demo section with video link and image * docs(README): update demo video link * docs(i18n): add quick demo section with video link and image for multiple languages --------- Co-authored-by: Dean <afei.wuhao@gmail.com> --------- Co-authored-by: deanokk <wuhao@vergex.trade> Co-authored-by: Dean <afei.wuhao@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: root <root@localhost.localdomain>
📚 NOFX Documentation Center / 文档中心
Welcome to the NOFX documentation! This page helps you find the right documentation quickly.
欢迎来到 NOFX 文档中心!本页面帮助您快速找到所需文档。
🚀 Getting Started / 快速开始
New to NOFX? Start here!
| Document | Description | 描述 |
|---|---|---|
| Main README | Project overview, features, quick start | 项目概述、功能、快速入门 |
| Getting Started Index (EN) | All deployment options | 所有部署选项 |
| Getting Started Index (中文) | 所有部署选项 | All deployment options |
| Docker Deployment (EN) | Deploy with Docker (recommended) | Docker 部署(推荐) |
| Docker Deployment (中文) | Docker 部署指南(中文) | Docker deployment guide |
| Custom API (EN) | Connect custom AI API providers | 连接自定义 AI API |
| Custom API (中文) | 连接自定义 AI API 提供商 | Custom AI provider guide |
Quick Links:
- 📖 See all options → Getting Started / 快速开始
- 🐳 Want easiest setup? → Docker (EN) / Docker (中文)
- 🤖 Custom AI model? → Custom API (EN) / 自定义 API
📘 User Guides / 使用指南
Learn how to use NOFX effectively
| Document | Description | 描述 |
|---|---|---|
| User Guides Index (EN) | All usage guides and tips | 所有使用指南和技巧 |
| User Guides Index (中文) | 所有使用指南和技巧 | All usage guides and tips |
| FAQ (English) | Frequently asked questions | 常见问题解答 |
| FAQ (中文) | 常见问题解答 | Frequently asked questions |
| Troubleshooting (coming soon) | Common issues and solutions | 故障排查 |
| Configuration Guide (coming soon) | Advanced configuration options | 高级配置选项 |
| Trading Strategies (coming soon) | AI trading strategy examples | AI 交易策略示例 |
👥 Community & Contributing / 社区与贡献
Join the community and contribute!
| Document | Description | 描述 |
|---|---|---|
| Code of Conduct | Community guidelines | 社区行为准则 |
| Security Policy | Report security vulnerabilities | 报告安全漏洞 |
| Bounty Guide | How to post bounty tasks | 如何发布悬赏任务 |
| Hyperliquid Bounty | Hyperliquid integration bounty | Hyperliquid 集成悬赏 |
| Aster Bounty | Aster DEX integration bounty | Aster DEX 集成悬赏 |
Get Involved:
🌍 International / 国际化文档
Documentation in other languages
| Language | Main README | Status |
|---|---|---|
| 🇨🇳 Chinese (中文) | README.md | ✅ Complete |
| 🇷🇺 Russian (Русский) | README.md | ✅ Complete |
| 🇺🇦 Ukrainian (Українська) | README.md | ✅ Complete |
| 🇬🇧 English | README.md | ✅ Complete |
🏗️ Architecture & Development / 架构与开发
For developers who want to understand the internals
| Document | Description | 描述 |
|---|---|---|
| Architecture Overview (EN) | System architecture, modules, and design | 系统架构、模块和设计 |
| Architecture Overview (中文) | 系统架构、模块和设计 | System architecture overview |
| API Reference (coming soon) | HTTP API documentation | HTTP API 文档 |
| Database Schema (coming soon) | SQLite database structure | SQLite 数据库结构 |
| Testing Guide (coming soon) | How to write tests | 如何编写测试 |
🗺️ Roadmap / 路线图
NOFX's strategic development plan and market expansion
| Document | Description | 描述 |
|---|---|---|
| Roadmap (EN) | Short-term and long-term roadmap, feature timeline | 短期和长期路线图、功能时间表 |
| Roadmap (中文) | 短期和长期路线图、功能时间表 | Strategic development plan |
Roadmap Highlights:
- 📈 Short-term (Q2-Q3 2025): Advanced risk management, multi-AI ensemble, new exchange integrations
- 🚀 Long-term (2026): Universal market expansion (stocks, futures, options, forex), reinforcement learning, enterprise features
📄 Legal & Policies / 法律与政策
| Document | Description | 描述 |
|---|---|---|
| License (MIT) | Open source license | 开源许可证 |
| Changelog (EN) | Version history and updates | 版本历史和更新 |
| Changelog (中文) | 版本历史和更新 | Version history and updates |
| Security Policy | Vulnerability disclosure | 漏洞披露政策 |
| Code of Conduct | Community standards | 社区标准 |
🔍 Quick Navigation / 快速导航
Find what you need fast:
I want to...
- 🚀 Get started quickly → Getting Started / 快速开始
- 🐛 Report a bug → GitHub Issues
- 💡 Suggest a feature → Feature Request
- 🔒 Report security issue → Security Policy
- 💰 Claim a bounty → Bounty Guide
- 🤝 Contribute code → Contributing Guide
- 💬 Ask questions → Telegram Community
I'm looking for...
- 🏗️ System architecture → Architecture (EN) / 架构文档
- 🗺️ Product roadmap → Roadmap (EN) / 路线图
- 📊 API documentation → Coming soon
- 🧪 Testing guide → Coming soon
- 🔧 Configuration examples → Custom API (EN) / 自定义 API
- 🌐 Multi-language docs → International section
📚 Documentation Status
| Category | Status | Last Updated |
|---|---|---|
| Getting Started | ✅ Complete | 2025-11-01 |
| User Guides | ✅ Complete | 2025-11-01 |
| Community | ✅ Complete | 2025-11-01 |
| Architecture | ✅ Complete | 2025-11-01 |
| Roadmap | ✅ Complete | 2025-11-01 |
| API Reference | 📋 Planned | - |
Legend:
- ✅ Complete - Documentation is ready
- 🚧 In Progress - Being written
- 📋 Planned - On the roadmap
- ⚠️ Outdated - Needs update
🆘 Need Help?
Can't find what you're looking for?
- Search GitHub Issues - Someone might have asked already
- Join Telegram - NOFX Developer Community
- Ask on Twitter - Mention @nofx_official
- Create an Issue - New Issue
🤝 Contributing to Documentation
Found an error or want to improve the docs?
- Small fixes - Click "Edit" on GitHub and submit PR
- New documentation - Create an issue first to discuss
- Translations - See Contributing Guide
Documentation Contributors:
- All documentation follows Markdown Guide
- Use clear, concise language
- Include code examples where helpful
- Add screenshots for UI-related docs
Last Updated: 2025-11-01 Maintained by: NOFX Community