X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=market.py;h=9550b7706aa7194a6e09ab174ea0420206fd7832;hb=d3fec88cb0d301120b137692900d96bf475d2745;hp=b521ea922b004bfedff4e7f82fe04671b571226c;hpb=af928d32483535a817b62a68f2dcb215f48ed29c;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git diff --git a/market.py b/market.py index b521ea9..9550b77 100644 --- a/market.py +++ b/market.py @@ -1,4 +1,4 @@ -from ccxt import ExchangeError, NotSupported, RequestTimeout, InvalidNonce +from ccxt import AuthenticationError, ExchangeError, NotSupported, RequestTimeout, InvalidNonce import ccxt_wrapper as ccxt import time import dbs @@ -88,6 +88,7 @@ class Market: def process(self, actions, before=False, after=False): try: + self.ccxt.check_required_credentials() for action in actions: if bool(before) is bool(after): self.processor.process(action, steps="all") @@ -95,6 +96,8 @@ class Market: self.processor.process(action, steps="before") elif after: self.processor.process(action, steps="after") + except AuthenticationError: + self.report.log_error("market_authentication", message="Impossible to authenticate to market") except Exception as e: import traceback self.report.log_error("market_process", exception=e, message=traceback.format_exc()) @@ -257,7 +260,11 @@ class Processor: { "name": "print_balances", "number": 1, - "fetch_balances_begin": { "log_tickers": True, "add_portfolio": True }, + "fetch_balances_begin": { + "log_tickers": True, + "add_usdt": True, + "add_portfolio": True + }, "print_tickers": { "base_currency": "BTC" }, } ], @@ -288,6 +295,7 @@ class Processor: "fetch_balances_begin": { "checkpoint": "end", "log_tickers": True, + "add_usdt": True, "add_portfolio": True }, }, @@ -319,6 +327,7 @@ class Processor: "fetch_balances_begin": {}, "fetch_balances_end": { "checkpoint": "begin", + "add_usdt": True, "log_tickers": True }, "prepare_trades": { "only": "acquire", "available_balance_only": True }, @@ -338,6 +347,7 @@ class Processor: "fetch_balances_begin": { "checkpoint": "end", "log_tickers": True, + "add_usdt": True, "add_portfolio": True }, "fetch_balances_end": {}, @@ -362,6 +372,7 @@ class Processor: "fetch_balances_begin": {}, "fetch_balances_end": { "checkpoint": "begin", + "add_usdt": True, "log_tickers": True }, "prepare_trades": { "available_balance_only": True },