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

Add config to charge a transaction fee #358

Open
bumi opened this issue May 3, 2023 · 4 comments
Open

Add config to charge a transaction fee #358

bumi opened this issue May 3, 2023 · 4 comments

Comments

@bumi
Copy link
Contributor

bumi commented May 3, 2023

Currently only the lightning fees are charged. As an operator I want to be able to charge a fee per transaction.
This could be a fixed fee or a percentage.

This should be the place where the fee transaction entry is created. Currently we set the invoice fee there.
https://github.com/getAlby/lndhub.go/blob/main/lib/service/invoices.go#L313

the invoice fee is set here: https://github.com/getAlby/lndhub.go/blob/main/lib/service/invoices.go#L239

this could be one function similar to CalcFeeLimit. It's on the Service thus it can be used to set the invoice Fee.

ToDo: check how it is for keysend payments

@MoritzKa
Copy link

MoritzKa commented May 3, 2023

From a business perspective I want to charge different fees

  • for incoming vs. outgoing transactions
  • to a subsegment of users

@bumi
Copy link
Contributor Author

bumi commented May 21, 2023

Assigning all the people just as a ping to think about how this option should be implemented.

@MoritzKa
Copy link

Fee proposal:

  • 0% internal transaction
  • 0% + network fees for 0-250k sat volume per month external transaction
  • 0.9% or 1 sat for >250k sat volume per month external transaction
    (to be discussed)

Fees can dependent on

  • transaction size
  • transaction volume per week/month/etc.
  • recipient (Alby or non-Alby user)
  • sender (Alby or non-Alby user)
  • type of user (e.g. we could offer reduced fees to users who pay a monthly subscription)

Implementation

  1. Step: check payment volume
  2. Step: make fees configurable based on payment volume

@kiwiidb
Copy link
Contributor

kiwiidb commented Oct 4, 2023

On a technical level I advocate for a subscription-based model for power users like BTCPayserver, and charge no transaction-based fees. If we go through with the first step of https://github.com/getAlby/alby-deployment/issues/170, then we have a single place to manage users (the rails app). Then we can set transaction limits for these users there, and have a system to manage subscriptions. Based on the subscription payment we can then allow for different transaction volumes easily in LNDhub. We can then have different monthly tiers. And we can add other benefits for paying users (more nostr / lnurl features, access to more apps, etc).

If we have to calculate transaction-based fees in LNDhub then I see these downsides:

  • users will complain if they are too high
  • complex to implement, putting even more code in the LNDhub codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

5 participants