From c81b15861de56dd4eea827711578e947102ebfb6 Mon Sep 17 00:00:00 2001 From: Jkorf Date: Tue, 21 Jan 2025 15:24:23 +0100 Subject: [PATCH] Updated examples and docs with HyperLiquid references --- Examples/BlazorClient/BlazorClient.csproj | 35 +-- Examples/BlazorClient/Pages/Index.razor | 13 +- Examples/BlazorClient/Pages/LiveData.razor | 5 +- Examples/BlazorClient/Pages/OrderBooks.razor | 4 + Examples/BlazorClient/Pages/Trackers.razor | 38 +-- Examples/BlazorClient/Startup.cs | 1 + Examples/BlazorClient/_Imports.razor | 1 + README.md | 1 + docs/index.html | 232 ++++++++++++++++++- 9 files changed, 291 insertions(+), 39 deletions(-) diff --git a/Examples/BlazorClient/BlazorClient.csproj b/Examples/BlazorClient/BlazorClient.csproj index f07d898..ab26646 100644 --- a/Examples/BlazorClient/BlazorClient.csproj +++ b/Examples/BlazorClient/BlazorClient.csproj @@ -5,23 +5,24 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/Examples/BlazorClient/Pages/Index.razor b/Examples/BlazorClient/Pages/Index.razor index 672374c..f74ce68 100644 --- a/Examples/BlazorClient/Pages/Index.razor +++ b/Examples/BlazorClient/Pages/Index.razor @@ -9,7 +9,8 @@ @inject ICoinExRestClient coinexClient @inject ICryptoComRestClient cryptocomClient @inject IGateIoRestClient gateioClient -@inject IHTXRestClient huobiClient +@inject IHTXRestClient htxClient +@inject IHyperLiquidRestClient hyperLiquidClient @inject IKrakenRestClient krakenClient @inject IKucoinRestClient kucoinClient @inject IMexcRestClient mexcClient @@ -37,7 +38,8 @@ var coinexTask = coinexClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT"); var cryptocomTask = cryptocomClient.ExchangeApi.ExchangeData.GetTickersAsync("BTC_USDT"); var gateioTask = gateioClient.SpotApi.ExchangeData.GetTickersAsync("BTC_USDT"); - var htxTask = huobiClient.SpotApi.ExchangeData.GetTickerAsync("btcusdt"); + var htxTask = htxClient.SpotApi.ExchangeData.GetTickerAsync("btcusdt"); + var hyperLiquidTask = hyperLiquidClient.FuturesApi.ExchangeData.GetExchangeInfoAndTickersAsync(); // HyperLiquid does not have BTC spot trading var krakenTask = krakenClient.SpotApi.ExchangeData.GetTickerAsync("XBTUSD"); var kucoinTask = kucoinClient.SpotApi.ExchangeData.GetTickerAsync("BTC-USDT"); var mexcTask = mexcClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT"); @@ -79,6 +81,13 @@ if (htxTask.Result.Success) _prices.Add("HTX", htxTask.Result.Data.ClosePrice ?? 0); + if (hyperLiquidTask.Result.Success) + { + // HyperLiquid API doesn't offer an endpoint to filter for a specific ticker, so we have to filter client side + var tickers = hyperLiquidTask.Result.Data.Tickers; + _prices.Add("HyperLiquid", tickers.Single(x => x.Symbol == "BTC").MidPrice ?? 9); + } + if (krakenTask.Result.Success) _prices.Add("Kraken", krakenTask.Result.Data.First().Value.LastTrade.Price); diff --git a/Examples/BlazorClient/Pages/LiveData.razor b/Examples/BlazorClient/Pages/LiveData.razor index 2ce2689..8683ee2 100644 --- a/Examples/BlazorClient/Pages/LiveData.razor +++ b/Examples/BlazorClient/Pages/LiveData.razor @@ -10,6 +10,7 @@ @inject ICryptoComSocketClient cryptocomSocketClient @inject IGateIoSocketClient gateioSocketClient @inject IHTXSocketClient htxSocketClient +@inject IHyperLiquidSocketClient hyperLiquidSocketClient @inject IKrakenSocketClient krakenSocketClient @inject IKucoinSocketClient kucoinSocketClient @inject IMexcSocketClient mexcSocketClient @@ -42,10 +43,12 @@ bitmartSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("BitMart", data.Data.LastPrice)), bybitSocketClient.V5SpotApi.SubscribeToTickerUpdatesAsync("ETHBTC", data => UpdateData("Bybit", data.Data.LastPrice)), coinExSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETHBTC", data => UpdateData("CoinEx", data.Data.LastPrice)), - coinbaseSocketClient.AdvancedTradeApi.SubscribeToTickerUpdatesAsync("ETH-BTC", data => UpdateData("Coinbase", data.Data.LastPrice)), + coinbaseSocketClient.AdvancedTradeApi.SubscribeToTickerUpdatesAsync("ETH-BTC", data => UpdateData("Coinbase", data.Data.LastPrice ?? 0)), cryptocomSocketClient.ExchangeApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("CryptoCom", data.Data.LastPrice ?? 0)), gateioSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("GateIo", data.Data.LastPrice)), htxSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ethbtc", data => UpdateData("HTX", data.Data.ClosePrice ?? 0)), + // HyperLiquid doesn't support the ETH/BTC pair + //hyperLiquidSocketClient.SpotApi.SubscribeToSymbolUpdatesAsync("ETH", data => UpdateData("HyperLiquid", data.Data.MidPrice ?? 0)), krakenSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH/XBT", data => UpdateData("Kraken", data.Data.LastPrice)), kucoinSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH-BTC", data => UpdateData("Kucoin", data.Data.LastPrice ?? 0)), mexcSocketClient.SpotApi.SubscribeToMiniTickerUpdatesAsync("ETHBTC", data => UpdateData("Mexc", data.Data.LastPrice)), diff --git a/Examples/BlazorClient/Pages/OrderBooks.razor b/Examples/BlazorClient/Pages/OrderBooks.razor index e74125d..2755a2d 100644 --- a/Examples/BlazorClient/Pages/OrderBooks.razor +++ b/Examples/BlazorClient/Pages/OrderBooks.razor @@ -13,6 +13,7 @@ @using CryptoCom.Net.Interfaces @using GateIo.Net.Interfaces @using HTX.Net.Interfaces +@using HyperLiquid.Net.Interfaces @using Kraken.Net.Interfaces @using Kucoin.Net.Clients @using Kucoin.Net.Interfaces @@ -30,6 +31,7 @@ @inject ICryptoComOrderBookFactory cryptocomFactory @inject IGateIoOrderBookFactory gateioFactory @inject IHTXOrderBookFactory htxFactory +@inject IHyperLiquidOrderBookFactory hyperLiquidFactory @inject IKrakenOrderBookFactory krakenFactory @inject IKucoinOrderBookFactory kucoinFactory @inject IMexcOrderBookFactory mexcFactory @@ -79,6 +81,8 @@ { "CryptoCom", cryptocomFactory.Create("ETH_BTC") }, { "GateIo", gateioFactory.CreateSpot("ETH_BTC") }, { "HTX", htxFactory.CreateSpot("ethbtc") }, + // HyperLiquid does not support the ETH/BTC pair + //{ "HyperLiquid", hyperLiquidFactory.Create("ETH/BTC") }, { "Kraken", krakenFactory.CreateSpot("ETH/BTC") }, { "Kucoin", kucoinFactory.CreateSpot("ETH-BTC") }, { "Mexc", mexcFactory.CreateSpot("ETHBTC") }, diff --git a/Examples/BlazorClient/Pages/Trackers.razor b/Examples/BlazorClient/Pages/Trackers.razor index e309305..c98cdd3 100644 --- a/Examples/BlazorClient/Pages/Trackers.razor +++ b/Examples/BlazorClient/Pages/Trackers.razor @@ -15,6 +15,7 @@ @using CryptoExchange.Net.Trackers.Trades @using GateIo.Net.Interfaces @using HTX.Net.Interfaces +@using HyperLiquid.Net.Interfaces @using Kraken.Net.Interfaces @using Kucoin.Net.Clients @using Kucoin.Net.Interfaces @@ -32,6 +33,7 @@ @inject ICryptoComTrackerFactory cryptocomFactory @inject IGateIoTrackerFactory gateioFactory @inject IHTXTrackerFactory htxFactory +@inject IHyperLiquidTrackerFactory hyperLiquidFactory @inject IKrakenTrackerFactory krakenFactory @inject IKucoinTrackerFactory kucoinFactory @inject IMexcTrackerFactory mexcFactory @@ -59,26 +61,28 @@ protected override async Task OnInitializedAsync() { - var symbol = new SharedSymbol(TradingMode.Spot, "BTC", "USDT"); + var usdtSymbol = new SharedSymbol(TradingMode.Spot, "BTC", "USDT"); _trackers = new List { - { binanceFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { bingXFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { bitfinexFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { bitgetFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { bitmartFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { bybitFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { coinbaseFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { coinExFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { cryptocomFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { gateioFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { htxFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { krakenFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { kucoinFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { mexcFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { okxFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, - { whitebitFactory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5)) }, + { binanceFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { bingXFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { bitfinexFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { bitgetFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { bitmartFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { bybitFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { coinbaseFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { coinExFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { cryptocomFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { gateioFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { htxFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + // HyperLiquid doesn't support spot pair, but does have a futures BTC/USDC pair + { hyperLiquidFactory.CreateTradeTracker(new SharedSymbol(TradingMode.PerpetualLinear, "BTC", "USDC"), period: TimeSpan.FromMinutes(5)) }, + { krakenFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { kucoinFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { mexcFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { okxFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { whitebitFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, }; await Task.WhenAll(_trackers.Select(b => b.StartAsync())); diff --git a/Examples/BlazorClient/Startup.cs b/Examples/BlazorClient/Startup.cs index 9ebf284..1407b18 100644 --- a/Examples/BlazorClient/Startup.cs +++ b/Examples/BlazorClient/Startup.cs @@ -45,6 +45,7 @@ namespace BlazorClient services.AddCoinEx(); services.AddCryptoCom(); services.AddGateIo(); + services.AddHyperLiquid(); services.AddHTX(); services.AddKraken(); services.AddKucoin(); diff --git a/Examples/BlazorClient/_Imports.razor b/Examples/BlazorClient/_Imports.razor index 74ca8f3..06b9b3a 100644 --- a/Examples/BlazorClient/_Imports.razor +++ b/Examples/BlazorClient/_Imports.razor @@ -19,6 +19,7 @@ @using CryptoCom.Net.Interfaces.Clients; @using GateIo.Net.Interfaces.Clients; @using HTX.Net.Interfaces.Clients; +@using HyperLiquid.Net.Interfaces.Clients; @using Kraken.Net.Interfaces.Clients; @using Kucoin.Net.Interfaces.Clients; @using Mexc.Net.Interfaces.Clients; diff --git a/README.md b/README.md index 39e2e3b..d6be1fc 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ The following API's are directly supported. Note that there are 3rd party implem |Crypto.com|[JKorf/CryptoCom.Net](https://github.com/JKorf/CryptoCom.Net)|[![Nuget version](https://img.shields.io/nuget/v/CryptoCom.net.svg?style=flat-square)](https://www.nuget.org/packages/CryptoCom.Net)| |Gate.io|[JKorf/GateIo.Net](https://github.com/JKorf/GateIo.Net)|[![Nuget version](https://img.shields.io/nuget/v/GateIo.net.svg?style=flat-square)](https://www.nuget.org/packages/GateIo.Net)| |HTX|[JKorf/HTX.Net](https://github.com/JKorf/HTX.Net)|[![Nuget version](https://img.shields.io/nuget/v/JKorf.HTX.net.svg?style=flat-square)](https://www.nuget.org/packages/JKorf.HTX.Net)| +|HyperLiquid|[JKorf/HyperLiquid.Net](https://github.com/JKorf/HyperLiquid.Net)|[![Nuget version](https://img.shields.io/nuget/v/HyperLiquid.Net.svg?style=flat-square)](https://www.nuget.org/packages/HyperLiquid.Net)| |Kraken|[JKorf/Kraken.Net](https://github.com/JKorf/Kraken.Net)|[![Nuget version](https://img.shields.io/nuget/v/KrakenExchange.net.svg?style=flat-square)](https://www.nuget.org/packages/KrakenExchange.Net)| |Kucoin|[JKorf/Kucoin.Net](https://github.com/JKorf/Kucoin.Net)|[![Nuget version](https://img.shields.io/nuget/v/Kucoin.net.svg?style=flat-square)](https://www.nuget.org/packages/Kucoin.Net)| |Mexc|[JKorf/Mexc.Net](https://github.com/JKorf/Mexc.Net)|[![Nuget version](https://img.shields.io/nuget/v/JK.Mexc.net.svg?style=flat-square)](https://www.nuget.org/packages/JK.Mexc.Net)| diff --git a/docs/index.html b/docs/index.html index 4f8bf3d..b9aa86c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -158,6 +158,7 @@ Crypto.comJKorf/CryptoCom.Net Gate.ioJKorf/GateIo.Net HTXJKorf/HTX.Net + HyperLiquidJKorf/HyperLiquid.Net KrakenJKorf/Kraken.Net KucoinJKorf/Kucoin.Net MexcJKorf/Mexc.Net @@ -197,13 +198,14 @@ Referral

When creating an account on new exchanges please consider using a referral link from below to support development

- - +
ExchangeLink
+ + @@ -280,6 +282,9 @@ + @@ -345,6 +350,9 @@
dotnet add package JKorf.HTX.Net
+
+
dotnet add package HyperLiquid.Net
+
dotnet add package KrakenExchange.Net
@@ -420,6 +428,9 @@ + @@ -478,6 +489,9 @@
builder.Services.AddHTX();
+
+
+
builder.Services.AddHyperLiquid();
builder.Services.AddKraken();
@@ -542,6 +556,9 @@ + @@ -975,6 +992,39 @@
ExchangeLink
Bybithttps://partner.bybit.com/b/jkorf
Coinbasehttps://advanced.coinbase.com/join/T6H54H8
CoinExhttps://www.coinex.com/register?refer_code=hd6gn
Crypto.comhttps://crypto.com/exch/26ge92xbkn
HTXhttps://www.htx.com/invite/en-us/1f?invite_code=fxp9
HyperLiquidhttps://app.hyperliquid.xyz/join/JKORF
Kucoinhttps://www.kucoin.com/r/rf/QBS4FPED
OKXhttps://okx.com/join/48046699
WhiteBithttps://whitebit.com/referral/a8e59b59-186c-4662-824c-3095248e0edf
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
InterfaceDescription
IHyperLiquidRestClientThe client for accessing the HyperLiquid REST API
IHyperLiquidSocketClientThe client for accessing the HyperLiquid Websocket API
IHyperLiquidOrderBookFactoryA factory for creating SymbolOrderBook instances for the HyperLiquid API
IHyperLiquidTrackerFactoryA factory for creating kline and trade Tracker instances for the HyperLiquid API
ICryptoRestClientAn aggregating client from which multiple different library REST clients can be accessed
ICryptoSocketClientAn aggregating client from which multiple different library Websocket clients can be accessed
ISharedClientVarious interfaces deriving from ISharedClient which can be used for common functionality
+
@@ -1237,6 +1287,9 @@ + @@ -1409,6 +1462,18 @@ if (!tickersResult.Success) // Handle error, tickersResult.Error contains more information } else +{ + // Handle data, tickersResult.Data will contain the actual data +} + +
+
var client = new HyperLiquidRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetExchangeInfoAndTickersAsync();
+if (!tickersResult.Success)
+{
+  // Handle error, tickersResult.Error contains more information
+}
+else
 {
   // Handle data, tickersResult.Data will contain the actual data
 }
@@ -1595,6 +1660,9 @@ else + @@ -1745,6 +1813,17 @@ if (!subscribeResult.Success) { // Handle error, subscribeResult.Error contains more information on why the subscription failed } +// Subscribing was successfull, the data will now be streamed into the data handler +
+
+
var client = new HyperLiquidSocketClient();
+var subscribeResult = await client.SpotApi.SubscribeToSymbolUpdatesAsync("HYPE/USDC", update => {
+  // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+  // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
 // Subscribing was successfull, the data will now be streamed into the data handler
@@ -1999,6 +2078,9 @@ var binanceTriggered = CheckForTrigger(lastBinanceTicker); + @@ -2152,6 +2234,19 @@ var usdFuturesSharedRestClient = htxRestClient.UsdtFuturesApi.SharedClient; // USDT Futures API common functionality socket client var usdFuturesSharedSocketClient = htxSocketClient.UsdtFuturesApi.SharedClient; +
+
+
// Spot API common functionality rest client
+var spotSharedRestClients = hyperliquidRestClient.SpotApi.SharedClient;
+
+// Spot API common functionality socket client
+var spotSharedSocketClient = hyperliquidSocketClient.SpotApi.SharedClient;
+
+// Perpetual Futures API common functionality rest client
+var futuresSharedRestClient = hyperliquidRestClient.FuturesApi.SharedClient;
+
+// Perpetual Futures API common functionality socket client
+var futuresSharedSocketClient = hyperliquidSocketClient.FuturesApi.SharedClient;
// Spot API common functionality rest client
@@ -2485,6 +2580,9 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
 			  
+			  
 			  
@@ -2656,6 +2754,18 @@ builder.Services.AddGateIo(builder.Configuration.GetSection("GateIo"));
+
+
+
builder.Services.AddHyperLiquid(
+  options => {
+    options.Rest.RequestTimeout = TimeSpan.FromSeconds(30);
+    options.Socket.RequestTimeout = TimeSpan.FromSeconds(5);
+  });
+  
+// OR
+  
+// see https://github.com/JKorf/CryptoExchange.Net/tree/master/Examples/example-config.json for an example configuration
+builder.Services.AddHyperLiquid(builder.Configuration.GetSection("HyperLiquid"));
builder.Services.AddKraken(
@@ -2775,6 +2885,9 @@ builder.Services.AddXT(builder.Configuration.GetSection("XT"));
+ @@ -2869,6 +2982,12 @@ builder.Services.AddXT(builder.Configuration.GetSection("XT"));
var client = new HTXRestClient(opts =>
+{
+    opts.RequestTimeout = TimeSpan.FromSeconds(30);
+});
+
+
+
var client = new HyperLiquidRestClient(opts =>
 {
     opts.RequestTimeout = TimeSpan.FromSeconds(30);
 });
@@ -2952,6 +3071,9 @@ builder.Services.AddXT(builder.Configuration.GetSection("XT")); + @@ -3055,6 +3177,13 @@ var client = new GateIoRestClient(); options.RequestTimeout = TimeSpan.FromSeconds(30); }); var client = new HTXRestClient(); +
+
+
HyperLiquidRestClient.SetDefaultOptions(options =>
+{
+    options.RequestTimeout = TimeSpan.FromSeconds(30);
+});
+var client = new HyperLiquidRestClient();
KrakenRestClient.SetDefaultOptions(options =>
@@ -3317,6 +3446,9 @@ var client = new XTRestClient();
+ @@ -3490,6 +3622,19 @@ if (!startResult.Success) } // Book has successfully started and synchronized +// Once no longer needed you can stop the live sync functionality by calling StopAsync() +await book.StopAsync(); + +
+
+
var book = new HyperLiquidSymbolOrderBook("HYPE/USDC");
+var startResult = await book.StartAsync();
+if (!startResult.Success)
+{
+  // Handle error, error info available in startResult.Error
+}
+// Book has successfully started and synchronized
+
 // Once no longer needed you can stop the live sync functionality by calling StopAsync()
 await book.StopAsync();
 
@@ -3726,6 +3871,9 @@ foreach (var book in books.Where(b => b.Status == OrderBookStatus.Synced)) + @@ -3983,6 +4131,26 @@ if (!startResult.Success) // Tracker has successfully started // Note that it might not be fully synced yet, check tracker.Status for this. +// Once no longer needed you can stop the live sync functionality by calling StopAsync() +await tracker.StopAsync(); + +
+
+
// Either create a new factory or inject the IHyperLiquidTrackerFactory interface
+var factory = new HyperLiquidTrackerFactory();
+
+var symbol = new SharedSymbol(TradingMode.Spot, "HYPE", "USDC");
+
+// Create a tracker for HYPE/USDC keeping track of trades in the last 5 minutes
+var tracker = factory.CreateTradeTracker(symbol, period: TimeSpan.FromMinutes(5));
+var startResult = await tracker.StartAsync();
+if (!startResult.Success)
+{
+  // Handle error, error info available in startResult.Error
+}
+// Tracker has successfully started
+// Note that it might not be fully synced yet, check tracker.Status for this.
+
 // Once no longer needed you can stop the live sync functionality by calling StopAsync()
 await tracker.StopAsync();
 
@@ -4441,6 +4609,9 @@ var binanceClient = new BinanceRestClient(new HttpClient(), logFactory, options + @@ -4583,6 +4754,20 @@ var binanceClient = new BinanceRestClient(new HttpClient(), logFactory, options

To be notified of when a rate limit is hit the static HTXExchange.RateLimiter exposes an event which triggers when a rate limit is reached

HTXExchange.RateLimiter.RateLimitTriggered += (rateLimitEvent) => Console.WriteLine("Limit triggered: " + rateLimitEvent);
 
+
+
+
+
services.AddHyperLiquid(x =>
+    x.RatelimiterEnabled = true;
+    x.RateLimitingBehaviour = RateLimitingBehaviour.Wait;
+}, x =>
+{
+    x.RatelimiterEnabled = true;
+    x.RateLimitingBehaviour = RateLimitingBehaviour.Wait;
+});
+

To be notified of when a rate limit is hit the static HyperLiquidExchange.RateLimiter exposes an event which triggers when a rate limit is reached

+
HyperLiquidExchange.RateLimiter.RateLimitTriggered += (rateLimitEvent) => Console.WriteLine("Limit triggered: " + rateLimitEvent);
+
 
@@ -4760,6 +4945,9 @@ var responseSource = result.DataSource; + @@ -4823,6 +5011,9 @@ await exchangeRestClient.GetSpotSymbolsAsync(new GetSymbolsRequest(), ["Binance"
await htxClient.SpotApi.ExchangeData.GetSymbolsAsync();
+
+
+
await hyperLiquidClient.SpotApi.ExchangeData.GetExchangeInfoAsync();
await krakenClient.SpotApi.ExchangeData.GetSymbolsAsync();
@@ -4896,6 +5087,9 @@ await exchangeRestClient.GetSpotSymbolsAsync(new GetSymbolsRequest(), ["Binance" + @@ -4961,6 +5155,11 @@ await coinbaseClient.AdvancedTradeApi.ExchangeData.GetSymbolAsync("BTC-USDT");
await htxClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
+
+
+
// HyperLiquid API doesn't offer a symbol filter, so we have to filter client side
+var tickersResult = await hyperLiquidClient.SpotApi.ExchangeData.GetExchangeInfoAndTickersAsync();
+var ticker = tickersResult.Data.Tickers.Single(x => x.Symbol == "HYPE/USDC");
await krakenClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
@@ -5036,6 +5235,9 @@ var ticker = tickersResult.Data.Single(x => x.Symbol == "BTC_USDT"); HTX + @@ -5103,6 +5305,9 @@ var accounts = await htxClient.SpotApi.Account.GetAccountsAsync(); var account = accounts.Data.Single(a => a.Type == AccountType.Spot); var result = await htxClient.SpotApi.Account.GetBalancesAsync(); +
+
+
await hyperLiquidClient.SpotApi.Account.GetBalancesAsync();
await krakenClient.SpotApi.Account.GetBalancesAsync();
@@ -5176,6 +5381,9 @@ var result = await htxClient.SpotApi.Account.GetBalancesAsync(); + @@ -5241,6 +5449,10 @@ var accounts = await htxClient.SpotApi.Account.GetAccountsAsync(); var account = accounts.Data.Single(a => a.Type == AccountType.Spot); var result = await htxClient.SpotApi.Trading.PlaceOrderAsync(account.Id, "BTCUSDT", OrderSide.Buy, OrderType.Limit, 0.1m, price: 50000); +
+
+
// BTC not support on HyperLiquid Spot trading, example uses HYPE/USDC Pair
+await hyperLiquidClient.SpotApi.Trading.PlaceOrderAsync("HYPE/USDC",OrderSide.Buy, OrderType.Limit, 1m, 20);
await krakenClient.SpotApi.Trading.PlaceOrderAsync("BTCUSDT",OrderSide.Buy, OrderType.Limit, 0.1m, 50000);
@@ -5314,6 +5526,9 @@ var result = await htxClient.SpotApi.Trading.PlaceOrderAsync(account.Id, "BTCUSD + @@ -5400,6 +5615,11 @@ await exchangeSocketClient.SubscribeToTickerUpdatesAsync(new SubscribeTickerRequ
await gateioSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH_USDT", data => {
     // Handle update
+});
+
+
+
await hyperLiquidSocketClient.SpotApi.SubscribeToSymbolUpdatesAsync("HYPE/USDC", data => {
+    // Handle update
 });
@@ -5494,6 +5714,9 @@ await exchangeSocketClient.SubscribeToTickerUpdatesAsync(new SubscribeTickerRequ + @@ -5621,6 +5844,11 @@ _ = Task.Run(async () => {
await htxSocketClient.SpotApi.SubscribeToOrderUpdatesAsync(onOrderMatched: data => {
     // Handle update
+});
+
+
+
await hyperLiquidSocketClient.SpotApi.SubscribeToOrderUpdatesAsync(null, data => {
+    // Handle update
 });
InterfaceDescription