diff --git a/setup-scripts/funds-checker.py b/setup-scripts/funds-checker.py index d7c8fdbc..630298eb 100755 --- a/setup-scripts/funds-checker.py +++ b/setup-scripts/funds-checker.py @@ -62,15 +62,16 @@ async def check_funds(): round(unallocated_funds / sc_precision), round(allocated_funds / sc_precision) ) - # Send an alert if there is less than 1 allowance worth of money left. - if balance < allowance_funds: + # Send an alert if there is less than a certain part of allowance worth of money left in the wallet. + WALLET_ALLOWANCE_THRESHOLD = 0.3 + if balance < allowance_funds * WALLET_ALLOWANCE_THRESHOLD: wallet_address_res = siad.get("/wallet/address") wallet_msg = "Address: {}".format(wallet_address_res["address"]) message = "__Wallet balance running low!__ {} {}".format(balance_msg, wallet_msg) return await send_msg(client, message, force_notify=True) # Alert devs when only a fraction of the allowance is remaining. - SPEND_THRESHOLD = 0.8 + SPEND_THRESHOLD = 0.9 if allocated_funds >= SPEND_THRESHOLD * allowance_funds: message = "__More than {:.0%} of allowance spent!__ {}".format( SPEND_THRESHOLD, alloc_msg