diff --git a/pkg/exchange/ftx/stream.go b/pkg/exchange/ftx/stream.go index 24b25e7ad..8aa77998e 100644 --- a/pkg/exchange/ftx/stream.go +++ b/pkg/exchange/ftx/stream.go @@ -48,8 +48,6 @@ func NewStream(key, secret string, subAccount string, e *Exchange) *Stream { s.ws.OnMessage((&messageHandler{StandardStream: s.StandardStream}).handleMessage) s.ws.OnConnected(func(conn *websocket.Conn) { - s.EmitConnect() - subs := []websocketRequest{newLoginRequest(s.key, s.secret, time.Now(), s.subAccount)} subs = append(subs, s.subscriptions...) for _, sub := range subs { @@ -57,6 +55,8 @@ func NewStream(key, secret string, subAccount string, e *Exchange) *Stream { s.ws.EmitError(fmt.Errorf("failed to send subscription: %+v", sub)) } } + + s.EmitConnect() }) go s.handleChannelKlineMessage()