Skip to content

Pay fiat-settled referral commission by converting to sats - #325

Merged
v0l merged 3 commits into
masterfrom
feat/auto-cross-currency-payouts-312
Jul 29, 2026
Merged

Pay fiat-settled referral commission by converting to sats#325
v0l merged 3 commits into
masterfrom
feat/auto-cross-currency-payouts-312

Conversation

@v0l

@v0l v0l commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Closes #312.

A fiat-settled balance is quoted against BTC at send time, paid over Lightning, and recorded with both sides (referral/mod.rs:242 for the pass, converted_payout for the row).

  • Off by default: min-fiat-payout-sats under [referral], None disables — the same shape as the existing BTC minimum, and the referrer's own payout_threshold still applies on top.
  • The threshold is judged on the converted value, so one setting means the same thing whatever the currency. That answers the issue's open question — no second unit to keep in sync.
  • The settled amount is derived back from the rounded-to-whole-sats transfer, so the sub-sat remainder stays owed instead of being discharged for free. The routing fee is charged at the same quote rather than at read time.
  • Netting is per settled currency (settled_in), so a EUR payout sent as BTC leaves the BTC balance alone — the invariant Record both sides of a converted referral payout #311 established.

Scope: Lightning/NWC referrers only. An on-chain payout batches referrers into one transaction and splits its fee across them in sats; charging that share against a fiat balance means converting each share back, which is a different change. On-chain referrers keep accruing fiat for manual payout, and the config comment says so. Happy to file that as a follow-up.

Tests: unit coverage of the conversion, the threshold, the per-currency grouping and the netting. No e2e — nothing here is reachable over HTTP, and the payout itself needs a real LNURL endpoint.

Originating channel: Buzz #721a8a6c-c36c-5fa1-ae07-822ddc8567c5

@v0l
v0l merged commit 645230c into master Jul 29, 2026
5 of 6 checks passed
@v0l
v0l deleted the feat/auto-cross-currency-payouts-312 branch July 29, 2026 16:29
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.

Automate cross-currency referral payouts (fiat-settled commission paid as BTC)

1 participant