mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-09 22:10:57 +08:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user