diff --git a/exchanges/kraken/kraken_test.go b/exchanges/kraken/kraken_test.go index 2f036914ec2..c8869a1ddaa 100644 --- a/exchanges/kraken/kraken_test.go +++ b/exchanges/kraken/kraken_test.go @@ -1021,6 +1021,7 @@ func TestWsOrderbookSub(t *testing.T) { testexch.SetupWs(t, k) err := k.Subscribe(subscription.List{{ + Asset: asset.Spot, Channel: subscription.OrderbookChannel, Pairs: currency.Pairs{xbtusdPair}, Levels: 25, @@ -1051,6 +1052,7 @@ func TestWsCandlesSub(t *testing.T) { testexch.SetupWs(t, k) err := k.Subscribe(subscription.List{{ + Asset: asset.Spot, Channel: subscription.CandlesChannel, Pairs: currency.Pairs{xbtusdPair}, Interval: kline.OneHour, diff --git a/exchanges/kraken/kraken_websocket.go b/exchanges/kraken/kraken_websocket.go index 1fd5da4eaf2..49cf8a92449 100644 --- a/exchanges/kraken/kraken_websocket.go +++ b/exchanges/kraken/kraken_websocket.go @@ -1065,10 +1065,6 @@ func (k *Kraken) manageSubs(op string, subs subscription.List) error { r.Subscription.Interval = int(time.Duration(s.Interval).Minutes()) } - if !s.Asset.IsValid() { - s.Asset = asset.Spot - } - conn := k.Websocket.Conn if s.Authenticated { r.Subscription.Token = authToken @@ -1203,14 +1199,15 @@ func (k *Kraken) wsProcessSubStatus(resp []byte) { return } key := &subscription.Subscription{ + // We don't use asset because it's either Empty or Spot, but not both Channel: channelName, - Asset: asset.Spot, Pairs: currency.Pairs{pair}, } + if err = fqChannelNameSub(key); err != nil { return } - s := k.Websocket.GetSubscription(key) + s := k.Websocket.GetSubscription(&subscription.IgnoringAssetKey{key}) if s == nil { log.Errorf(log.ExchangeSys, "%s %s Channel: %s Pairs: %s", k.Name, subscription.ErrNotFound, key.Channel, key.Pairs.Join()) return