Interface | Description |
@@ -1237,6 +1287,9 @@
HTX
+
+ HyperLiquid
+
Kraken
@@ -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
HTX
+
+ HyperLiquid
+
Kraken
@@ -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);
HTX
+
+ HyperLiquid
+
Kraken
@@ -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
HTX
+
+ HyperLiquid
+
Kraken
@@ -2656,6 +2754,18 @@ builder.Services.AddGateIo(builder.Configuration.GetSection("GateIo"));
// see https://github.com/JKorf/CryptoExchange.Net/tree/master/Examples/example-config.json for an example configuration
builder.Services.AddHTX(builder.Configuration.GetSection("HTX"));
+
+
+
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"));
HTX
+
+ HyperLiquid
+
Kraken
@@ -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"));
HTX
+
+ HyperLiquid
+
Kraken
@@ -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();
HTX
+
+ HyperLiquid
+
Kraken
@@ -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))
HTX
+
+ HyperLiquid
+
Kraken
@@ -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
HTX
+
+ HyperLiquid
+
Kraken
@@ -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;
HTX
+
+ HyperLiquid
+
Kraken
@@ -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"
HTX
+
+ HyperLiquid
+
Kraken
@@ -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
+
+ HyperLiquid
+
Kraken
@@ -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();
HTX
+
+ HyperLiquid
+
Kraken
@@ -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
HTX
+
+ HyperLiquid
+
Kraken
@@ -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
HTX
+
+ HyperLiquid
+
Kraken
@@ -5621,6 +5844,11 @@ _ = Task.Run(async () => {
await htxSocketClient.SpotApi.SubscribeToOrderUpdatesAsync(onOrderMatched: data => {
// Handle update
+});
+
+
+
await hyperLiquidSocketClient.SpotApi.SubscribeToOrderUpdatesAsync(null, data => {
+ // Handle update
});