Skip to content

Commit 19e4db4

Browse files
authored
added ExchangeMarket.IsDelistingCandidate (#851)
- nullable `bool` as most exchanges dont provide this info - added parsing for KuCoin - renamed KuCoin variable name
1 parent efc82c2 commit 19e4db4

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

src/ExchangeSharp/API/Exchanges/KuCoin/ExchangeKuCoinAPI.cs

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,33 @@ protected internal override async Task<
165165
> OnGetMarketSymbolsMetadataAsync()
166166
{
167167
List<ExchangeMarket> markets = new List<ExchangeMarket>();
168-
// [{"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"}, ... ]
168+
/* [ {
169+
"symbol": "XWG-USDT",
170+
"name": "XWG-USDT",
171+
"baseCurrency": "XWG",
172+
"quoteCurrency": "USDT",
173+
"feeCurrency": "USDT",
174+
"market": "USDS",
175+
"baseMinSize": "10",
176+
"quoteMinSize": "0.1",
177+
"baseMaxSize": "10000000000",
178+
"quoteMaxSize": "99999999",
179+
"baseIncrement": "0.0001",
180+
"quoteIncrement": "0.0000001",
181+
"priceIncrement": "0.0000001",
182+
"priceLimitRate": "0.1",
183+
"minFunds": "0.1",
184+
"isMarginEnabled": false,
185+
"enableTrading": true,
186+
"st": true,
187+
"callauctionIsEnabled": false,
188+
"callauctionPriceFloor": null,
189+
"callauctionPriceCeiling": null,
190+
"callauctionFirstStageStartTime": null,
191+
"callauctionSecondStageStartTime": null,
192+
"callauctionThirdStageStartTime": null,
193+
"tradingStartTime": 1650531600000
194+
}, ... ] */
169195
JToken marketSymbolTokens = await MakeJsonRequestAsync<JToken>("/symbols");
170196
foreach (JToken marketSymbolToken in marketSymbolTokens)
171197
{
@@ -187,6 +213,7 @@ protected internal override async Task<
187213
].ConvertInvariant<decimal>(),
188214
PriceStepSize = marketSymbolToken["priceIncrement"].ConvertInvariant<decimal>(),
189215
IsActive = marketSymbolToken["enableTrading"].ConvertInvariant<bool>(),
216+
IsDelistingCandidate = marketSymbolToken["st"].ConvertInvariant<bool>(),
190217
};
191218
markets.Add(market);
192219
}
@@ -821,7 +848,7 @@ params string[] marketSymbols
821848
var deltaBook = new ExchangeOrderBook
822849
{
823850
IsFromSnapshot = false,
824-
ExchangeName = ExchangeName.Kucoin,
851+
ExchangeName = ExchangeName.KuCoin,
825852
SequenceId = parsedTime,
826853
MarketSymbol = symbol.ToString(),
827854
LastUpdatedUtc = lastUpdatedDateTime,
@@ -1089,6 +1116,6 @@ private string GetWebsocketBulletToken()
10891116

10901117
public partial class ExchangeName
10911118
{
1092-
public const string Kucoin = "KuCoin";
1119+
public const string KuCoin = "KuCoin";
10931120
}
10941121
}

src/ExchangeSharp/Model/ExchangeMarket.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ public class ExchangeMarket
2727
/// <summary>Second aternate market symbol</summary>
2828
public string AltMarketSymbol2 { get; set; }
2929

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

33+
/// <summary>Whether the market is about to be delisted. Only KuCoin provides this.</summary>
34+
public bool? IsDelistingCandidate { get; set; }
35+
3336
/// <summary>In a pair like ZRX/BTC, BTC is the quote currency.</summary>
3437
public string QuoteCurrency { get; set; }
3538

0 commit comments

Comments
 (0)