-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.json.example
More file actions
209 lines (183 loc) · 6.34 KB
/
config.json.example
File metadata and controls
209 lines (183 loc) · 6.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
{
// ========================================
// Admin Authentication Configuration
// ========================================
// 用于保护启动、停止、平仓等敏感操作
//
// 安全建议:
// 1. 开发环境:可以使用明文密码,例如 "admin123"
// 2. 生产环境:强烈建议使用 bcrypt 哈希值
//
// 生成 bcrypt 哈希的方法:
// npx tsx -e "import bcrypt from 'bcrypt'; bcrypt.hash('your-password', 10).then(console.log)"
//
// 工作原理:
// - 用户输入密码后,系统会生成一个 JWT session token
// - Token 存储在 httpOnly cookie 中(防止 XSS 攻击)
// - Token 会在配置的时间后自动过期
// - 前端会检查认证状态,未认证时隐藏敏感操作按钮
// - 后端 API 会验证 token,未认证的请求返回 401
"admin": {
// 管理员密码
// 支持两种格式:
// 1. 明文密码(开发环境): "admin123"
// 2. bcrypt 哈希(生产环境): "$2b$10$..."
"password": "change-me-in-production",
// 会话超时时间(分钟)
// 建议值:30-120 分钟
// 超时后需要重新登录
"session_timeout_minutes": 60
},
// ========================================
// Traders Configuration
// ========================================
"traders": [
{
"id": "aster_deepseek",
"name": "Aster DeepSeek Trader",
"enabled": true,
"ai_model": "deepseek",
"exchange": "aster",
// Aster Exchange Configuration
// Visit https://www.asterdex.com/en/api-wallet -> Professional API -> Create New API
// user: Main wallet address (login address/connected wallet)
// signer: API wallet address (generated address)
// private_key: API wallet private key (without 0x prefix)
"aster_user": "0x082D68d29433498F4B8335d6Ee1E55079f55616a",
"aster_signer": "0x...",
"aster_private_key": "your_aster_api_wallet_private_key_without_0x_prefix",
// AI Configuration
"deepseek_key": "sk-...",
// Trading Configuration
"initial_balance": 1000.0,
"scan_interval_minutes": 3,
// Prompt Template (optional, default: "adaptive")
// Options: "adaptive", "default", "nof1", "taro"
"prompt_template": "adaptive"
},
{
"id": "aster_qwen",
"name": "Aster Qwen Trader",
"enabled": false,
"ai_model": "qwen",
"exchange": "aster",
// Aster Exchange Configuration (separate account)
"aster_user": "0x...",
"aster_signer": "0x...",
"aster_private_key": "your_aster_api_wallet_private_key_without_0x_prefix",
// AI Configuration
"qwen_key": "sk-...",
// Trading Configuration
"initial_balance": 1000.0,
"scan_interval_minutes": 3,
// Prompt Template (optional, default: "adaptive")
"prompt_template": "default"
},
{
"id": "aster_kimi",
"name": "Aster Kimi Trader",
"enabled": false,
"ai_model": "kimi",
"exchange": "aster",
// Aster Exchange Configuration
"aster_user": "0x...",
"aster_signer": "0x...",
"aster_private_key": "your_aster_api_wallet_private_key_without_0x_prefix",
// Kimi AI Configuration (Moonshot AI)
// Get your API key from: https://platform.moonshot.cn/
// Available models:
// - kimi-k2-turbo-preview (recommended: Latest K2, 4x faster, best performance)
// - moonshot-v1-8k (V1 series: 8K context, cost-effective)
// - moonshot-v1-32k (V1 series: 32K context)
// - moonshot-v1-128k (V1 series: 128K context)
"kimi_api_key": "sk-...",
"kimi_model_name": "kimi-k2-turbo-preview",
// Trading Configuration
"initial_balance": 1000.0,
"scan_interval_minutes": 3,
// Prompt Template (optional, default: "adaptive")
"prompt_template": "adaptive"
},
{
"id": "aster_custom",
"name": "Aster Custom AI Trader",
"enabled": false,
"ai_model": "custom",
"exchange": "aster",
// Aster Exchange Configuration
"aster_user": "0x...",
"aster_signer": "0x...",
"aster_private_key": "your_aster_api_wallet_private_key_without_0x_prefix",
// Custom AI Configuration
"custom_api_url": "https://api.openai.com/v1",
"custom_api_key": "sk-your-api-key",
"custom_model_name": "gpt-4o",
// Trading Configuration
"initial_balance": 1000.0,
"scan_interval_minutes": 3,
// Prompt Template (optional, default: "adaptive")
"prompt_template": "nof1"
}
],
// Global Leverage Settings
"leverage": {
"btc_eth_leverage": 5,
"altcoin_leverage": 5
},
// Telegram Notification Configuration
// Get bot_token from @BotFather on Telegram
// Get chat_id by messaging your bot and visiting: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
"telegram": {
"enabled": false,
"bot_token": "1234567890:ABCdefGHIjklMNOpqrsTUVwxyz",
"chat_id": "123456789",
"notify_on_trade": true,
"notify_on_error": true,
"notify_on_daily_summary": true,
"notify_on_performance_warning": true
},
// Coin Pool Configuration
"use_default_coins": true,
"default_coins": [
"BTCUSDT",
"ETHUSDT",
"SOLUSDT",
"BNBUSDT",
"XRPUSDT",
"DOGEUSDT",
"ADAUSDT",
"HYPEUSDT"
],
// Optional: External APIs
"coin_pool_api_url": "",
"oi_top_api_url": "",
// Risk Management
"max_daily_loss": 10.0,
"max_drawdown": 20.0,
"stop_trading_minutes": 60,
// ========================================
// Market Data Configuration
// ========================================
// Binance API Region Selection
//
// IMPORTANT: Different regions use different API endpoints and paths
//
// Option 1: "global" (default)
// - URL: https://fapi.binance.com
// - Type: Futures market (合约市场)
// - K-lines path: /fapi/v1/klines
// - Features: Open Interest, Funding Rate, Leverage Trading
// - Use for: Most regions worldwide
//
// Option 2: "us"
// - URL: https://api.binance.us
// - Type: Spot market (现货市场)
// - K-lines path: /api/v3/klines
// - Features: Basic trading only (no OI, no funding rate)
// - Use for: US users (fapi.binance.com is blocked in the US)
//
// Note: System automatically handles API path differences
"binance_region": "global",
// API Server Configuration
"api_server_port": 8000
}