1139 Commits

Author SHA1 Message Date
icy
8f03be2c9e Discard config settings in MD 2025-10-31 13:28:06 +08:00
icy
142863f554 Add MarginMode configration 2025-10-31 13:14:24 +08:00
icy
a96076856a Fix start script 2025-10-31 12:46:16 +08:00
tinkle-community
cc5c2850ce Merge pull request #105 from d0lwl0b/dev
fix(config): rename config example to .jsonc and update all references
2025-10-31 12:02:40 +08:00
d0lwl0b
9748f5dd64 fix(config): rename config example to .jsonc and update all references 2025-10-31 11:51:17 +08:00
tinkle-community
048dacdbc1 Merge pull request #92 from Icyoung/dev
[Dev] account系统、前端配置 ,model/cex dex/trader、自定义prompt
2025-10-31 04:24:59 +08:00
tinkle-community
d66fde28b0 Merge branch 'main' into dev
Integrate latest changes from main branch including:
- Documentation updates for trader configuration
- Color system improvements for UI components
- Logo design files
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-31 04:17:10 +08:00
icy
72e14c1f0d rename fix 2025-10-31 04:07:14 +08:00
icy
a98bc2a627 Merge branch 'main' of github.com:Icyoung/nofx
# Conflicts:
#	config.json.example
#	config/config.go
#	main.go
#	trader/auto_trader.go
#	web/src/App.tsx
#	web/src/components/CompetitionPage.tsx
2025-10-31 03:59:58 +08:00
icy
ceb2f7b435 account system、custom prompt 2025-10-31 03:42:01 +08:00
tinkle-community
40c8baf2bf Merge pull request #76 from cookieY/main 2025-10-31 03:39:09 +08:00
Yinghao Fan
c9f9f4318e fix: Correct error handling in decision parsing
Changes:
- Updated error handling in `GetFullDecision` and `parseFullDecisionResponse` functions to return the decision object even when an error occurs, improving the clarity of error messages.
This ensures that the decision object is consistently returned, allowing for better debugging and handling of errors in the decision-making process.
2025-10-31 02:06:20 +08:00
henrylab
ed9417195c 1. 修复hyperliquid 总盈亏,总净值计算错误问题
2. 修复持仓盈亏百分比错误,计算公式应该加入杠杆倍数
2025-10-30 22:23:05 +08:00
tinkle-community
e4d5dcc23c UI: Unify trader colors between Leaderboard and Performance Chart
Problem:
- Leaderboard used ai_model-based colors (qwen=purple, other=blue)
- Performance Comparison used index-based colors (10 color pool)
- This caused color mismatch between the two components
- Same trader showed different colors in different sections
Solution:
- Create shared color utility (utils/traderColors.ts)
- Define single color pool with 10 distinct colors
- Implement unified getTraderColor function based on trader index
- Update both ComparisonChart and CompetitionPage to use shared utility
Changes:
- New file: web/src/utils/traderColors.ts (shared color logic)
- Updated: ComparisonChart.tsx (use shared utility)
- Updated: CompetitionPage.tsx (use shared utility in Leaderboard
  and Head-to-Head sections)
Now traders consistently display the same color across all UI sections.
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 22:21:57 +08:00
tinkle-community
85fa9c09ab UI: Fix duplicate colors in Performance Comparison chart
Problem:
- Multiple traders using the same AI model had duplicate colors
- Only 2 colors were available (blue for deepseek, purple for qwen)
- Made it difficult to distinguish between traders
Solution:
- Expand color pool from 2 to 10 distinct colors
- Change color assignment from ai_model-based to index-based
- Each trader now gets a unique color based on their position
- Colors cycle if there are more than 10 traders
Color pool includes: blue, purple, emerald, orange, pink, amber,
sky, violet, green, rose
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 22:12:09 +08:00
tinkle-community
edd8bffd91 Docs: Complete exchange configuration documentation
Update configuration documentation across all 4 languages (Chinese, English,
Russian, Ukrainian) with comprehensive exchange-related fields:
Configuration field table updates:
- Add `exchange` field (binance/hyperliquid/aster)
- Add `hyperliquid_private_key` field with 0x prefix warning
- Add `hyperliquid_wallet_addr` field
- Add `hyperliquid_testnet` field (optional, defaults to false)
- Update `ai_model` to include "custom" option
- Change Binance API key fields to show conditional requirement
  (only required when using Binance exchange)
config.json.example updates:
- Add `enabled` field to all trader configurations
- Set appropriate enabled states for example traders
- Ensure all traders have exchange field properly configured
This makes it clear to users which configuration fields are required
for each exchange option (Binance, Hyperliquid, or Aster DEX).
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 21:27:53 +08:00
tinkle-community
5eba8471cf feat: Add trader enabled switch and fix critical bugs
New Features:
- Add 'enabled' field to trader config for selective startup
- Only enabled traders will be initialized and run
- Display skip messages for disabled traders in logs
Bug Fixes:
- Fix Hyperliquid account value calculation
  * AccountValue is total equity, no need to add TotalMarginUsed
  * Correctly calculate wallet balance without unrealized PnL
  * Fix available balance calculation (AccountValue - TotalMarginUsed)
- Fix frontend page refresh navigation issue
  * Use URL hash to persist page state across refreshes
  * Support browser back/forward buttons
  * Prevent Details page from reverting to Competition on refresh
Technical Changes:
- config/config.go: Add Enabled bool field to TraderConfig
- main.go: Skip disabled traders during initialization
- trader/hyperliquid_trader.go: Correct account value logic
- web/src/App.tsx: Implement hash-based routing
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 21:07:43 +08:00
icy
bbe1e1f929 Merge remote tracking branch into local development
- Resolved conflicts in README.md: Combined web-based config updates with multi-exchange support
- Resolved conflicts in main.go: Fixed database initialization and default coin settings
- Resolved conflicts in manager/trader_manager.go: Updated trader management for new database structure
- Resolved conflicts in web/src/App.tsx: Combined UI improvements with responsive design
- Resolved conflicts in web/.dockerignore: Merged dependency exclusions
- Removed deprecated files: Dockerfile, config/config.go, web/Dockerfile, ComparisonChart.tsx, CompetitionPage.tsx
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 20:57:57 +08:00
icy
82beac0920 sync fork 2025-10-30 20:51:22 +08:00
tinkle-community
004ae60d31 Refactor: Extract availableBalance variable in Hyperliquid trader
Extract availableBalance calculation into a separate variable for better readability.
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 20:09:30 +08:00
tinkle-community
44f60778be Merge pull request #67 from tinkle-community/main
merge
2025-10-30 19:57:36 +08:00
tinkle-community
57cc6c2d8f DevOps: Add PM2 deployment scripts
Add complete PM2 deployment solution:
- pm2.config.js: Dynamic path configuration
- pm2.sh: One-click management script
- PM2_DEPLOYMENT.md: Deployment guide
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 18:20:25 +08:00
tinkle-community
542ae63ee4 UI: Display position details in Trade History
Frontend changes:
- Update TradeOutcome interface with new fields:
  - quantity: Position size
  - leverage: Leverage multiplier
  - position_value: Total position value
  - margin_used: Margin required
- Add position details display in trade cards:
  - Quantity (with 4 decimal precision)
  - Leverage (shown as "50x")
  - Position Value (shown as "$10000.00")
  - Margin Used (shown as "$200.00")
Visual design:
- 2x2 grid layout for position details
- Color coding: Leverage in gold, Margin in purple
- Conditional rendering with fallback "-" for missing data
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 18:11:15 +08:00
tinkle-community
beb9561742 Feature: Add position details to Trade History
Add missing fields to TradeOutcome:
- Quantity: Position size
- Leverage: Leverage multiplier
- PositionValue: Total position value (quantity × openPrice)
- MarginUsed: Margin required (positionValue / leverage)
This provides complete trade information for analysis and display.
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 18:09:16 +08:00
tinkle-community
fd8b1477e7 Fix: Resolve Trade History data loss and P&L calculation errors
Major fixes:
1. Trade History data loss issue
   - Root cause: Open records outside analysis window caused close matching failures
   - Solution: Pre-populate position state by reading 3x window of historical records
   - Ensures long-term positions (>5 hours) generate correct trade records
2. P&L calculation errors
   - Remove incorrect leverage multiplication from absolute P&L
   - Correct calculation: Futures P&L = quantity × price difference
   - Leverage only affects P&L percentage (relative to margin)
3. Other fixes
   - Break-even trades (pnl=0) no longer misclassified as losses
   - Perfect strategy shows Profit Factor as 999.0 instead of 0.0
   - Expand analysis window from 20 to 100 cycles (5 hours)
Files changed:
- logger/decision_logger.go: Core matching and calculation logic
- api/server.go: API analysis window
- trader/auto_trader.go: AI decision analysis window
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 17:58:25 +08:00
tinkle-community
e249aaa16b fix:config add hyperliquid_wallet_addr 2025-10-30 17:16:03 +08:00
tinkle-community
7545b7a894 Merge pull request #59 from liugangdao/main
fix: hyperliquid余额不准确
2025-10-30 17:05:54 +08:00
刘 志
887899749f fix: hyperliquid余额不准确 2025-10-30 08:38:31 +00:00
tinkle-community
e480296e33 Merge pull request #54 from tpkeeper/main
Fix mcp defaultConfig override issue in multi-trader, multi-AI model
2025-10-30 16:13:34 +08:00
tpkeeper
b773d7289a Fix mcp defaultConfig override issue in multi-trader, multi-AI model scenario 2025-10-30 15:46:17 +08:00
tinkle-community
0f9b379cec Merge pull request #40 from d0lwl0b/main
docs: modernize Docker Compose documentation to V2 syntax
2025-10-30 14:24:52 +08:00
tinkle-community
d5842c38ab Merge pull request #48 from SkywalkerJi/main
Reduce the request frequency to the Binance API and add backend caching.
2025-10-30 14:15:19 +08:00
SkywalkerJi
01add7037a Reduce the request frequency to the Binance API and add backend caching. 2025-10-30 14:01:06 +08:00
d0lwl0b
d49c64ea53 Merge branch 'tinkle-community:main' into main 2025-10-30 13:49:39 +08:00
tinkle-community
1a27338faa Merge pull request #44 from SkywalkerJi/main
Smooth the account equity curve.
2025-10-30 13:17:55 +08:00
tinkle-community
e9f49625c8 Merge pull request #45 from yiplee/main
Change health check endpoint to accept any HTTP method for improved f…
2025-10-30 13:15:22 +08:00
tinkle-community
e3506fe0e8 Merge pull request #46 from mxyhi/main
fix: 修复aster 没有取消委托单的问题
2025-10-30 13:14:17 +08:00
d0lwl0b
0d52bc8ad9 refactor(docker): restructure Docker setup with dedicated backend/frontend services 2025-10-30 13:11:29 +08:00
mxyhi
b75a671b2c 🐛 fix(order): 开仓前先撤销所有挂单
- 先在开仓前取消所有挂单,防止残留挂单导致仓位叠加
- 取消挂单失败时记录警告,但仍继续开仓
2025-10-30 13:08:26 +08:00
mxyhi
a80590e592 feat(trader): aster平仓后自动取消挂单
- 调整 CloseLong/CloseShort 逻辑, 在平仓后调用 CancelAllOrders 清理挂单
2025-10-30 13:06:14 +08:00
yiplee
fd0cf4abb2 Change health check endpoint to accept any HTTP method for improved flexibility. 2025-10-30 13:00:17 +08:00
SkywalkerJi
c0ea50a409 Merge branch 'tinkle-community:main' into main 2025-10-30 12:54:04 +08:00
SkywalkerJi
b39efdac27 Smooth the account equity curve. 2025-10-30 12:53:27 +08:00
d0lwl0b
907f660398 Merge branch 'tinkle-community:main' into main 2025-10-30 12:26:21 +08:00
d0lwl0b
2a3276c125 docs: update Docker Compose documentation to V2 syntax 2025-10-30 12:26:00 +08:00
tinkle-community
b3fb73c4a0 Merge pull request #39 from SkywalkerJi/main
Optimize front-end display on mobile devices.
2025-10-30 12:14:53 +08:00
d0lwl0b
236d97c127 Merge branch 'tinkle-community:main' into main 2025-10-30 12:13:00 +08:00
SkywalkerJi
7208debb11 Optimize mobile display to prevent selection boxes from exceeding the screen boundaries. 2025-10-30 12:08:39 +08:00
tinkle-community
043e5e97b6 Merge pull request #35 from SkywalkerJi/main
When a custom URL ends with #, force the use of the full URL without appending /chat/completions.
2025-10-30 10:50:23 +08:00
tinkle-community
37a2bb4d46 Merge pull request #34 from ITfisher/release
Solving Slow Build Speed and Health Check 404 Issues
2025-10-30 10:47:23 +08:00