Pay fiat-settled referral commission by converting to sats - #325
Merged
Conversation
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #312.
A fiat-settled balance is quoted against BTC at send time, paid over Lightning, and recorded with both sides (
referral/mod.rs:242for the pass,converted_payoutfor the row).min-fiat-payout-satsunder[referral],Nonedisables — the same shape as the existing BTC minimum, and the referrer's ownpayout_thresholdstill applies on top.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