* 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> --------- 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
Your personal AI trading assistant.
Any market. Any model. Pay with USDC, not API keys.
English · 中文 · 日本語 · 한국어 · Русский · Українська · Tiếng Việt
NOFX is an open-source autonomous AI trading assistant. Unlike traditional AI tools that require you to manually configure models, manage API keys, and wire up data sources — NOFX's AI perceives markets, selects models, and fetches data entirely on its own. Zero human intervention. You set the strategy, the AI handles everything else.
Fully autonomous: The AI decides which model to use, what market data to pull, when to trade — all by itself. No manual model configuration. No juggling API keys for different services. Just fund a USDC wallet and let it run.
What makes it different: built-in x402 micropayments. No API keys. Fund a USDC wallet and pay per request. Your wallet is your identity.
curl -fsSL https://raw.githubusercontent.com/NoFxAiOS/nofx/main/install.sh | bash
Open http://127.0.0.1:3000. Done.
How x402 Works
Traditional flow: register account → buy credits → get API key → manage quota → rotate keys.
x402 flow:
Request → 402 (here's the price) → wallet signs USDC → retry → done
No accounts. No API keys. No prepaid credits. One wallet, every model.
Built-in x402 Providers
| Provider | Chain | Models |
|---|---|---|
| Base | GPT-5.4, Claude Opus, DeepSeek, Qwen, Grok, Gemini, Kimi — 15+ models |
What It Does
| Feature | Description |
|---|---|
| Multi-AI | DeepSeek, Qwen, GPT, Claude, Gemini, Grok, Kimi, MiniMax — switch anytime |
| Multi-Exchange | Binance, Bybit, OKX, Bitget, KuCoin, Gate, Hyperliquid, Aster, Lighter |
| Strategy Studio | Visual builder — coin sources, indicators, risk controls |
| AI Competition | AIs compete in real-time, leaderboard ranks performance |
| Telegram Agent | Chat with your trading assistant — streaming, tool calling, memory |
| Dashboard | Live positions, P/L, AI decision logs with Chain of Thought |
Markets
Crypto · US Stocks · Forex · Metals
Exchanges (CEX)
| Exchange | Status | Register (Fee Discount) |
|---|---|---|
| ✅ | Register | |
| ✅ | Register | |
| ✅ | Register | |
| ✅ | Register | |
| ✅ | Register | |
| ✅ | Register |
Exchanges (Perp-DEX)
| Exchange | Status | Register (Fee Discount) |
|---|---|---|
| ✅ | Register | |
| ✅ | Register | |
| ✅ | Register |
AI Models (API Key Mode)
| AI Model | Status | Get API Key |
|---|---|---|
| ✅ | Get API Key | |
| ✅ | Get API Key | |
| ✅ | Get API Key | |
| ✅ | Get API Key | |
| ✅ | Get API Key | |
| ✅ | Get API Key | |
| ✅ | Get API Key | |
| ✅ | Get API Key |
AI Models (x402 Mode — No API Key)
15+ models via Claw402 — just a USDC wallet
Screenshots
Install
Linux / macOS
curl -fsSL https://raw.githubusercontent.com/NoFxAiOS/nofx/main/install.sh | bash
Railway (Cloud)
Docker
curl -O https://raw.githubusercontent.com/NoFxAiOS/nofx/main/docker-compose.prod.yml
docker compose -f docker-compose.prod.yml up -d
Windows
Install Docker Desktop, then:
curl -o docker-compose.prod.yml https://raw.githubusercontent.com/NoFxAiOS/nofx/main/docker-compose.prod.yml
docker compose -f docker-compose.prod.yml up -d
From Source
# Prerequisites: Go 1.21+, Node.js 18+, TA-Lib
# macOS: brew install ta-lib
# Ubuntu: sudo apt-get install libta-lib0-dev
git clone https://github.com/NoFxAiOS/nofx.git && cd nofx
go build -o nofx && ./nofx # backend
cd web && npm install && npm run dev # frontend (new terminal)
Update
curl -fsSL https://raw.githubusercontent.com/NoFxAiOS/nofx/main/install.sh | bash
Setup
Beginner mode: First-time users get a guided onboarding flow — select beginner mode at registration and the system walks you through AI, exchange, and strategy setup step by step.
Advanced mode:
- AI — Add API keys or configure x402 wallet
- Exchange — Connect exchange API credentials
- Strategy — Build in Strategy Studio
- Trader — Combine AI + Exchange + Strategy
- Trade — Launch from the dashboard
Everything through the web UI at http://127.0.0.1:3000.
Deploy to Server
HTTP (quick):
curl -fsSL https://raw.githubusercontent.com/NoFxAiOS/nofx/main/install.sh | bash
# Access via http://YOUR_IP:3000
HTTPS (Cloudflare):
- Add domain to Cloudflare (free plan)
- A record → your server IP (Proxied)
- SSL/TLS → Flexible
- Set
TRANSPORT_ENCRYPTION=truein.env
Architecture
NOFX
┌─────────────────────────────────────────────────┐
│ Web Dashboard │
│ React + TypeScript + TradingView │
├─────────────────────────────────────────────────┤
│ API Server (Go) │
├──────────┬──────────┬──────────┬────────────────┤
│ Strategy │ Telegram │
│ Engine │ Agent │
├──────────┴──────────┴──────────┴────────────────┤
│ MCP AI Client Layer │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
│ │ API Key │ │ x402 │ │ │ │
│ │ DeepSeek │ │ Claw402 │ │ │ │
│ │ GPT,Claude │ │ │ │ │ │
│ └───────────┘ └───────────┘ └───────────┘ │
├─────────────────────────────────────────────────┤
│ Exchange Connectors │
│ Binance · Bybit · OKX · Bitget · KuCoin · Gate │
│ Hyperliquid · Aster DEX · Lighter │
└─────────────────────────────────────────────────┘
Docs
| Architecture | System design and module index |
| Strategy Module | Coin selection, AI prompts, execution |
| FAQ | Common questions |
| Getting Started | Deployment guide |
Contributing
See Contributing Guide · Code of Conduct · Security Policy
Contributor Airdrop Program
All contributions are tracked. When NOFX generates revenue, contributors receive airdrops.
Pinned Issues get the highest rewards.
| Contribution | Weight |
|---|---|
| Pinned Issue PRs | ★★★★★★ |
| Code (Merged PRs) | ★★★★★ |
| Bug Fixes | ★★★★ |
| Feature Ideas | ★★★ |
| Bug Reports | ★★ |
| Documentation | ★★ |
Links
| Website | nofxai.com |
| Dashboard | nofxos.ai/dashboard |
| API Docs | nofxos.ai/api-docs |
| Telegram | nofx_dev_community |
| @nofx_official |
Risk Warning: AI auto-trading carries significant risks. Recommended for learning/research or small amounts only.





















