getAlby / hub

Alby Hub - Your own lightning node connected to every app. Run anywhere. Become self-sovereign.
https://getalby.com
Apache License 2.0
59 stars 11 forks source link

Send 80% budget usage warning event #319

Open bumi opened 1 month ago

bumi commented 1 month ago

Currently the experience is pretty bad when a budget is used. Can we send an event and notify the user via email if for example 80% of the budget is used?

rolznz commented 1 month ago

Should we also have one for 50%?

So the user would (hopefully) get 2 notifications before they receive the permission denied notification

bumi commented 1 month ago

not sure what good numbers are. we have the payment event - do we know there the budget status?

rolznz commented 1 month ago

We currently don't - the nwc_payment_succeeded and nwc_payment_failed events are being sent from the NWC controllers and we do the budget check in another layer (the transactions service).

The easiest way would be to fire a new event from the transactions service every time we validate the balance/budget. I'm not sure if this is a good idea though?