Commit Graph

16 Commits

Author SHA1 Message Date
icy 7d58f56e49 feat: implement hybrid database architecture and frontend encryption
- Add PostgreSQL + SQLite hybrid database support with automatic switching
- Implement frontend AES-GCM + RSA-OAEP encryption for sensitive data
- Add comprehensive DatabaseInterface with all required methods
- Fix compilation issues with interface consistency
- Update all database method signatures to use DatabaseInterface
- Add missing UpdateTraderInitialBalance method to PostgreSQL implementation
- Integrate RSA public key distribution via /api/config endpoint
- Add frontend crypto service with proper error handling
- Support graceful degradation between encrypted and plaintext transmission
- Add directory creation for RSA keys and PEM parsing fixes
- Test both SQLite and PostgreSQL modes successfully
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-06 01:50:06 +08:00
yuanshi2016 d8582475d3 修改Kline获取方式为Websocket缓存。 2025-11-02 17:59:19 +08:00
yuanshi2016 7302f96e8e K线获取方式改为websocket组合流. 带重拨机制
流程为下:
1. 启动时使用所有交易员设置的币种(去重) 如果交易员未配置,则使用系统默认
2. 在决策获取K线时 如果没有缓存 则先实时获取后再添加订阅. ps: 适用于Api方式的币种列表
2025-11-02 14:03:13 +08:00
yuanshi2016 f6539eb750 新增内置AI评分
修改market/data.go Get函数获取K线为流式获取(可以解决传入币种比较多的情况下耗时问题)
market目录下新增文件
main.go 新增运行入口
通过inside_coins=true控制
该评分默认初始化大约需要2分钟左右(因为币种列表比较多,api有限速)
使用时应该注意engine.go下的流动性过滤问题
2025-11-01 15:58:54 +08:00
icy d1d9810075 竞赛fix、交易员新增参数 2025-11-01 02:17:11 +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
刘 志 887899749f fix: hyperliquid余额不准确 2025-10-30 08:38:31 +00:00
SkywalkerJi 3e157c8d14 Expose the default mainstream currency settings to the configuration file 2025-10-30 10:01:45 +08:00
nobody 87f67f2da1 feat: Add Aster DEX exchange support + fix precision issues
## Features
- Add full Aster DEX integration with Binance-compatible API
- Support Web3 authentication with API wallet system
- Add comprehensive Aster integration guide (ASTER_INTEGRATION.md)
- Add example Aster configuration (config.aster.example.json)
## Bug Fixes
- Fix precision error (code -1111) for all order types
- Implement proper float-to-string conversion with exchange precision
- Add automatic precision fetching from /exchangeInfo endpoint
- Remove trailing zeros from formatted values
## Documentation
- Update README.md with Aster quick start guide
- Add detailed setup instructions for creating API wallet
- Include troubleshooting FAQ and security best practices
- Update core features to mention three supported exchanges
## Technical Details
- Added formatFloatWithPrecision() helper function
- Updated all order functions to use proper precision formatting
- Added precision logging for debugging
- Fully backward compatible with existing configurations
Closes #[issue number if applicable]
2025-10-30 00:27:33 +08:00
btcman a13f39afdd Feature: Add support for custom OpenAI-compatible API
This update enables users to configure any OpenAI-compatible API endpoint,
allowing the use of:
- OpenAI official API (GPT-4, GPT-4o, etc.)
- OpenRouter (access to multiple models)
- Local deployed models (Ollama, LM Studio, etc.)
- Other OpenAI-format compatible API services
Changes:
- config: Add custom_api_url, custom_api_key, custom_model_name fields
- mcp: Add SetCustomAPI function and ProviderCustom constant
- trader: Update AI initialization logic to support custom API
- manager: Pass custom API config to trader instances
- Add CUSTOM_API.md documentation with usage examples
- Update config.json.example with custom API sample
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-29 22:48:28 +08:00
PorunC 6e304f6388 Merge upstream/main: Integrate Hyperliquid support with leverage config
Resolved conflicts in manager/trader_manager.go by combining:
- Upstream: Exchange field, Hyperliquid API keys, Hyperliquid testnet
- Local: BTCETHLeverage and AltcoinLeverage fields
Both features are now working together.
2025-10-29 21:01:05 +08:00
PorunC 40190a2b8b Feat: Add configurable leverage settings for BTC/ETH and altcoins (v2.0.3)
- Add LeverageConfig struct with btc_eth_leverage and altcoin_leverage fields
- Set default leverage to 5x (safe for Binance subaccounts)
- Add validation warnings for leverage >5x (subaccount restrictions)
- Update config.json.example with leverage configuration
Breaking changes:
- None (backward compatible with default 5x leverage)
Migration:
- Existing configs will auto-default to 5x leverage (safe)
- Main accounts can increase to 20x (altcoins) or 50x (BTC/ETH) in config.json
- Subaccounts must keep leverage ≤5x to avoid trade failures
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-29 20:29:51 +08:00
nobody 0164ac6cc0 feat: Add Hyperliquid exchange support with unified trader interface
Major changes:
- Add full Hyperliquid trading support (long/short, leverage, SL/TP)
- Create unified Trader interface for multi-exchange support
- Implement automatic precision handling for orders and prices
- Fix balance calculation and unrealized P&L display
- Add comprehensive configuration guide in README
New features:
- Support for both Binance and Hyperliquid exchanges
- Automatic order size precision based on szDecimals
- Price formatting with 5 significant figures
- Non-custodial trading with Ethereum private key
- Seamless exchange switching via configuration
Technical details:
- Add trader/interface.go for unified trader interface
- Add trader/hyperliquid_trader.go for Hyperliquid implementation
- Update manager and auto_trader to support multiple exchanges
- Add go-hyperliquid SDK dependency
- Fix precision errors (float_to_wire, invalid price)
Fixes:
- Correct calculation of wallet balance and unrealized P&L
- Proper handling of AccountValue vs TotalRawUsd
- Frontend display issues for total equity and P&L
Documentation:
- Add Hyperliquid setup guide in README
- Update config.json.example with both exchanges
- Add troubleshooting section for common errors
Tested with live trading on Hyperliquid mainnet.
No breaking changes - backward compatible with existing configs.
2025-10-29 20:00:30 +08:00
tinkle-community 3e5a701859 Docs: Enhance README files with beginner-friendly guides (4 languages)
**Configuration Improvements:**
- Add comprehensive "Get AI API Keys" section (DeepSeek + Qwen)
- Split configuration into Beginner Mode and Expert Mode
- Add step-by-step setup guides with placeholder tables
- Add configuration checklist and field explanations
- Document smart default behavior for use_default_coins (v2.0.2)
**Startup/Monitoring Guides:**
- Add detailed 2-step system startup instructions
- Include expected output and error troubleshooting tables
- Add monitoring and graceful shutdown procedures
- Provide health check commands
**AI Decision Flow Updates:**
- Enhance flow diagram with emojis and wider boxes
- Add v2.0.2 improvement markers throughout
- Document position duration tracking
- Document accurate USDT PnL calculation with leverage
- Document enhanced AI freedom for raw data analysis
- Document improved position tracking (symbol_side keys)
- Add "Key Improvements in v2.0.2" summary section
**Code Changes:**
- Simplify config.json.example to beginner-friendly single trader
- Implement smart default: use_default_coins auto-enables when omitted
- Set default to true if false without coin_pool_api_url
**Files Updated:**
- README.md (English): +559 lines
- README.zh-CN.md (Chinese): +527 lines
- README.ru.md (Russian): +634 lines
- README.uk.md (Ukrainian): +521 lines
- config.json.example: Simplified configuration
- config/config.go: Smart default logic
Total: 2068+ additions across all documentation
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-29 17:16:27 +08:00
nobody cf39eb5b27 feat: 添加use_default_coins开关,简化默认币种配置
- 新增use_default_coins配置项:true=使用默认8个主流币种,false=使用API币种池
- 更直观的配置方式,新手可直接设置true快速开始
- 优先级:use_default_coins > coin_pool_api_url > 缓存 > 默认列表
- 更新所有语言版本README(en/zh-CN/ru/uk)添加配置说明
- 更新config.json.example示例文件
2025-10-29 12:59:12 +08:00
tinkle-community 5aa50d35d7 Initial commit: NOFX AI Trading System
- Multi-AI competition mode (Qwen vs DeepSeek)
- Binance Futures integration
- AI self-learning mechanism
- Professional web dashboard
- Complete risk management system
2025-10-28 15:47:34 +08:00