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

Exposing fees in ReverseSwapInfo #1111

Open
danielgranhao opened this issue Oct 23, 2024 · 4 comments · May be fixed by #1127
Open

Exposing fees in ReverseSwapInfo #1111

danielgranhao opened this issue Oct 23, 2024 · 4 comments · May be fixed by #1127
Assignees

Comments

@danielgranhao
Copy link
Contributor

Sending an onchain payment using a reverse swap results in a Payment that contains a ReverseSwapInfo. It would be useful if ReverseSwapInfo included the fees that were spent for the lockup and claim txs, as well as the swap provider fees. Right now we can only find out how much was spent on fees in total by comparing the sent LN funds and the resulting sent onchain funds.

@roeierez
Copy link
Member

Thanks @danielgranhao.
If we are changing the ReveseSwapInfo then let's also add the payment_hash so users can use payment_by_hash method to retrieve the associated payment.

@JssDWt
Copy link
Contributor

JssDWt commented Nov 15, 2024

Working on exposing the reverse swap fees.
I can add the fees for any new reverse swap, but not existing ones, because we don't have the data.

I was thinking about backfilling the fees for the existing swaps by looking at onchain transaction fees. But the tx ids are only persisted in the local storage, not the sync storage. So this data is lost when you lose your local data.

So a 2-fold question to @danielgranhao and @roeierez:

  • Is having the fees only for new swaps good enough?
  • It seems to me like we should store the claim and lockup tx ids in the sync database, why are they in the local database only? (it was added in this PR Include ReverseSwapInfo in Payment #728)

@roeierez
Copy link
Member

@JssDWt moving forward without backfilling the old swaps is fine enough IMO for this PR.
The lockup/claim tx are not synced because they are onchain data that is fetched from the blockchain.

@danielgranhao
Copy link
Contributor Author

I've just noticed I created another version of this issue earlier. It's almost an exact duplicate, but it also asks to add the recipient onchain address to ReverseSwapInfo. I still think it would be useful.

@JssDWt JssDWt linked a pull request Nov 18, 2024 that will close this issue
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 a pull request may close this issue.

3 participants