alexbosworth / balanceofsatoshis

Tool for working with the balance of your satoshis on LND
MIT License
566 stars 79 forks source link

UnrecognizedVariableOrFunctionInSpecifiedAmount using simple formula #545

Closed dskvr closed 1 year ago

dskvr commented 1 year ago
abc@xyz:~/balanceofsatoshis $ bos --version
15.8.14
abc@xyz:~/balanceofsatoshis $ bos rebalance --max-fee-rate 800 --max-fee 500 --minutes 8 --amount "capacity/2"

err:
  - 400
  - UnrecognizedVariableOrFunctionInSpecifiedAmount

Note: I would generally run this by either explicitly setting --in and/or --out or using --in-filters and/or --out-filters but have omitted these details while attempting to figure this out since I get this error regardless of inclusion of the aforementioned args

Another note: I have tried all possible variations: --amount "capacity/2", --amount capacity/2, --amount "CAPACITY/2",--amount CAPACITY/2 as well as using = for all the above combinations: --amount=... to rule out argument formatting issues

From README.md

rebalance
Rebalance defines additional variables for --amount:

capacity: The total of inbound and outbound

From bos rebalance -h

Specifying target liquidity you can use CAPACITY/2, other formulas

Two questions:

  1. What am I missing here? Seems like a strait forward formula, target rebalance amount to capacity of channel divided by 2
  2. Which is it, CAPACITY or capacity or is it case insensitive?

I am also having issues with --in-filter and --out-filter as they are always returning NoPeerMatchesFoundToSatisfyOutboundFilter or NoPeerMatchesFoundToSatisfyInboundFilter, despite knowing 100% that there should be peers that satisfy the filters. I assume this is due to me missing something about formulas, or misunderstanding their purpose entirely.

alexbosworth commented 1 year ago

capacity is only a valid variable in the target flags, not amount flag

alexbosworth commented 1 year ago

filters are only supported against tags atm

dskvr commented 1 year ago

@alexbosworth Thanks for your response!

I was confused because the README seems to imply it is available for the --amount flag, and I've noticed that --amount seems to behave as a target, not fixed. More to learn I suppose :)

rebalance
Rebalance defines additional variables for --amount:

capacity: The total of inbound and outbound

Thanks for clarifying filter limitations!!!!

alexbosworth commented 1 year ago

yeah ideally it would allow for specifying capacity in amount and filters would apply to all nodes, it's just not implemented yet

capacity would need a new variable name though because which side capacity are you talking about

dskvr commented 1 year ago

capacity would need a new variable name though because which side capacity are you talking about

Yeah, makes sense.

dskvr commented 1 year ago

As a sidenote, why not just apply tag "all" by default to every node on first run, and then logical changes would be minimal

alexbosworth commented 1 year ago

i think it's probably simpler to just make it work against all nodes rather than adjust tags on run, but work on that hasn't been completed