X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git;a=blobdiff_plain;f=store.py;h=32c41211050c83d97c554e84ae29d188c457f3e0;hp=2a71bed1e55c0cd9c7e1e417f05d6c7cd24d2350;hb=3a15ffc79ea84e5ec6200545bcbf11fc6c1c6564;hpb=af928d32483535a817b62a68f2dcb215f48ed29c diff --git a/store.py b/store.py index 2a71bed..32c4121 100644 --- a/store.py +++ b/store.py @@ -305,7 +305,7 @@ class BalanceStore: return amounts def fetch_balances(self, tag=None, add_portfolio=False, - checkpoint=None, log_tickers=False, + checkpoint=None, log_tickers=False, add_usdt=False, ticker_currency="BTC", ticker_compute_value="average", ticker_type="total"): all_balances = self.market.ccxt.fetch_all_balances() for currency, balance in all_balances.items(): @@ -315,6 +315,8 @@ class BalanceStore: if add_portfolio: for currency in Portfolio.repartition(from_cache=True): self.all.setdefault(currency, portfolio.Balance(currency, {})) + if add_usdt: + self.all.setdefault("USDT", portfolio.Balance("USDT", {})) if log_tickers: tickers = self.in_currency(ticker_currency, compute_value=ticker_compute_value, type=ticker_type) self.market.report.log_balances(tag=tag, checkpoint=checkpoint,