I am using Kucoin SDK for .Net created by a third party, the problem I have is that the connections to the websockets are not constant, that is, they do not work 24/7, the documentation I found about it SDK is very limited. This is how I am configuring the websockets client.
Cliente_Kucoin = new KucoinSocketClient(new Objects.KucoinSocketClientOptions()
{
ApiCredentials = new Objects.KucoinApiCredentials("xxxxxxxxxxxx", "xxxxxxxx", "xxxxx"),
AutoReconnect = true,
ReconnectInterval = TimeSpan.FromSeconds(5),
LogLevel = Microsoft.Extensions.Logging.LogLevel.Trace,
SocketSubscriptionsCombineTarget = 2
});
And so, I make the subscriptions to the sockets.
private async void Listener_Cryptos()
{
var BTC = await ClienteKucoin.Spot.SubscribeToTickerUpdatesAsync(BTC.Tickets, BTC.Trade);
var ETH = await ClienteKucoin.Spot.SubscribeToTickerUpdatesAsync(ETH.Tickets, ETH.Trade);
var BNB = await ClienteKucoin.Spot.SubscribeToTickerUpdatesAsync(BNB.Tickets, BNB.Trade);
var ADA = await ClienteKucoin.Spot.SubscribeToTickerUpdatesAsync(ADA.Tickets, ADA.Trade);
var XRP = await ClienteKucoin.Spot.SubscribeToTickerUpdatesAsync(XRP.Tickets, XRP.Trade);
}