Skip to content

Commit

Permalink
huobi: Swap ticker amount and volume values (thrasher-corp#1679)
Browse files Browse the repository at this point in the history
Co-authored-by: shazbert <[email protected]>
  • Loading branch information
shazbert and shazbert authored Oct 14, 2024
1 parent 632d417 commit 9645b7b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions exchanges/huobi/huobi_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ func (h *HUOBI) UpdateTickers(ctx context.Context, a asset.Item) error {
Low: ticks.Data[i].Low,
Bid: ticks.Data[i].Bid,
Ask: ticks.Data[i].Ask,
Volume: ticks.Data[i].Volume,
QuoteVolume: ticks.Data[i].Amount,
Volume: ticks.Data[i].Amount,
QuoteVolume: ticks.Data[i].Volume,
Open: ticks.Data[i].Open,
Close: ticks.Data[i].Close,
BidSize: ticks.Data[i].BidSize,
Expand Down Expand Up @@ -389,8 +389,8 @@ func (h *HUOBI) UpdateTickers(ctx context.Context, a asset.Item) error {
err = ticker.ProcessTicker(&ticker.Price{
High: ticks[i].High.Float64(),
Low: ticks[i].Low.Float64(),
Volume: ticks[i].Volume.Float64(),
QuoteVolume: ticks[i].Amount.Float64(),
Volume: ticks[i].Amount.Float64(),
QuoteVolume: ticks[i].Volume.Float64(),
Open: ticks[i].Open.Float64(),
Close: ticks[i].Close.Float64(),
Bid: ticks[i].Bid[0],
Expand Down Expand Up @@ -439,12 +439,11 @@ func (h *HUOBI) UpdateTickers(ctx context.Context, a asset.Item) error {
}
continue
}
tt := time.UnixMilli(ticks[i].Timestamp)
err = ticker.ProcessTicker(&ticker.Price{
High: ticks[i].High.Float64(),
Low: ticks[i].Low.Float64(),
Volume: ticks[i].Volume.Float64(),
QuoteVolume: ticks[i].Amount.Float64(),
Volume: ticks[i].Amount.Float64(),
QuoteVolume: ticks[i].Volume.Float64(),
Open: ticks[i].Open.Float64(),
Close: ticks[i].Close.Float64(),
Bid: ticks[i].Bid[0],
Expand All @@ -454,7 +453,7 @@ func (h *HUOBI) UpdateTickers(ctx context.Context, a asset.Item) error {
Pair: cp,
ExchangeName: h.Name,
AssetType: a,
LastUpdated: tt,
LastUpdated: time.UnixMilli(ticks[i].Timestamp),
})
if err != nil {
errs = common.AppendError(errs, err)
Expand Down Expand Up @@ -483,7 +482,8 @@ func (h *HUOBI) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item)
err = ticker.ProcessTicker(&ticker.Price{
High: tickerData.Tick.High,
Low: tickerData.Tick.Low,
Volume: tickerData.Tick.Volume,
Volume: tickerData.Tick.Amount,
QuoteVolume: tickerData.Tick.Volume,
Open: tickerData.Tick.Open,
Close: tickerData.Tick.Close,
Pair: p,
Expand All @@ -509,7 +509,8 @@ func (h *HUOBI) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item)
err = ticker.ProcessTicker(&ticker.Price{
High: marketData.Tick.High,
Low: marketData.Tick.Low,
Volume: marketData.Tick.Vol,
Volume: marketData.Tick.Amount,
QuoteVolume: marketData.Tick.Vol,
Open: marketData.Tick.Open,
Close: marketData.Tick.Close,
Pair: p,
Expand All @@ -530,7 +531,8 @@ func (h *HUOBI) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item)
err = ticker.ProcessTicker(&ticker.Price{
High: marketData.Tick.High,
Low: marketData.Tick.Low,
Volume: marketData.Tick.Vol,
Volume: marketData.Tick.Amount,
QuoteVolume: marketData.Tick.Vol,
Open: marketData.Tick.Open,
Close: marketData.Tick.Close,
Pair: p,
Expand Down

0 comments on commit 9645b7b

Please sign in to comment.