Skip to content

[feature request] sanity checks for premium rates #394

@xmrk-btc

Description

@xmrk-btc

Please add some sanity checks to disallow setting premium rates which are not in node operator's interest.

  1. Check that SWAP_IN rate is negative or zero, and that SWAP_OUT rate is positive or zero. I saw one my peer doing exactly the opposite, his SWAP_OUT rate is negative, so he is paying people to "steal" his inbound liquidity. (Or maybe I am misinterpreting, but then my rates are wrong and sanity check would help me.)
  2. Check that BTC_SWAP_IN_rate + BTC_SWAP_OUT_rate > 0 , likewise for LBTC. This is to prevent peers from profiting by doing SWAP_OUT and then SWAP_IN of same amount. Possible inconvenience here is that if I have to first increase SWAP_OUT rate and then decrease SWAP_IN rate, doing it in reverse order could be disallowed by sanity check. So include such hint about the order of operations in the error message.
  3. Maybe check that BTC_SWAP_IN_rate + LBTC_SWAP_OUT_rate > boltz_rate_for_lbtc_pegout. This is to prevent peers from doing LBTC swap-out, peg-out at boltz, and doing swap-in with obtained BTC. Maybe just use constant like 1000 ppm for boltz_rate_for_lbtc_pegout.
  4. Maybe check that LBTC_SWAP_IN_rate + BTC_SWAP_OUT_rate > 0. Prevents peers from doing BTC swap-out, peg-in those BTC (which is free, hence 0), and then LBTC swap-in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions