feat: 开源准备和功能优化

- 添加 MIT 许可证
- 创建完整的项目 README.md
- 前端添加 GitHub 和 Twitter 链接
- 重构表名:copy_trading_accounts -> wallet_accounts
  - 更新 Account 实体类
  - 添加数据库迁移脚本 V3
  - 更新初始化脚本和文档
- 优化跟单订单类型:GTC -> FAK
  - 买入和卖出订单均使用 FAK (Fill-And-Kill)
  - 允许部分成交,未成交部分立即取消
  - 提高跟单响应速度和价格匹配准确性
This commit is contained in:
WrBug
2025-12-03 02:27:05 +08:00
parent 719b01508a
commit 7eb310b35e
8 changed files with 353 additions and 19 deletions
+3 -3
View File
@@ -580,7 +580,7 @@
### 3.1 Account(账户信息)
```kotlin
@Entity
@Table(name = "copy_trading_accounts")
@Table(name = "wallet_accounts")
data class Account(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -1623,7 +1623,7 @@ const address = account.address;
## 7. 数据库设计
### 7.1 表结构
- `copy_trading_accounts`: 账户信息
- `wallet_accounts`: 钱包账户表
- `copy_trading_leaders`: 被跟单者表
- `copy_trading_templates`: 跟单模板表
- `copy_trading`: 跟单关系表(钱包-模板关联,多对多)
@@ -1632,7 +1632,7 @@ const address = account.address;
- `copy_trading_processed_trades`: 已处理交易表(用于去重)
### 7.2 索引设计
- `copy_trading_accounts.wallet_address`: UNIQUE 索引
- `wallet_accounts.wallet_address`: UNIQUE 索引
- `copy_trading_leaders.leader_address`: UNIQUE 索引
- `copy_trading_templates.template_name`: UNIQUE 索引
- `copy_trading.account_id + template_id + leader_id`: 联合唯一索引