mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
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:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user