Skip to content

added ExchangeMarket.IsDelistingCandidate #851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions src/ExchangeSharp/API/Exchanges/KuCoin/ExchangeKuCoinAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,33 @@ protected internal override async Task<
> OnGetMarketSymbolsMetadataAsync()
{
List<ExchangeMarket> markets = new List<ExchangeMarket>();
// [{"symbol":"REQ-ETH","quoteMaxSize":"99999999","enableTrading":true,"priceIncrement":"0.0000001","baseMaxSize":"1000000","baseCurrency":"REQ","quoteCurrency":"ETH","market":"ETH","quoteIncrement":"0.0000001","baseMinSize":"1","quoteMinSize":"0.00001","name":"REQ-ETH","baseIncrement":"0.0001"}, ... ]
/* [ {
"symbol": "XWG-USDT",
"name": "XWG-USDT",
"baseCurrency": "XWG",
"quoteCurrency": "USDT",
"feeCurrency": "USDT",
"market": "USDS",
"baseMinSize": "10",
"quoteMinSize": "0.1",
"baseMaxSize": "10000000000",
"quoteMaxSize": "99999999",
"baseIncrement": "0.0001",
"quoteIncrement": "0.0000001",
"priceIncrement": "0.0000001",
"priceLimitRate": "0.1",
"minFunds": "0.1",
"isMarginEnabled": false,
"enableTrading": true,
"st": true,
"callauctionIsEnabled": false,
"callauctionPriceFloor": null,
"callauctionPriceCeiling": null,
"callauctionFirstStageStartTime": null,
"callauctionSecondStageStartTime": null,
"callauctionThirdStageStartTime": null,
"tradingStartTime": 1650531600000
}, ... ] */
JToken marketSymbolTokens = await MakeJsonRequestAsync<JToken>("/symbols");
foreach (JToken marketSymbolToken in marketSymbolTokens)
{
Expand All @@ -187,6 +213,7 @@ protected internal override async Task<
].ConvertInvariant<decimal>(),
PriceStepSize = marketSymbolToken["priceIncrement"].ConvertInvariant<decimal>(),
IsActive = marketSymbolToken["enableTrading"].ConvertInvariant<bool>(),
IsDelistingCandidate = marketSymbolToken["st"].ConvertInvariant<bool>(),
};
markets.Add(market);
}
Expand Down Expand Up @@ -821,7 +848,7 @@ params string[] marketSymbols
var deltaBook = new ExchangeOrderBook
{
IsFromSnapshot = false,
ExchangeName = ExchangeName.Kucoin,
ExchangeName = ExchangeName.KuCoin,
SequenceId = parsedTime,
MarketSymbol = symbol.ToString(),
LastUpdatedUtc = lastUpdatedDateTime,
Expand Down Expand Up @@ -1089,6 +1116,6 @@ private string GetWebsocketBulletToken()

public partial class ExchangeName
{
public const string Kucoin = "KuCoin";
public const string KuCoin = "KuCoin";
}
}
5 changes: 4 additions & 1 deletion src/ExchangeSharp/Model/ExchangeMarket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ public class ExchangeMarket
/// <summary>Second aternate market symbol</summary>
public string AltMarketSymbol2 { get; set; }

/// <summary>A value indicating whether the market is active.</summary>
/// <summary>Whether the market is active.</summary>
public bool? IsActive { get; set; }

/// <summary>Whether the market is about to be delisted. Only KuCoin provides this.</summary>
public bool? IsDelistingCandidate { get; set; }

/// <summary>In a pair like ZRX/BTC, BTC is the quote currency.</summary>
public string QuoteCurrency { get; set; }

Expand Down
Loading