Skip to content

Refused (over-ceiling) referral payouts are only visible in the log #327

Description

@v0l

Follow-up to #312 (PR #325).

A converted referral payout is refused when the quote values the balance above MAX_CONVERTED_PAYOUT_MSAT (0.01 BTC, lnvps_api/src/referral/mod.rs:58). That is the right default — a stale or wrong rate would otherwise multiply what leaves the node, and a Lightning payment does not come back — but the refusal is only a warn! line, retried every pass.

Two distinct situations produce it and neither is visible without reading logs:

  • The rate feed is wrong. Someone needs to look at the feed.
  • The referrer is legitimately owed more than the ceiling. Their commission then never pays out automatically, and nobody is told.

Wanted

Surface the refusal to operators rather than only to the log — an admin notification (WorkJob::SendAdminNotification already exists and is used elsewhere in the worker) on the first refusal for a referrer, or a flag on the referral an admin view can list.

Whatever the shape, a refusal must not repeat a notification every pass: the balance is re-evaluated on each run, so the trigger has to be the transition into the refused state, not the state itself.

Not deciding here

Whether the ceiling should also be configurable per deployment. It is a constant today because a payout above it is more likely a bad quote than a real balance; that reasoning weakens as commissions grow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions