Skip to content

Efficient C# implementation of Finnhub Websocket client.

License

Notifications You must be signed in to change notification settings

Chacoon3/FinnhubDotNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FinnhubDotNet - clean and efficient C# websocket wrapper for Finnhub

Disclaimer

  • This is not an official C# SDK of Finnhub. This is a personal project aimed to contribute to the open-source community.

Installation

  • .NET CLI: dotnet add package FinnhubDotNet
  • Or search FinnhubDotNet in Visual Studio using NugetPackageManager.
  • Or download the ./FinnhubDotNet folder and build the class library locally.

Sample Usage

namespace Test {
    internal class Program {
        static async Task Main(string[] args) {
            string yourKey = "";
            var ws = new FinnhubDotNet.Websocket.FinnhubStreamingClient(yourKey);
            await ws.ConnectAsync();
            await ws.SubscribeTradeAsync("BINANCE:BTCUSDT");
            await ws.SubscribeTradeAsync("BINANCE:ETHUSDT");
            ws.tradeUpdate += (trades) => {
                foreach (var trade in trades) {
                    Console.WriteLine(trade);
                }
            };

            while (true) {
                await Task.Delay(5000);
            }
        }
    }
}

Advantages

  • Efficient data handling: The data receiving logic is implemented with a pipe and a two-thread producer-consumer pattern, minimizing memory overheads and ensuring low latency.
  • Minimalistic interfaces.

About

Efficient C# implementation of Finnhub Websocket client.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages