alexbosworth / balanceofsatoshis

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

[rebalance] to consider out and in peer liquidity while probing #166

Open BhaagBoseDK opened 2 years ago

BhaagBoseDK commented 2 years ago

bos rebalance —out A —in B —in-target-outbound CAPACITY/2

peer B has 2M (0:2) so rebalance starts with target amount of 1M however peer A only has 400k outbound The initial probe is made with ~490K which fails

ideally the max probe amount should be min(outpeer.outbound_liquidity, inpeer.inbound_liquidity, target-amount). This would avoid failed probes.

Or the rebalance target amount can be min(outpeer.outbound_liquidity, inpeer.inbound_liquidity, target-amount) and it would have the same effect though it can confuse people why a non obvious target is displayed.

BhaagBoseDK commented 2 years ago

how the initial probe amount calculated today by rebalance?