Skip to content

Commit

Permalink
fixup! Kraken: Sub Channel improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Aug 15, 2024
1 parent fb030b2 commit a279e5f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions exchanges/kraken/kraken_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ func (k *Kraken) wsProcessTickers(response []any, pair currency.Pair) error {
if !ok {
return errors.New("received invalid ticker data")
}
data := make([]float64, 9)
for i, b := range []byte("abcvlho") { // p and t skipped
data := map[string]float64{}
for _, b := range []byte("abcvlho") { // p and t skipped
key := string(b)
a, ok := t[key].([]any)
if !ok {
Expand All @@ -466,18 +466,18 @@ func (k *Kraken) wsProcessTickers(response []any, pair currency.Pair) error {
if err != nil {
return fmt.Errorf("received invalid ticker data: %w", err)
}
data[i] = f
data[key] = f
}

k.Websocket.DataHandler <- &ticker.Price{
ExchangeName: k.Name,
Ask: data[0],
Bid: data[1],
Close: data[2],
Volume: data[3],
Low: data[6],
High: data[7],
Open: data[8],
Ask: data["a"],
Bid: data["b"],
Close: data["c"],
Volume: data["v"],
Low: data["l"],
High: data["h"],
Open: data["o"],
AssetType: asset.Spot,
Pair: pair,
}
Expand Down

0 comments on commit a279e5f

Please sign in to comment.