feat(kucoin): integrate KuCoin exchange support

- Add kucoin to validTypes in api/server.go
- Add KuCoin trader creation in trader_manager.go
- Fix PostgreSQL duplicate key in equity.go (Omit ID)
- Start KuCoin order sync in auto_trader.go
- Update FooterSection UI
This commit is contained in:
tinkle-community
2026-02-04 02:12:37 +08:00
parent b32a3566e6
commit 23dbbf6bdd
5 changed files with 65 additions and 12 deletions
+3 -1
View File
@@ -53,7 +53,9 @@ func (s *EquityStore) Save(snapshot *EquitySnapshot) error {
snapshot.Timestamp = snapshot.Timestamp.UTC()
}
if err := s.db.Create(snapshot).Error; err != nil {
// Omit ID to let PostgreSQL sequence auto-generate it
// Without this, GORM inserts ID=0 which causes duplicate key errors
if err := s.db.Omit("ID").Create(snapshot).Error; err != nil {
return fmt.Errorf("failed to save equity snapshot: %w", err)
}
return nil