padreug commented on issue aiolabs/lightning-pub#15

padreug
2026-04-02T18:43:49Z

Extension: Cash Provider (ATM liquidity funding)
Enhancement: Per-provider commission rates

Each cash provider should be able to set their own desired commission rate when funding a machine. For example:

Provider A funds $5,000 at 10% commission

Provider B funds $3,000 at 5% commission

When a customer does a cash-out, each provider's share of the BTC settlement has their own commission deducted — not a flat rate for all providers.

Data model change

Add commission_rate to CashFunding:

CashFunding {
  // ... existing fields ...
  commission_rate: number | null   // provider's desired rate (e.g. 0.10 = 10%)
                                   // null = use machine default
}

Settlement calculation

Customer cash-out: $100 dispensed, 250,000 sats received

Provider A: $3,000 remaining (60%), commission 10%
  → share: 150,000 sats
  → commission: 15,000 sats
  → provider receives: 135,000 sats

Provider B: $2,000 remaining (40%), commission 5%
  → share: 100,000 sats
  → commission: 5,000 sats
  → provider receives: 95,000 sats

Total commission: 20,000 sats (split per LP #13 weights)

UX

Provider specifies their rate in the fundMachine call:

satmachine.fundMachine({
  machine_id: "atm-antigua-01",
  amount: 5000,
  currency: "USD",
  commission_rate: 0.10   // 10%, or omit for machine default
})

This creates a competitive dynamic — providers who accept lower commission are more attractive to operators, while providers who want higher margins can set their own price. The operator can also set a minimum/maximum commission range per machine to keep rates reasonable.