Skip to content

Commit

Permalink
Use List of Tuples, remove unused columns
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Sep 12, 2019
1 parent f8eb1cd commit 6c5eff4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions freqtrade/exchange/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ def get_balances(self) -> dict:
balances.pop("used", None)

orders = self._api.fetch_open_orders()
order_list = [[x["symbol"].split("/")[0 if x["side"] == "sell" else 1],
x["remaining"], x["side"], x["amount"], ] for x in orders]
order_list = [(x["symbol"].split("/")[0 if x["side"] == "sell" else 1],
x["remaining"],
# Don't remove the below comment, this can be important for debuggung
# x["side"], x["amount"],
) for x in orders]
for bal in balances:
balances[bal]['used'] = sum(order[1] for order in order_list if order[0] == bal)
balances[bal]['free'] = balances[bal]['total'] - balances[bal]['used']
Expand Down

0 comments on commit 6c5eff4

Please sign in to comment.