ccxt: Bybit C# WatchPositions hangs and do not receive updates

Operating System

No response

Programming Languages

No response

CCXT Version

4.2.58

Description

I am trying to receive positions (from only one symbol) from the WS in C# like this:

using dotenv.net;

namespace examples
{
    class Examples
    {
        async static public Task<int> Main()
        {
            DotEnv.Load();

            var exchange = new ccxt.pro.bybit(new Dictionary<string, object>() {
                {"apiKey", Environment.GetEnvironmentVariable("bybit_test_key")},
                {"secret", Environment.GetEnvironmentVariable("bybit_test_secret")},
            });
            exchange.setSandboxMode(true);
            exchange.verbose = true;
            await exchange.WatchPositions();
            await exchange.close();
            return 0;
        }
    }
}

In python, I do await exchange.watch_positions(symbols=[symbol], limit=10) and it works. Although I need to call it twice cause the first time it just return an empty array []. But with C#, it never receives the message it seems.

Code

  

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 41

Most upvoted comments

@shiftdeloff I will check it and let you know

@nikky78 Sorry got sidetracked with some urgent issues, will try to pick this up in a few hours