edeng23 / binance-trade-bot

Automated cryptocurrency trading bot
GNU General Public License v3.0
7.9k stars 2.19k forks source link

Error while scouting... (there are no details, error code displayed) #433

Open kennethoaguilar opened 2 years ago

kennethoaguilar commented 2 years ago

2021-10-16 19:28:48,381 - crypto_trading_logger - ERROR - Error while scouting... Traceback (most recent call last): File "/app/binance_trade_bot/scheduler.py", line 25, in _run_job super()._run_job(job) File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 172, in _run_job ret = job.run() File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 661, in run ret = self.job_func() File "/app/binance_trade_bot/strategies/default_strategy.py", line 32, in scout self._jump_to_best_coin(current_coin, current_coin_price) File "/app/binance_trade_bot/auto_trader.py", line 139, in _jump_to_best_coin ratio_dict = self._get_ratios(coin, coin_price) File "/app/binance_trade_bot/auto_trader.py", line 126, in _get_ratios transaction_fee = self.manager.get_fee(pair.from_coin, self.config.BRIDGE, True) + self.manager.get_fee( File "/app/binance_trade_bot/binance_api_manager.py", line 50, in get_fee base_fee = self.get_trade_fees()[origin_coin + target_coin] File "/usr/local/lib/python3.8/site-packages/cachetools/decorators.py", line 26, in wrapper v = func(*args, kwargs) File "/app/binance_trade_bot/binance_api_manager.py", line 43, in get_trade_fees return {ticker["symbol"]: float(ticker["takerCommission"]) for ticker in self.binance_client.get_trade_fee()} File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 2411, in get_trade_fee return self._request_margin_api('get', 'asset/tradeFee', True, data=params) File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 364, in _request_margin_api return self._request(method, uri, signed, kwargs) File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 315, in _request return self._handle_response(self.response) File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 324, in _handle_response raise BinanceAPIException(response, response.status_code, response.text) File "/usr/local/lib/python3.8/site-packages/binance/exceptions.py", line 14, in init self.code = json_res['code'] KeyError: 'code'

wangrui6 commented 2 years ago

is there any update on this ticket? Got exactly the same error.

kennethoaguilar commented 2 years ago

is there any update on this ticket? Got exactly the same error.

For some reason when it’s calculating the fee automatically this error occurs. I just changed the fee from “auto” to the fee that corresponds to me and it fixed the issue.

ghostnetrn commented 2 years ago

Where did you change?

kennethoaguilar commented 2 years ago

Where did you change?

Under “get_trade_fee” function in the binance_api_manager.py file I added

return float(0.001)

in the beginning of the function. if you’re using BNB then 0.00075.