From 17ec43eba09839b5d8e669fd3249f8506bd1b5d5 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 15 Feb 2022 22:28:14 +0000 Subject: [PATCH] Disable automatic withdrawals --- handler/agora.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/handler/agora.py b/handler/agora.py index 25f312e..3c569d9 100644 --- a/handler/agora.py +++ b/handler/agora.py @@ -685,10 +685,12 @@ class Agora(object): rtrn = self.agora._api_call(api_method=f"contact_release/{contact_id}", http_method="POST", query_values=payload) # Check if we can withdraw funds - self.withdraw_funds() + # TODO: write test for withdraw_funds before re-enabling + # self.withdraw_funds() return rtrn + # TODO: write test before re-enabling adding total_trades @handle_exceptions def withdraw_funds(self): """ @@ -705,12 +707,14 @@ class Agora(object): # Get the wallet balances in USD total_usd = totals_all[0][1] print("total_usd", total_usd) + total_trades_usd = self.tx.get_open_trades_usd() - print("total_trades_usd", total_trades_usd) + print("UNUSED total_trades_usd", total_trades_usd) if not total_usd: return False - total_usd += total_trades_usd - print("total_usd after trades add", total_usd) + # total_usd += total_trades_usd + # print("total_usd after trades add", total_usd) + profit_usd = total_usd - float(settings.Money.BaseUSD) print("profit_usd", profit_usd) # Get the XMR -> USD exchange rate