diff --git a/lnbits/extensions/boltz/templates/boltz/_api_docs.html b/lnbits/extensions/boltz/templates/boltz/_api_docs.html index f8474c57..f1be62a7 100644 --- a/lnbits/extensions/boltz/templates/boltz/_api_docs.html +++ b/lnbits/extensions/boltz/templates/boltz/_api_docs.html @@ -39,8 +39,9 @@ Fee Information - Every swap consists of 2 onchain transactions, lockup and claim / refund, - routing fees and a Boltz fee of 0.5%. + {% raw %} Every swap consists of 2 onchain transactions, lockup and claim + / refund, routing fees and a Boltz fee of + {{ boltzConfig.fee_percentage }}%. {% endraw %} - You want to swap out 100.000 sats, Lightning to Onchain: + {% raw %} You want to swap out {{ boltzExample.amount }} sats, Lightning + to Onchain:

onchain_amount_received = amount - (amount * boltz_fee / 100) - lockup_fee - claim_fee

-

98.000 = 100.000 - 500 - 500 - 1000

+ {% endraw %}
- You want to swap in 100.000 sats, Onchain to Lightning: + {% raw %} You want to swap in {{ boltzExample.amount }} sats, Onchain to + Lightning: -

- onchain_payment + lockup_fee = amount + (amount * boltz_fee / 100) + - claim_fee + lockup_fee -

-

101.000 + lockup_fee = 100.000 + 500 + 500 + lockup_fee

+

onchain_payment = amount + (amount * boltz_fee / 100) + claim_fee

+ {% endraw %}
diff --git a/lnbits/extensions/boltz/templates/boltz/index.html b/lnbits/extensions/boltz/templates/boltz/index.html index 308c3a46..d985a01f 100644 --- a/lnbits/extensions/boltz/templates/boltz/index.html +++ b/lnbits/extensions/boltz/templates/boltz/index.html @@ -249,6 +249,26 @@ } } }, + computed: { + boltzExample() { + let amount = 100000 + let onchain_lnbits = 1000 + let onchain_boltz = 500 + let boltz_fee = (amount * this.boltzConfig.fee_percentage) / 100 + let normal_fee_total = onchain_boltz + boltz_fee + let reverse_fee_total = onchain_boltz + boltz_fee + onchain_lnbits + return { + amount: amount, + boltz_fee: boltz_fee, + reverse_fee_total: reverse_fee_total, + reverse_receive: amount - reverse_fee_total, + onchain_lnbits: onchain_lnbits, + onchain_boltz: onchain_boltz, + normal_fee_total: normal_fee_total, + normal_expected_amount: amount + normal_fee_total + } + } + }, methods: { getLimits() { if (this.boltzConfig) { diff --git a/lnbits/extensions/boltz/views_api.py b/lnbits/extensions/boltz/views_api.py index ab32fac9..72f66420 100644 --- a/lnbits/extensions/boltz/views_api.py +++ b/lnbits/extensions/boltz/views_api.py @@ -325,4 +325,8 @@ async def api_swap_status(swap_id: str): ) async def api_boltz_config(): client = create_boltz_client() - return {"minimal": client.limit_minimal, "maximal": client.limit_maximal} + return { + "minimal": client.limit_minimal, + "maximal": client.limit_maximal, + "fee_percentage": client.fee_percentage, + }