From dbd39abaf1d95a53fa937c79d4e1e49f20d93788 Mon Sep 17 00:00:00 2001 From: Mike van Rossum Date: Tue, 24 Jul 2018 09:47:11 +0800 Subject: [PATCH] only try to set fee when live trading, see #2358 --- exchange/wrappers/binance.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/exchange/wrappers/binance.js b/exchange/wrappers/binance.js index 6420059c0..17c78f88d 100644 --- a/exchange/wrappers/binance.js +++ b/exchange/wrappers/binance.js @@ -36,19 +36,21 @@ const Trader = function(config) { handleDrift: true, }); - // Note non standard func: - // - // On binance we might pay fees in BNB - // if we do we CANNOT calculate feePercent - // since we don't track BNB price (when we - // are not trading on a BNB market). - // - // Though we can deduce feePercent based - // on user fee tracked through `this.getFee`. - // Set default here, overwrite in getFee. - this.fee = 0.1; - // Set the proper fee asap. - this.getFee(_.noop); + if(config.key && config.secret) { + // Note non standard func: + // + // On binance we might pay fees in BNB + // if we do we CANNOT calculate feePercent + // since we don't track BNB price (when we + // are not trading on a BNB market). + // + // Though we can deduce feePercent based + // on user fee tracked through `this.getFee`. + // Set default here, overwrite in getFee. + this.fee = 0.1; + // Set the proper fee asap. + this.getFee(_.noop); + } }; const recoverableErrors = [