Incorrect fiat-to-msat conversion causes wrong Lightning invoice amounts in manual and auto-pay billing #6

Closed
opened 2026-04-11 13:32:21 +00:00 by userAdityaa · 0 comments
Contributor

Summary

Billing converts Stripe invoice amount_due directly to Lightning msats using amount_due * 1000, which treats fiat minor units as if they were sats-derived units. This makes paid amounts market-dependent and generally wrong, because no FX quote is applied.

Business impact

  • Underpayment or overpayment risk on every Lightning payment depending on BTC/USD at payment time.
  • Auto-pay path can mark Stripe invoice paid out-of-band after paying the wrong Lightning amount
  • Financial reconciliation drift between Stripe fiat invoice ledger and Lightning receipts.

Why this is definitely wrong

  • Stripe amount_due is fiat minor units, not sats or msats.
  • NWC make_invoice amount expects msats.
  • Multiplying cents by 1000 assumes an implicit fixed FX rate between fiat and BTC, which does not exist in code and changes continuously in reality
### Summary Billing converts Stripe invoice amount_due directly to Lightning msats using amount_due * 1000, which treats fiat minor units as if they were sats-derived units. This makes paid amounts market-dependent and generally wrong, because no FX quote is applied. ### Business impact * Underpayment or overpayment risk on every Lightning payment depending on BTC/USD at payment time. * Auto-pay path can mark Stripe invoice paid out-of-band after paying the wrong Lightning amount * Financial reconciliation drift between Stripe fiat invoice ledger and Lightning receipts. ### Why this is definitely wrong * Stripe amount_due is fiat minor units, not sats or msats. * NWC make_invoice amount expects msats. * Multiplying cents by 1000 assumes an implicit fixed FX rate between fiat and BTC, which does not exist in code and changes continuously in reality
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coracle/caravel#6