From 7fdbebb2aad8ac6b61b86108486008c681b6e36f Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sat, 18 Mar 2023 03:39:37 -0700 Subject: [PATCH] Add envvars for target_conf --- .env-sample | 6 +++++- api/logics.py | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.env-sample b/.env-sample index 67cab08e..b20f0ac7 100644 --- a/.env-sample +++ b/.env-sample @@ -134,10 +134,14 @@ MIN_SWAP_POINT = 0.35 MAX_SWAP_FEE = 0.1 # Liquidity split point (LN/onchain) at which we use MAX_SWAP_FEE MAX_SWAP_POINT = 0 -# Min amount allowed for Swap +# Min and Max amount allowed for Swap MIN_SWAP_AMOUNT = 10000 +MAX_SWAP_AMOUNT = 1000000 # Spend Unconfirmed UTXOS (more capital efficient, more risky) SPEND_UNCONFIRMED = False +# Mining fee confirmation target +SUGGESTED_TARGET_CONF = 4 +MINIMUM_TARGET_CONF = 24 # Reward tip. Reward for every finished trade in the referral program (Satoshis) REWARD_TIP = 100 diff --git a/api/logics.py b/api/logics.py index c54f30ee..ffa270fd 100644 --- a/api/logics.py +++ b/api/logics.py @@ -567,7 +567,8 @@ class Logics: return False suggested_mining_fee_rate = LNNode.estimate_fee( - amount_sats=preliminary_amount, target_conf=2 + amount_sats=preliminary_amount, + target_conf=config("SUGGESTED_TARGET_CONF", cast=int, default=2), )["mining_fee_rate"] # Hardcap mining fee suggested at 100 sats/vbyte @@ -698,7 +699,8 @@ class Logics: if mining_fee_rate: # not a valid mining fee min_mining_fee_rate = LNNode.estimate_fee( - amount_sats=num_satoshis, target_conf=12 + amount_sats=num_satoshis, + target_conf=config("MINIMUM_TARGET_CONF", cast=int, default=24), )["mining_fee_rate"] min_mining_fee_rate = max(2, min_mining_fee_rate)