diff --git a/HTX.Net/Clients/SpotApi/HTXSocketClientSpotApiShared.cs b/HTX.Net/Clients/SpotApi/HTXSocketClientSpotApiShared.cs index 5417d93..6c94c62 100644 --- a/HTX.Net/Clients/SpotApi/HTXSocketClientSpotApiShared.cs +++ b/HTX.Net/Clients/SpotApi/HTXSocketClientSpotApiShared.cs @@ -22,7 +22,7 @@ async Task> ITickersSocketClient.SubscribeToA if (validationError != null) return new ExchangeResult(Exchange, validationError); - var result = await SubscribeToTickerUpdatesAsync(update => handler(update.AsExchangeEvent>(Exchange, update.Data.Select(x => new SharedSpotTicker(x.Symbol, x.ClosePrice ?? 0, x.HighPrice ?? 0, x.LowPrice ?? 0, x.Volume ?? 0, x.OpenPrice == null ? null : Math.Round((x.ClosePrice ?? 0) / x.OpenPrice.Value * 100 - 100, 2))).ToArray()))).ConfigureAwait(false); + var result = await SubscribeToTickerUpdatesAsync(update => handler(update.AsExchangeEvent>(Exchange, update.Data.Select(x => new SharedSpotTicker(x.Symbol, x.ClosePrice ?? 0, x.HighPrice ?? 0, x.LowPrice ?? 0, x.Volume ?? 0, x.OpenPrice == null ? null : Math.Round((x.ClosePrice ?? 0) / x.OpenPrice.Value * 100 - 100, 2))).ToArray())), ct).ConfigureAwait(false); return new ExchangeResult(Exchange, result); } @@ -37,7 +37,7 @@ async Task> ITickerSocketClient.SubscribeToTi return new ExchangeResult(Exchange, validationError); var symbol = request.Symbol.GetSymbol(FormatSymbol); - var result = await SubscribeToTickerUpdatesAsync(symbol, update => handler(update.AsExchangeEvent(Exchange, new SharedSpotTicker(symbol, update.Data.LastTradePrice, update.Data.HighPrice ?? 0, update.Data.LowPrice ?? 0, update.Data.Volume ?? 0, update.Data.OpenPrice == null ? null : Math.Round((update.Data.ClosePrice ?? 0) / update.Data.OpenPrice.Value * 100 - 100, 2))))).ConfigureAwait(false); + var result = await SubscribeToTickerUpdatesAsync(symbol, update => handler(update.AsExchangeEvent(Exchange, new SharedSpotTicker(symbol, update.Data.LastTradePrice, update.Data.HighPrice ?? 0, update.Data.LowPrice ?? 0, update.Data.Volume ?? 0, update.Data.OpenPrice == null ? null : Math.Round((update.Data.ClosePrice ?? 0) / update.Data.OpenPrice.Value * 100 - 100, 2)))), ct).ConfigureAwait(false); return new ExchangeResult(Exchange, result); } diff --git a/HTX.Net/Clients/UsdtFutures/HTXSocketClientUsdtFuturesApiShared.cs b/HTX.Net/Clients/UsdtFutures/HTXSocketClientUsdtFuturesApiShared.cs index de932c1..f242686 100644 --- a/HTX.Net/Clients/UsdtFutures/HTXSocketClientUsdtFuturesApiShared.cs +++ b/HTX.Net/Clients/UsdtFutures/HTXSocketClientUsdtFuturesApiShared.cs @@ -22,7 +22,7 @@ async Task> ITickerSocketClient.SubscribeToTi return new ExchangeResult(Exchange, validationError); var symbol = request.Symbol.GetSymbol(FormatSymbol); - var result = await SubscribeToTickerUpdatesAsync(symbol, update => handler(update.AsExchangeEvent(Exchange, new SharedSpotTicker(symbol, update.Data.ClosePrice, update.Data.HighPrice ?? 0, update.Data.LowPrice ?? 0, update.Data.Volume ?? 0, update.Data.OpenPrice == null ? null : Math.Round((update.Data.ClosePrice ?? 0) / update.Data.OpenPrice.Value * 100 - 100, 2))))).ConfigureAwait(false); + var result = await SubscribeToTickerUpdatesAsync(symbol, update => handler(update.AsExchangeEvent(Exchange, new SharedSpotTicker(symbol, update.Data.ClosePrice, update.Data.HighPrice ?? 0, update.Data.LowPrice ?? 0, update.Data.Volume ?? 0, update.Data.OpenPrice == null ? null : Math.Round((update.Data.ClosePrice ?? 0) / update.Data.OpenPrice.Value * 100 - 100, 2)))), ct).ConfigureAwait(false); return new ExchangeResult(Exchange, result); }