diff --git a/src/ExchangeSharp/API/Exchanges/Poloniex/ExchangePoloniexAPI.cs b/src/ExchangeSharp/API/Exchanges/Poloniex/ExchangePoloniexAPI.cs index 0d080b5a..3327778b 100644 --- a/src/ExchangeSharp/API/Exchanges/Poloniex/ExchangePoloniexAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/Poloniex/ExchangePoloniexAPI.cs @@ -33,6 +33,7 @@ private ExchangePoloniexAPI() RequestContentType = "application/json"; MarketSymbolSeparator = "_"; WebSocketOrderBookType = WebSocketOrderBookType.DeltasOnly; + RateLimit = new RateGate(10, TimeSpan.FromSeconds(1)); } /// @@ -78,9 +79,8 @@ protected override Task OnInitializeAsync() fieldCount[split[0]] = split[1].ConvertInvariant(); } } - WithdrawalFieldCount = fieldCount; - ExchangeGlobalCurrencyReplacements["STR"] = "XLM"; // wtf + return Task.CompletedTask; } diff --git a/src/ExchangeSharp/Utility/CryptoUtility.cs b/src/ExchangeSharp/Utility/CryptoUtility.cs index 8b3bedd7..bad0a4c7 100644 --- a/src/ExchangeSharp/Utility/CryptoUtility.cs +++ b/src/ExchangeSharp/Utility/CryptoUtility.cs @@ -1412,14 +1412,12 @@ public static decimal CalculatePrecision(string numberWithDecimals) /// public static decimal PrecisionToStepSize(decimal precision) { + if (precision == 0) return 1; + var sb = new StringBuilder(); sb.Append("0"); if (precision > 0) sb.Append("."); - if (precision == 1) - { - sb.Append("1"); - return decimal.Parse(sb.ToStringInvariant()); - } + for (var i = 0; i < precision; i++) { sb.Append(i + 1 == precision ? "1" : "0");