Commit Graph

153 Commits

Author SHA1 Message Date
tinkle-community
bbbf8985c3 Merge pull request #116 from Icyoung/dev
Dev start script fix
2025-10-31 15:58:04 +08:00
Icyoung
50eb8ea4dc Merge branch 'tinkle-community:dev' into dev 2025-10-31 15:55:06 +08:00
icy
5d0097715e Fix docker compose bug for config.db 2025-10-31 15:53:48 +08:00
tinkle-community
f516b6a4b1 Merge pull request #114 from Icyoung/dev
[Dev] 还原config配置、部署优化
2025-10-31 15:50:23 +08:00
icy
f35dcf857f Add config.db volume mapping to docker-compose
- Map config.db to host for database persistence
- Ensures user configurations, traders, and AI models persist across container restarts
- Enables easy backup of configuration database
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-31 15:31:47 +08:00
icy
62e40da6b5 Merge branch 'dev' of github.com:Icyoung/nofx 2025-10-31 15:26:04 +08:00
icy
0f9978ec6b Sync config.json to config.db for manual modify admin_mode and other configs 2025-10-31 15:24:18 +08:00
Icyoung
b085463096 Merge branch 'tinkle-community:dev' into dev 2025-10-31 14:47:56 +08:00
icy
c7106bd256 start scrip fix 2025-10-31 14:41:45 +08:00
icy
98735631d5 start scrpit fix 2025-10-31 14:39:04 +08:00
icy
12550b26e9 admin_mode config 2025-10-31 14:34:53 +08:00
icy
45345c6d47 start script fix about config.json 2025-10-31 14:16:47 +08:00
icy
55ead0e6e5 Restore config.json.example 2025-10-31 14:09:28 +08:00
tinkle-community
228026051d Merge pull request #110 from Icyoung/dev
【Dev】新增仓位模式的配置、移除config配置的文档描述
2025-10-31 13:54:19 +08:00
icy
c34fcf4fda Route fix 2025-10-31 13:49:05 +08:00
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
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