feat(loop): add multi-channel outgoing support for Loop Out - #54
Merged
Merged
Conversation
- Support comma-separated channel lists (--channel id1,id2...) natively supported by loopd/litloop out. - Enable liquidity pooling across up to --max-channels candidate channels when target swap amount exceeds single channel capacity. - Add Spacebar multi-select toggling and select-all [a] to interactive terminal UI, with real-time combined swap size and aggregate PPM calculation. - Add greedy multi-channel batching fallback for non-interactive/headless environments. - Compute cumulative routing fee budget with configured leeway across all selected outgoing channels to prevent off-chain routing failures. - Update config.ini.example with max_channels default (3) and expand documentation in Other/swap_out-loop.md. - Add full unit test coverage for multi-channel pooling, argument parsing, non-TTY greedy batching, and command construction (28/28 tests passing).
…d menu size capping - Fix TypeError in main() when logging initiated multi-channel swap by using alias_str and chan_ids_str instead of indexing selected dict. - Fix duplicated '(X chans) (X chans)' in litloop label by removing redundant channel count suffix in main(). - Cap displayed combined swap size in interactive menu footer to target_amt when explicitly specified. - Add regression unit test test_main_multi_channel_logging_success.
…outbound candidates - Keep the defined loop out sum fixed to target_amt (--amt) when selecting multiple outbound channels, activating channel combinations for MPP and route diversity rather than multiplying the swap volume. - Display cost as an effective PPM and satoshi range (from cheapest candidate to most expensive candidate) in both the interactive UI footer and batch summary. - Bound the routing fee budget to the maximum probed routing fee among selected candidates plus leeway (max(fee) + leeway) rather than summing all fees. - Update documentation in Other/swap_out-loop.md and add test_multi_channel_fixed_amount_and_max_fee_budget test.
…d enhance SOT sweep status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
--channel <id1>,<id2>...):outgoing_chan_setsupport, allowing node operators to activate multiple outgoing channel candidates for a Loop Out swap.--amt(e.g. 3,000,000 sats) remains fixed as the total swap volume. Selecting multiple channels activates alternative outbound routes rather than multiplying the swap volume.3,569 – 4,570 ppm/10,706 – 13,709 sats).--max_swap_routing_feefrom the maximum probed routing fee among selected candidates (max(probed_routing_fee) + leeway) rather than summing all fees, giving LND sufficient fee room without overpaying.[Space]toggles checkboxes ([✓]/[ ]),[a]toggles all up to--max-channels, and[Enter]confirms the batch with real-time fixed swap size and Net PPM range display.max_channels = 3toconfig.ini.example.--max-channelsand--channel/--channelsCLI options.README.mdand comprehensively documented multi-channel workflows inOther/swap_out-loop.md.TypeErrorinmain()when multi-channel lists are selected, allowing foregroundmonitor_loop()to stream cleanly.(2 chans) (2 chans)in the litloop label.Verification
tests/Other/test_swap_out_loop.pyto 30 unit tests covering multi-channel candidate pooling, argument parsing, non-TTY greedy batching, comma input, real command formatting, logging safety, and fixed amount with max fee budget (30/30 passed).litd/loopd.