示例#1
0
 def decrease_asset(self, asset: Asset, amount: FVal) -> None:
     binance_symbol = asset.to_binance()
     assert binance_symbol in self.balances_dict, 'Asset should exist in funds'
     msg = 'We should have enough funds to decrease asset'
     assert amount <= self.balances_dict[binance_symbol], msg
     self.balances_dict[binance_symbol] -= amount
示例#2
0
 def increase_asset(self, asset: Asset, amount: FVal) -> None:
     binance_symbol = asset.to_binance()
     if binance_symbol not in self.balances_dict:
         self.balances_dict[binance_symbol] = amount
     else:
         self.balances_dict[binance_symbol] += amount