aboutsummaryrefslogtreecommitdiff
path: root/market.py
diff options
context:
space:
mode:
Diffstat (limited to 'market.py')
-rw-r--r--market.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/market.py b/market.py
index ca65bca..d0e6ab4 100644
--- a/market.py
+++ b/market.py
@@ -1,4 +1,4 @@
1from ccxt import ExchangeError, NotSupported, RequestTimeout 1from ccxt import ExchangeError, NotSupported, RequestTimeout, InvalidNonce
2import ccxt_wrapper as ccxt 2import ccxt_wrapper as ccxt
3import time 3import time
4import psycopg2 4import psycopg2
@@ -89,7 +89,7 @@ class Market:
89 finally: 89 finally:
90 self.store_report() 90 self.store_report()
91 91
92 @retry(RequestTimeout, tries=5) 92 @retry((RequestTimeout, InvalidNonce), tries=5)
93 def move_balances(self): 93 def move_balances(self):
94 needed_in_margin = {} 94 needed_in_margin = {}
95 moving_to_margin = {} 95 moving_to_margin = {}
@@ -114,7 +114,7 @@ class Market:
114 self.ccxt.transfer_balance(currency, delta, "exchange", "margin") 114 self.ccxt.transfer_balance(currency, delta, "exchange", "margin")
115 elif delta < 0: 115 elif delta < 0:
116 self.ccxt.transfer_balance(currency, -delta, "margin", "exchange") 116 self.ccxt.transfer_balance(currency, -delta, "margin", "exchange")
117 except RequestTimeout as e: 117 except (RequestTimeout, InvalidNonce) as e:
118 self.report.log_error(action, message="Retrying", exception=e) 118 self.report.log_error(action, message="Retrying", exception=e)
119 self.report.log_move_balances(needed_in_margin, moving_to_margin) 119 self.report.log_move_balances(needed_in_margin, moving_to_margin)
120 self.balances.fetch_balances() 120 self.balances.fetch_balances()