mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-09 14:00:57 +08:00
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.
This commit is contained in:
@@ -1,15 +1,25 @@
|
||||
{
|
||||
"traders": [
|
||||
{
|
||||
"id": "my_trader",
|
||||
"name": "My AI Trader",
|
||||
"id": "hyperliquid_deepseek",
|
||||
"name": "Hyperliquid DeepSeek Trader",
|
||||
"ai_model": "deepseek",
|
||||
"binance_api_key": "YOUR_BINANCE_API_KEY",
|
||||
"binance_secret_key": "YOUR_BINANCE_SECRET_KEY",
|
||||
"use_qwen": false,
|
||||
"deepseek_key": "YOUR_DEEPSEEK_API_KEY",
|
||||
"qwen_key": "",
|
||||
"initial_balance": 1000.0,
|
||||
"exchange": "hyperliquid",
|
||||
"hyperliquid_private_key": "your_ethereum_private_key_without_0x_prefix",
|
||||
"hyperliquid_testnet": false,
|
||||
"deepseek_key": "your_deepseek_api_key",
|
||||
"initial_balance": 1000,
|
||||
"scan_interval_minutes": 3
|
||||
},
|
||||
{
|
||||
"id": "binance_qwen",
|
||||
"name": "Binance Qwen Trader",
|
||||
"ai_model": "qwen",
|
||||
"exchange": "binance",
|
||||
"binance_api_key": "your_binance_api_key",
|
||||
"binance_secret_key": "your_binance_secret_key",
|
||||
"qwen_key": "your_qwen_api_key",
|
||||
"initial_balance": 1000,
|
||||
"scan_interval_minutes": 3
|
||||
}
|
||||
],
|
||||
@@ -17,7 +27,7 @@
|
||||
"coin_pool_api_url": "",
|
||||
"oi_top_api_url": "",
|
||||
"api_server_port": 8080,
|
||||
"max_daily_loss": 5.0,
|
||||
"max_drawdown": 10.0,
|
||||
"stop_trading_minutes": 30
|
||||
"max_daily_loss": 10.0,
|
||||
"max_drawdown": 20.0,
|
||||
"stop_trading_minutes": 60
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user