mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-04 11:30:58 +08:00
Merge branch 'dev' of https://github.com/tinkle-community/nofx into dev
This commit is contained in:
12
.github/workflows/pr-checks-advisory.yml
vendored
12
.github/workflows/pr-checks-advisory.yml
vendored
@@ -8,12 +8,16 @@ on:
|
||||
# These checks are advisory only - they won't block PR merging
|
||||
# Results will be posted as comments to help contributors improve their PRs
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
checks: write
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
pr-info:
|
||||
name: PR Information
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Check PR title format
|
||||
id: check-title
|
||||
@@ -98,8 +102,6 @@ jobs:
|
||||
backend-checks:
|
||||
name: Backend Checks (Advisory)
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -208,8 +210,6 @@ jobs:
|
||||
frontend-checks:
|
||||
name: Frontend Checks (Advisory)
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
26
README.md
26
README.md
@@ -124,11 +124,12 @@ A Binance-compatible decentralized perpetual futures exchange!
|
||||
- 🌐 **Multi-chain support** - trade on your preferred EVM chain
|
||||
|
||||
**Quick Start:**
|
||||
1. Visit [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
2. Connect your main wallet and create an API wallet
|
||||
3. Copy the API Signer address and Private Key
|
||||
4. ~~Set `"exchange": "aster"` in config.json~~ *Configure through web interface*
|
||||
5. Add `"aster_user"`, `"aster_signer"`, and `"aster_private_key"`
|
||||
1. Register via [Aster Referral Link](https://www.asterdex.com/en/referral/fdfc0e) (get fee discounts!)
|
||||
2. Visit [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
3. Connect your main wallet and create an API wallet
|
||||
4. Copy the API Signer address and Private Key
|
||||
5. Set `"exchange": "aster"` in config.json
|
||||
6. Add `"aster_user"`, `"aster_signer"`, and `"aster_private_key"`
|
||||
|
||||
---
|
||||
|
||||
@@ -406,7 +407,7 @@ Before configuring the system, you need to obtain AI API keys. Choose one of the
|
||||
|
||||
**How to get Qwen API Key:**
|
||||
|
||||
1. **Visit**: [https://dashscope.aliyuncs.com](https://dashscope.aliyuncs.com)
|
||||
1. **Visit**: [https://dashscope.console.aliyun.com](https://dashscope.console.aliyun.com)
|
||||
2. **Register**: Sign up with Alibaba Cloud account
|
||||
3. **Enable Service**: Activate DashScope service
|
||||
4. **Create API Key**:
|
||||
@@ -543,12 +544,13 @@ Open your browser and visit: **🌐 http://localhost:3000**
|
||||
- 🌐 Multi-chain support (ETH, BSC, Polygon)
|
||||
- 🌍 No KYC required
|
||||
|
||||
**Step 1**: Create Aster API Wallet
|
||||
**Step 1**: Register and Create Aster API Wallet
|
||||
|
||||
1. Visit [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
2. Connect your main wallet (MetaMask, WalletConnect, etc.)
|
||||
3. Click "Create API Wallet"
|
||||
4. **Save these 3 items immediately:**
|
||||
1. Register via [Aster Referral Link](https://www.asterdex.com/en/referral/fdfc0e) (get fee discounts!)
|
||||
2. Visit [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
3. Connect your main wallet (MetaMask, WalletConnect, etc.)
|
||||
4. Click "Create API Wallet"
|
||||
5. **Save these 3 items immediately:**
|
||||
- Main Wallet address (User)
|
||||
- API Wallet address (Signer)
|
||||
- API Wallet Private Key (⚠️ shown only once!)
|
||||
@@ -1271,7 +1273,7 @@ We welcome contributions from the community! See our comprehensive guides:
|
||||
|
||||
- [Binance API](https://binance-docs.github.io/apidocs/futures/en/) - Binance Futures API
|
||||
- [DeepSeek](https://platform.deepseek.com/) - DeepSeek AI API
|
||||
- [Qwen](https://dashscope.aliyuncs.com/) - Alibaba Cloud Qwen
|
||||
- [Qwen](https://dashscope.console.aliyun.com/) - Alibaba Cloud Qwen
|
||||
- [TA-Lib](https://ta-lib.org/) - Technical indicator library
|
||||
- [Recharts](https://recharts.org/) - React chart library
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ func GetFullDecisionWithCustomPrompt(ctx *Context, mcpClient *mcp.Client, custom
|
||||
// 4. 解析AI响应
|
||||
decision, err := parseFullDecisionResponse(aiResponse, ctx.Account.TotalEquity, ctx.BTCETHLeverage, ctx.AltcoinLeverage)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("解析AI响应失败: %w", err)
|
||||
return decision, fmt.Errorf("解析AI响应失败: %w", err)
|
||||
}
|
||||
|
||||
decision.Timestamp = time.Now()
|
||||
@@ -397,7 +397,7 @@ func parseFullDecisionResponse(aiResponse string, accountEquity float64, btcEthL
|
||||
return &FullDecision{
|
||||
CoTTrace: cotTrace,
|
||||
Decisions: []Decision{},
|
||||
}, fmt.Errorf("提取决策失败: %w\n\n=== AI思维链分析 ===\n%s", err, cotTrace)
|
||||
}, fmt.Errorf("提取决策失败: %w", err)
|
||||
}
|
||||
|
||||
// 3. 验证决策
|
||||
@@ -405,7 +405,7 @@ func parseFullDecisionResponse(aiResponse string, accountEquity float64, btcEthL
|
||||
return &FullDecision{
|
||||
CoTTrace: cotTrace,
|
||||
Decisions: decisions,
|
||||
}, fmt.Errorf("决策验证失败: %w\n\n=== AI思维链分析 ===\n%s", err, cotTrace)
|
||||
}, fmt.Errorf("决策验证失败: %w", err)
|
||||
}
|
||||
|
||||
return &FullDecision{
|
||||
|
||||
@@ -117,11 +117,12 @@ NOFX теперь поддерживает **три основные биржи*
|
||||
- 🌐 **Поддержка нескольких цепей** - торгуйте на вашей любимой EVM цепи
|
||||
|
||||
**Быстрый старт:**
|
||||
1. Посетите [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
2. Подключите основной кошелек и создайте API кошелек
|
||||
3. Скопируйте адрес API Signer и приватный ключ
|
||||
4. Установите `"exchange": "aster"` в config.json
|
||||
5. Добавьте `"aster_user"`, `"aster_signer"` и `"aster_private_key"`
|
||||
1. Зарегистрируйтесь по [реферальной ссылке Aster](https://www.asterdex.com/en/referral/fdfc0e) (получите скидку на комиссии!)
|
||||
2. Посетите [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
3. Подключите основной кошелек и создайте API кошелек
|
||||
4. Скопируйте адрес API Signer и приватный ключ
|
||||
5. Установите `"exchange": "aster"` в config.json
|
||||
6. Добавьте `"aster_user"`, `"aster_signer"` и `"aster_private_key"`
|
||||
|
||||
---
|
||||
|
||||
@@ -399,7 +400,7 @@ cd ..
|
||||
|
||||
**Как получить Qwen API ключ:**
|
||||
|
||||
1. **Посетите**: [https://dashscope.aliyuncs.com](https://dashscope.aliyuncs.com)
|
||||
1. **Посетите**: [https://dashscope.console.aliyun.com](https://dashscope.console.aliyun.com)
|
||||
2. **Зарегистрируйтесь**: Используя аккаунт Alibaba Cloud
|
||||
3. **Активируйте сервис**: Активируйте DashScope сервис
|
||||
4. **Создайте API ключ**:
|
||||
@@ -534,12 +535,13 @@ cp config.example.jsonc config.json
|
||||
- 🌐 Поддержка нескольких цепей (ETH, BSC, Polygon)
|
||||
- 🌍 Не нужна KYC
|
||||
|
||||
**Шаг 1**: Создайте Aster API кошелек
|
||||
**Шаг 1**: Зарегистрируйтесь и создайте Aster API кошелек
|
||||
|
||||
1. Посетите [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
2. Подключите основной кошелек (MetaMask, WalletConnect и т.д.)
|
||||
3. Нажмите "Создать API кошелек"
|
||||
4. **Сохраните эти 3 элемента немедленно:**
|
||||
1. Зарегистрируйтесь по [реферальной ссылке Aster](https://www.asterdex.com/en/referral/fdfc0e) (получите скидку на комиссии!)
|
||||
2. Посетите [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
3. Подключите основной кошелек (MetaMask, WalletConnect и т.д.)
|
||||
4. Нажмите "Создать API кошелек"
|
||||
5. **Сохраните эти 3 элемента немедленно:**
|
||||
- Адрес основного кошелька (User)
|
||||
- Адрес API кошелька (Signer)
|
||||
- Приватный ключ API кошелька (⚠️ показывается только один раз!)
|
||||
@@ -1094,7 +1096,7 @@ sudo apt-get install libta-lib0-dev
|
||||
|
||||
- [Binance API](https://binance-docs.github.io/apidocs/futures/en/) - Binance Futures API
|
||||
- [DeepSeek](https://platform.deepseek.com/) - DeepSeek AI API
|
||||
- [Qwen](https://dashscope.aliyuncs.com/) - Alibaba Cloud Qwen
|
||||
- [Qwen](https://dashscope.console.aliyun.com/) - Alibaba Cloud Qwen
|
||||
- [TA-Lib](https://ta-lib.org/) - Библиотека технических индикаторов
|
||||
- [Recharts](https://recharts.org/) - Библиотека графиков React
|
||||
|
||||
|
||||
@@ -118,11 +118,12 @@ NOFX тепер підтримує **три основні біржі**: Binance
|
||||
- 🌐 **Підтримка кількох ланцюгів** - торгуйте на вашому улюбленому EVM ланцюзі
|
||||
|
||||
**Швидкий старт:**
|
||||
1. Відвідайте [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
2. Підключіть основний гаманець і створіть API гаманець
|
||||
3. Скопіюйте адресу API Signer та приватний ключ
|
||||
4. Встановіть `"exchange": "aster"` в config.json
|
||||
5. Додайте `"aster_user"`, `"aster_signer"` та `"aster_private_key"`
|
||||
1. Зареєструйтеся за [реферальним посиланням Aster](https://www.asterdex.com/en/referral/fdfc0e) (отримайте знижку на комісії!)
|
||||
2. Відвідайте [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
3. Підключіть основний гаманець і створіть API гаманець
|
||||
4. Скопіюйте адресу API Signer та приватний ключ
|
||||
5. Встановіть `"exchange": "aster"` в config.json
|
||||
6. Додайте `"aster_user"`, `"aster_signer"` та `"aster_private_key"`
|
||||
|
||||
---
|
||||
|
||||
@@ -402,7 +403,7 @@ cd ..
|
||||
|
||||
**Як отримати Qwen API ключ:**
|
||||
|
||||
1. **Відвідайте**: [https://dashscope.aliyuncs.com](https://dashscope.aliyuncs.com)
|
||||
1. **Відвідайте**: [https://dashscope.console.aliyun.com](https://dashscope.console.aliyun.com)
|
||||
2. **Зареєструйтеся**: Використовуючи акаунт Alibaba Cloud
|
||||
3. **Активуйте сервіс**: Активуйте DashScope сервіс
|
||||
4. **Створіть API ключ**:
|
||||
@@ -537,12 +538,13 @@ cp config.example.jsonc config.json
|
||||
- 🌐 Підтримка кількох ланцюгів (ETH, BSC, Polygon)
|
||||
- 🌍 Не потрібна KYC
|
||||
|
||||
**Крок 1**: Створіть Aster API гаманець
|
||||
**Крок 1**: Зареєструйтеся та створіть Aster API гаманець
|
||||
|
||||
1. Відвідайте [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
2. Підключіть основний гаманець (MetaMask, WalletConnect тощо)
|
||||
3. Натисніть "Створити API гаманець"
|
||||
4. **Збережіть ці 3 елементи негайно:**
|
||||
1. Зареєструйтеся за [реферальним посиланням Aster](https://www.asterdex.com/en/referral/fdfc0e) (отримайте знижку на комісії!)
|
||||
2. Відвідайте [Aster API Wallet](https://www.asterdex.com/en/api-wallet)
|
||||
3. Підключіть основний гаманець (MetaMask, WalletConnect тощо)
|
||||
4. Натисніть "Створити API гаманець"
|
||||
5. **Збережіть ці 3 елементи негайно:**
|
||||
- Адреса основного гаманця (User)
|
||||
- Адреса API гаманця (Signer)
|
||||
- Приватний ключ API гаманця (⚠️ показується лише один раз!)
|
||||
|
||||
@@ -126,11 +126,12 @@ NOFX现已支持**三大交易所**:Binance、Hyperliquid和Aster DEX!
|
||||
- 🌐 **多链支持** - 在你喜欢的EVM链上交易
|
||||
|
||||
**快速开始:**
|
||||
1. 访问[Aster API钱包](https://www.asterdex.com/en/api-wallet)
|
||||
2. 连接你的主钱包并创建API钱包
|
||||
3. 复制API Signer地址和私钥
|
||||
4. ~~在config.json中设置`"exchange": "aster"`~~ *通过Web界面配置*
|
||||
5. 添加`"aster_user"`、`"aster_signer"`和`"aster_private_key"`
|
||||
1. 通过[推荐链接注册Aster](https://www.asterdex.com/en/referral/fdfc0e)(享手续费优惠)
|
||||
2. 访问[Aster API钱包](https://www.asterdex.com/en/api-wallet)
|
||||
3. 连接你的主钱包并创建API钱包
|
||||
4. 复制API Signer地址和私钥
|
||||
5. 在config.json中设置`"exchange": "aster"`
|
||||
6. 添加`"aster_user"`、`"aster_signer"`和`"aster_private_key"`
|
||||
|
||||
---
|
||||
|
||||
@@ -398,7 +399,7 @@ cd ..
|
||||
|
||||
**如何获取Qwen API密钥:**
|
||||
|
||||
1. **访问**:[https://dashscope.aliyuncs.com](https://dashscope.aliyuncs.com)
|
||||
1. **访问**:[https://dashscope.console.aliyun.com](https://dashscope.console.aliyun.com)
|
||||
2. **注册**:使用阿里云账户注册
|
||||
3. **开通服务**:激活DashScope服务
|
||||
4. **创建API密钥**:
|
||||
@@ -535,12 +536,13 @@ cp config.example.jsonc config.json
|
||||
- 🌐 多链支持(ETH、BSC、Polygon)
|
||||
- 🌍 无需KYC
|
||||
|
||||
**步骤1**:创建Aster API钱包
|
||||
**步骤1**:注册并创建Aster API钱包
|
||||
|
||||
1. 访问[Aster API钱包](https://www.asterdex.com/en/api-wallet)
|
||||
2. 连接你的主钱包(MetaMask、WalletConnect等)
|
||||
3. 点击"创建API钱包"
|
||||
4. **立即保存这3项:**
|
||||
1. 通过[推荐链接注册Aster](https://www.asterdex.com/en/referral/fdfc0e)(享手续费优惠)
|
||||
2. 访问[Aster API钱包](https://www.asterdex.com/en/api-wallet)
|
||||
3. 连接你的主钱包(MetaMask、WalletConnect等)
|
||||
4. 点击"创建API钱包"
|
||||
5. **立即保存这3项:**
|
||||
- 主钱包地址(User)
|
||||
- API钱包地址(Signer)
|
||||
- API钱包私钥(⚠️ 仅显示一次!)
|
||||
@@ -1290,7 +1292,7 @@ MIT License - 详见 [LICENSE](LICENSE) 文件
|
||||
|
||||
- [Binance API](https://binance-docs.github.io/apidocs/futures/cn/) - 币安合约API
|
||||
- [DeepSeek](https://platform.deepseek.com/) - DeepSeek AI API
|
||||
- [Qwen](https://dashscope.aliyuncs.com/) - 阿里云通义千问
|
||||
- [Qwen](https://dashscope.console.aliyun.com/) - 阿里云通义千问
|
||||
- [TA-Lib](https://ta-lib.org/) - 技术指标库
|
||||
- [Recharts](https://recharts.org/) - React图表库
|
||||
|
||||
|
||||
@@ -2,11 +2,22 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<!-- Google Tag Manager -->
|
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','GTM-TM429527');</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
<link rel="icon" type="image/svg+xml" href="/icons/nofx.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>NOFX - AI Auto Trading Dashboard</title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TM429527"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
|
||||
@@ -277,17 +277,17 @@ export function AITradersPage({ onTraderSelect }: AITradersPageProps) {
|
||||
|
||||
const handleSaveModelConfig = async (modelId: string, apiKey: string, customApiUrl?: string, customModelName?: string) => {
|
||||
try {
|
||||
// 找到要配置的模型(从supportedModels中)
|
||||
const modelToUpdate = supportedModels?.find(m => m.id === modelId);
|
||||
// 创建或更新用户的模型配置
|
||||
const existingModel = allModels?.find(m => m.id === modelId);
|
||||
let updatedModels;
|
||||
|
||||
// 找到要配置的模型(优先从已配置列表,其次从支持列表)
|
||||
const modelToUpdate = existingModel || supportedModels?.find(m => m.id === modelId);
|
||||
if (!modelToUpdate) {
|
||||
alert(t('modelNotExist', language));
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建或更新用户的模型配置
|
||||
const existingModel = allModels?.find(m => m.id === modelId);
|
||||
let updatedModels;
|
||||
|
||||
if (existingModel) {
|
||||
// 更新现有配置
|
||||
updatedModels = allModels?.map(m =>
|
||||
|
||||
Reference in New Issue
Block a user