SatoshiPortal / boltz-rust

Boltz client rust crate
https://docs.boltz.exchange
30 stars 19 forks source link

`check_limits_within`: clarify meaning of amount arg #69

Open ok300 opened 3 months ago

ok300 commented 3 months ago

Before, limits.within() and check_limits_within() checked if the output_amount was within the limits min / max.

However, interacting with the Boltz Web UI shows that the limits validation actually applies to the input amount, i.e. the amount that will be swapped.

This PR renames the output_amount to swap_amount for clarity.

ok300 commented 3 months ago

I checked all swap types in the Boltz UI and it's a bit more complicated:

Swap Type Checked to fit within pair limits Notes
LN -> BTC input invoice amount
BTC -> LN output invoice amount
LN -> LBTC input invoice amount
LBTC -> LN output invoice amount
BTC <-> LBTC input

I'll mark this as a draft until I figure out a simple way to cover all these cases.

i5hi commented 2 months ago

Hey @ok300 Please setup commit signing.