Skip to content

Support multi-tier (multi-level) referral rewards #396

Description

@Abidoyesimze

src/referral/service.ts is explicitly documented as a single-level program: a referrer earns a reward when someone they referred activates, full stop. There's no second tier — the referrer's own referrer earns nothing from a sub-referral.

Task

  • Add an optional second-tier reward (referrer's-referrer gets a smaller reward on the same activation event) behind a config flag, without disturbing the existing PENDINGACTIVATEDREWARDED lifecycle or the transactional activation check in checkAndActivateOnDeposit.
  • The payout job (jobs/referralPayout.ts) should pay all eligible tiers in the same sweep.
  • Add tests for a 2-tier chain, including the case where the tier-2 referrer's own code is no longer active.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions