Skip to content
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

Include local mining fees for pure liquidity purchases #710

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Oct 9, 2024

When we are purchasing liquidity without any other splice operation (splice-in, splice-out or splice-cpfp), we will have a single entry in our DB: the liquidity purchase itself. In that case, we are paying mining fees for the shared input and output: we must record those in the purchase. This happens during manual liquidity purchases and on-the-fly funding.

We cannot easily add tests because we don't implement the liquidity seller side, which makes it hard to trigger those conditions.

When we are purchasing liquidity without any other splice operation
(splice-in, splice-out or splice-cpfp), we will have a single entry
in our DB: the liquidity purchase itself. In that case, we are paying
mining fees for the shared input and output: we must record those in
the purchase. This happens during manual liquidity purchases and
on-the-fly funding.

We cannot easily add tests because we don't implement the liquidity
seller side, which makes it hard to trigger those conditions.
This is used in the case where there is no other payment entry to
account for local mining fees.
@t-bast t-bast merged commit 8989de6 into swap-fee-split Oct 9, 2024
2 checks passed
@t-bast t-bast deleted the swap-fee-split-bast branch October 9, 2024 08:34
dpad85 added a commit to ACINQ/phoenixd that referenced this pull request Oct 10, 2024
With ACINQ/lightning-kmp#709 and
ACINQ/lightning-kmp#710, the mining
fee for liquidity events is split between local and purchase
fee. However, we don't directly store the split fees, for
backward compatibility reasons. Thus, to get the local fee
from the database, we must compute it back.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants