-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add fee credit feature for on-the-fly funding #660
Merged
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
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
5 times, most recently
from
July 8, 2024 09:52
21d9fae
to
2f5f38a
Compare
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
from
July 9, 2024 15:42
2f5f38a
to
e6f9236
Compare
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
from
July 17, 2024 11:39
e6f9236
to
850f884
Compare
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
from
July 19, 2024 08:56
850f884
to
40dd1dd
Compare
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
from
August 28, 2024 07:59
40dd1dd
to
a7caee0
Compare
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
4 times, most recently
from
September 6, 2024 15:34
0de4be2
to
9aa22ff
Compare
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
5 times, most recently
from
September 16, 2024 08:30
8e8add2
to
969560e
Compare
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
from
September 18, 2024 16:21
969560e
to
2b3062f
Compare
pm47
reviewed
Sep 23, 2024
src/commonMain/kotlin/fr/acinq/lightning/payment/IncomingPaymentHandler.kt
Outdated
Show resolved
Hide resolved
pm47
reviewed
Sep 23, 2024
src/commonMain/kotlin/fr/acinq/lightning/payment/IncomingPaymentHandler.kt
Show resolved
Hide resolved
We add an optional feature that lets on-the-fly funding clients accept payments that are too small to pay the fees for an on-the-fly funding. When that happens, the payment amount is added as "fee credit" without performing an on-chain operation. Once enough fee credit has been obtained, we can initiate an on-chain operation to create a channel or a splice by paying part of the fees from our fee credit. This feature makes more efficient use of on-chain transactions by trusting that our peer will honor our fee credit in the future. The fee credit takes precedence over other ways of paying the fees (from our channel balance or future HTLCs), which guarantees that the fee credit eventually converges to 0.
Add a parameter to our liquidity policy to limit the amount that can be allocated to fee credit. We don't want a temporary high feerate to cause wallet users to allocate too much funds towards their fee credit, which they may not use later.
If our balance, combined with our fee credit, doesn't allow us to pay the liquidity fees with the payment type we chose, we immediately abort the splice.
t-bast
force-pushed
the
on-the-fly-fee-credit
branch
from
September 25, 2024 01:19
5d21e08
to
9faa2dd
Compare
pm47
approved these changes
Sep 25, 2024
pm47
added a commit
that referenced
this pull request
Sep 27, 2024
* enable feature FundingFeeCredit * emit a liquidity event for each liquidity purchase Independently of whether the purchase was triggered by an on-chain or off-chain payment. Also renamed `LiquidityEvents.Accepted` to `LiquidityEvents.Purchased`. * expose serviceFee in InboundLiquidityOutgoingPayment * add events PaymentEvents.PaymentSent
pm47
added a commit
to ACINQ/phoenixd
that referenced
this pull request
Oct 3, 2024
Adds support for liquidity-ads based protocol for on-the-fly liquidity as specified in lightning/blips#36 and lightning/blips#41, implemented respectively in ACINQ/lightning-kmp#649 and ACINQ/lightning-kmp#660. ### Lightning-kmp update Phoenixd now uses the main branch of `lightning-kmp` (v1.8.0). ### Database update - `LiquidityAds.Lease` is replaced by `LiquidityAds.Purchase`, so we need to update the liquidity table. - the `receivedWith` data have been updated in lightning-kmp, and we need a new `Part.Htlc.V1` object that may contain a `LiquidityAds.FundingFee`. With the `Lease->Purchase` change, we've updated our pattern for versioning database objects. We now have `asDb()` & `asCanonical()` mapping methods and store the type of the db object inside the json (which means we don't need the `type` column anymore, except for convenience). --------- Co-authored-by: pm47 <[email protected]>
vincenzopalazzo
pushed a commit
to vincenzopalazzo/phoenixd
that referenced
this pull request
Nov 7, 2024
Adds support for liquidity-ads based protocol for on-the-fly liquidity as specified in lightning/blips#36 and lightning/blips#41, implemented respectively in ACINQ/lightning-kmp#649 and ACINQ/lightning-kmp#660. ### Lightning-kmp update Phoenixd now uses the main branch of `lightning-kmp` (v1.8.0). ### Database update - `LiquidityAds.Lease` is replaced by `LiquidityAds.Purchase`, so we need to update the liquidity table. - the `receivedWith` data have been updated in lightning-kmp, and we need a new `Part.Htlc.V1` object that may contain a `LiquidityAds.FundingFee`. With the `Lease->Purchase` change, we've updated our pattern for versioning database objects. We now have `asDb()` & `asCanonical()` mapping methods and store the type of the db object inside the json (which means we don't need the `type` column anymore, except for convenience). --------- Co-authored-by: pm47 <[email protected]>
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.
We add an optional feature that lets on-the-fly funding clients accept payments that are too small to pay the fees for an on-the-fly funding. When that happens, the payment amount is added as "fee credit" without performing an on-chain operation. Once enough fee credit has been obtained, we can initiate an on-chain operation to create a channel or a splice by paying part of the fees from our fee credit.
This feature makes more efficient use of on-chain transactions by trusting that our peer will honor our fee credit in the future. The fee credit takes precedence over other ways of paying the fees (from our channel balance or future HTLCs), which guarantees that the fee credit eventually converges to 0.