V3 MarketData not supported for .Net C# Project

We are not getting “EFeedDetails” from the “Full” mode from “MarketDataFeeder” with v3 Socket dynamic URL.

Also, getting wrong value for optionGreeks.
Script Name: NIFTY2522023000CE (NIFTY 23050 CE - 27 FEB - Token #: 55641)

The subscribe script as below:
var instruments = new HashSet
{
“NSE_FO|55641”
};

Please refer the screenshot attached and advise.

We see, the entire data format has changed for V3. We tried generating the new “Protos” file - but that file is also not V3 supporting

We tried to modify the sdk but it seems there has been a structure change between both versions.

Can you please suggest a timeline for when will a updated “Protos” file for V3 .Net C# project be avalible

As in the API documentation sheet - it shows that V2 will soon be depreciated

Is the C# V3 SDK development planned? If not, please reply so we can plan accordingly.

Hi @Samiksha_47544883,

The development of C# v3 is currently in progress. We will provide an update once it is completed.

In the meantime, you may refer to the following folder, which contains the compiled proto files and an example class to connect to the v3 WebSocket:
GitHub Link

Thank you for your patience and understanding.

1 Like

Thanks for the reply @Ketan, the link to the example class is very helpful

1 Like

We have applied additional changes to parse & read Socket response in SDK project.

@Ketan_Gupta , Please advise if this looks good Or any other changes required.

\Feeder\MarketDataFeeder.cs

private async Task ReceiveMessagesAsync()
{
var buffer = new byte[4096];
using (var messageStream = new System.IO.MemoryStream()) // For accumulating message fragments
{

            try
            {
                while (WebSocket.State == WebSocketState.Open)
                {
                    var resultSegment = new ArraySegment<byte>(buffer);                        
                    var result = await WebSocket.ReceiveAsync(resultSegment, CancellationToken.None);

                    if (result.MessageType == WebSocketMessageType.Binary)
                    {
                        //RaiseOnBinaryMessageEvent(buffer, result);

                        // Add the received fragment to our message stream
                        messageStream.Write(buffer, 0, result.Count);

                        // Only process when we have the complete message
                        if (result.EndOfMessage)
                        {
                            byte[] completeMessage = messageStream.ToArray();

                            // Create a new result that represents the complete message
                            var completeResult = new WebSocketReceiveResult(
                                (int)messageStream.Length,
                                WebSocketMessageType.Binary,
                                true);

                            // Process the complete message
                            RaiseOnBinaryMessageEvent(completeMessage, completeResult);

                            // Reset for next message
                            messageStream.SetLength(0);
                            messageStream.Position = 0;
                        }
                        // If not end of message, continue receiving fragments
                        
                    }
                    else if (result.MessageType == WebSocketMessageType.Close)
                    {
                        int closeStatusCode = (int)WebSocket.CloseStatus.Value;
                        string closeStatusDescription = WebSocket.CloseStatusDescription;
                        RaiseOnCloseEvent(closeStatusCode, closeStatusDescription);
                        await WebSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                RaiseOnErrorEvent(ex);
            }
        }
    }