|
|
|
@ -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
|
|
|
|
|