Add envvars for target_conf

This commit is contained in:
Reckless_Satoshi 2023-03-18 03:39:37 -07:00
parent 9158bd4c98
commit 7fdbebb2aa
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 9 additions and 3 deletions

View File

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

View File

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