fix: add OKX support to order/position sync and fix WebSocket concurrent write

- Add OKX trader support in order_sync.go and position_sync.go
- Change exchange.Type to exchange.ID for correct exchange identification
- Add writeMu mutex to prevent concurrent WebSocket writes in combined_streams.go and websocket_client.go
This commit is contained in:
tinkle-community
2025-12-07 17:13:17 +08:00
parent a1211153ee
commit bee4e5dd41
2 changed files with 9 additions and 2 deletions

View File

@@ -268,6 +268,9 @@ func (m *PositionSyncManager) createTrader(config *store.TraderFullConfig) (Trad
case "bybit":
return NewBybitTrader(exchange.APIKey, exchange.SecretKey), nil
case "okx":
return NewOKXTrader(exchange.APIKey, exchange.SecretKey, exchange.Passphrase), nil
case "hyperliquid":
return NewHyperliquidTrader(exchange.SecretKey, exchange.HyperliquidWalletAddr, exchange.Testnet)