DOCS: improve boltz fee information (#1386)

* improve fee information an docs

* review @michael1011

Co-authored-by: ben <ben@arc.wales>
This commit is contained in:
dni ⚡ 2023-01-23 10:16:27 +01:00 committed by GitHub
parent ffb5a91f67
commit b13588dcef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 14 deletions

View file

@ -5,11 +5,12 @@ move **IN** and **OUT** of the **lightning network** and remain in control of yo
* [Documentation](https://docs.boltz.exchange/en/latest/)
* [Discord](https://discord.gg/d6EK85KK)
* [Twitter](https://twitter.com/Boltzhq)
* [FAQ](https://www.notion.so/Frequently-Asked-Questions-585328ae43944e2eba351050790d5eec) very cool!
# usage
This extension lets you create swaps, reverse swaps and in the case of failure refund your onchain funds.
## create normal swap
## create normal swap (Onchain -> Lightning)
1. click on "Swap (IN)" button to open following dialog, select a wallet, choose a proper amount in the min-max range and choose a onchain address to do your refund to if the swap fails after you already commited onchain funds.
---
![create swap](https://imgur.com/OyOh3Nm.png)
@ -22,14 +23,14 @@ This extension lets you create swaps, reverse swaps and in the case of failure r
if anything goes wrong when boltz is trying to pay your invoice, the swap will fail and you will need to refund your onchain funds after the timeout block height hit. (if boltz can pay the invoice, it wont be able to redeem your onchain funds either).
## create reverse swap
## create reverse swap (Lightning -> Onchain)
1. click on "Swap (OUT)" button to open following dialog, select a wallet, choose a proper amount in the min-max range and choose a onchain address to receive your funds to. Instant settlement: means that LNbits will create the onchain claim transaction if it sees the boltz lockup transaction in the mempool, but it is not confirmed yet. it is advised to leave this checked because it is faster and the longer is takes to settle, the higher the chances are that the lightning invoice expires and the swap fails.
---
![reverse swap](https://imgur.com/UEAPpbs.png)
---
if this swap fails, boltz is doing the onchain refunding, because they have to commit onchain funds.
# refund locked onchain funds from a normal swap
# refund locked onchain funds from a normal swap (Onchain -> Lightning)
if for some reason the normal swap fails and you already paid onchain, you can easily refund your btc.
this can happen if boltz is not able to pay your lightning invoice after you locked up your funds.
in case that happens, there is a info icon in the Swap (In) List which opens following dialog.
@ -37,4 +38,5 @@ in case that happens, there is a info icon in the Swap (In) List which opens fol
![refund](https://imgur.com/pN81ltf.png)
----
if the timeout block height is exceeded you can either press refund and lnbits will do the refunding to the address you specified when creating the swap. Or download the refundfile so you can manually refund your onchain directly on the boltz.exchange website.
if you think there is something wrong and/or you are unsure, you can ask for help either in LNbits telegram or in Boltz [Discord](https://discord.gg/d6EK85KK)
if you think there is something wrong and/or you are unsure, you can ask for help either in LNbits telegram or in Boltz [Discord](https://discord.gg/d6EK85KK).
In a recent update we made *automated check*, every 15 minutes, to check if LNbits can refund your failed swap.

View file

@ -15,7 +15,6 @@ from .models import (
ReverseSubmarineSwap,
SubmarineSwap,
)
from .utils import create_boltz_client, execute_reverse_swap
async def get_submarine_swaps(wallet_ids: Union[str, List[str]]) -> List[SubmarineSwap]:

View file

@ -6,30 +6,88 @@
style="padding: 5px 9px"
alt=""
/>
<p><b>NON CUSTODIAL atomic swap service</b></p>
<h5 class="text-subtitle1 q-my-none">
Boltz.exchange: Do onchain to offchain and vice-versa swaps
Providing trustless and account-free swap services since 2018. Move IN and
OUT of the lightning network and remain in control of your bitcoin, at all
time.
</h5>
<p>
Submarine and Reverse Submarine Swaps on LNbits via boltz.exchange API<br />
</p>
<p>
Link :
Link:
<a target="_blank" href="https://boltz.exchange"
>https://boltz.exchange
</a>
</p>
<p>
<br />
README:
<a
target="_blank"
href="https://github.com/lnbits/lnbits-legend/tree/main/lnbits/extensions/boltz"
>More details</a
>read more</a
>
</p>
<p>
<small
>Created by,
>Extension created by,
<a target="_blank" href="https://github.com/dni">dni</a></small
>
</p>
</q-card-section>
</q-card>
<q-card>
<q-card-section>
<h3 class="text-subtitle1 q-my-none">
<b>Fee Information</b>
</h3>
<span>
Every swap consists of 2 onchain transactions, lockup and claim / refund,
routing fees and a Boltz fee of <b>0.5%</b>.
</span>
</q-card-section>
<q-expansion-item
group="extras"
icon="swap_vertical_circle"
label="Fee example: Lightning -> Onchain"
:content-inset-level="0.5"
>
<q-card-section>
You want to swap out 100.000 sats, Lightning to Onchain:
<ul style="padding-left: 12px">
<li>Onchain lockup tx fee: ~500 sats</li>
<li>Onchain claim tx fee: 1000 sats (hardcoded)</li>
<li>Routing fees (paid by you): unknown</li>
<li>Boltz fees: 500 sats</li>
<li>Fees total: 2000 sats + routing fees</li>
<li>You receive: 98.000 sats</li>
</ul>
<p>
onchain_amount_received = amount - (amount * boltz_fee / 100) -
lockup_fee - claim_fee
</p>
<p>98.000 = 100.000 - 500 - 500 - 1000</p>
</q-card-section>
</q-expansion-item>
<q-expansion-item
group="extras"
icon="swap_vertical_circle"
label="Fee example: Onchain -> Lightning"
:content-inset-level="0.5"
>
<q-card-section>
You want to swap in 100.000 sats, Onchain to Lightning:
<ul style="padding-left: 12px">
<li>Onchain lockup tx fee: whatever you choose when paying</li>
<li>Onchain claim tx fee: ~500 sats</li>
<li>Routing fees (paid by boltz): unknown</li>
<li>Boltz fees: 500 sats (0.5%)</li>
<li>Fees total: 1000 sats + lockup_fee</li>
<li>You pay onchain: 101.000 sats + lockup_fee</li>
<li>You receive lightning: 100.000 sats</li>
</ul>
<p>
onchain_payment + lockup_fee = amount + (amount * boltz_fee / 100) +
claim_fee + lockup_fee
</p>
<p>101.000 + lockup_fee = 100.000 + 500 + 500 + lockup_fee</p>
</q-card-section>
</q-expansion-item>
</q-card>