-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support new on-the-fly funding #632
Merged
Conversation
This file contains 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
- Updated the liquidity policy (see NodeParamsManager). We are using a policy that does not target additional liquidity and that does not use fee credit yet. - Removed the code updating the peer's swap feerate (it's now provided by the LSP) - Updated the received-with database object with new types: incoming LN payments may contain a funding fee ; payments may be received through a fee credit (not enabled for now). - Updated the liquidity-purchase database objects with new purchase & payment-details type. The lease data are now legacy and are removed wherever possible. Note: for the inbound liquidity db objects, we are moving away from the type_version pattern for serialisation. Instead the json data type is embedded inside the json by the kotlinx serialisation library. This makes the code less verbose. - Added a liquidity purchase wrapper for cloud data. - Updated the Notification types with new rejection options. We try to match in this update the serialisation pattern that was mentioned above.
With the new on-the-fly mechanism, the automated liquidity operation necesssary to receive some payments are stored as specific payments. That is, the incoming payments related to this operation do not have a fee, instead there's a payment row in the payments history specific to the liquidity purchase. The operation also has its own payment details page just like the (already existing) manual liquidity purchase. The splash screen file has been split into several files, one for each payment types. This makes the code more flexible. The liquidity policy objects set in the channels management screen have been updated to match the NodeParamsManager value. This commit is a WIP, especially for wording and localisation.
Depends on lightning-kmp master minus kotlin-2.0
This is useful to track the fees incurred by an incoming payments because of a liquidity purchase. Also fixed payments history ordering. The sort logic is now: - created_at for outgoing payments - received_at for incoming payments Also improved descriptions for CSV writer to be more neutral and more informative.
… is shown or not See ACINQ/lightning-kmp#706 Methods feePaidFromChannelBalance and feePaidFromFutureHtlc have been added to check whether an inbound liquidity purchase is paid from balance or future htlc. This is used to know when to display a liquidity fee or not, and to get the liquidity fee for an incoming payment. Also fixed some UI issues with descriptions and improved txid and channel id buttons in technical screen.
Also fixed several UI issues.
Also added 2 helper extensions methods in shared module.
Also removed channel-funding notification which is replaced by a generic error.
The business variable should be set asap to allow proper cancelling if the worker is cancelled early.
dpad85
commented
Oct 4, 2024
robbiehanson
approved these changes
Oct 4, 2024
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.
This PR adds support for the new on-the-fly funding based on liquidity ads.
For the user, it's an UI change : the cost that is sometimes incurred when receiving payments is (in some cases) not displayed as fees anymore ; instead it's displayed as a separate automated liquidity payment.
The liquidity payment details screen shows links to the incoming payments that triggered the liquidity payment. This will help user track the source of the liquidity purchases.
Notes:
Rationale
This update will allow for more options regarding liquidity and funding in the future. For example, opportunistically request additional funding on-the-fly. It also demonstrates how liquidity works, and should help users make informed decisions about how they want liquidity to be managed by the wallet.
More details can be found here:
Screenshots