def fetch_balance(self): """資産情報取得""" balance = Dotdict(self.exchange.fetch_balance()) balance.BTC = Dotdict(balance.BTC) self.logger.info( "BALANCE: free {free:.3f} used {used:.3f} total {total:.3f}". format(**balance.BTC)) return balance
def fetch_balance_ws(self): balance = Dotdict(self.ws.funds()) balance.BTC = Dotdict() balance.BTC.free = balance.availableMargin * 0.00000001 balance.BTC.total = balance.marginBalance * 0.00000001 balance.BTC.used = balance.BTC.total - balance.BTC.free self.logger.info( "BALANCE: free {free:.3f} used {used:.3f} total {total:.3f}". format(**balance.BTC)) return balance