mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-11 16:32:57 +00:00
Updated examples and docs with HyperLiquid references
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user