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>
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.
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>
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>
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>
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>
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>
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>
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>