REF-003
Three referral commission models, and what each one costs
Percentage of earnings, one-off signup bonus, or a share of what you earn from the referral. The arithmetic that decides which one bankrupts you.
Commission on referral earnings is the model everyone copies, and it is the one with no ceiling. Ten percent of everything a referral ever earns sounds modest until an active referral earns for a year.
A one-off signup bonus is capped by definition and immediately farmed: fake accounts cost you the bonus each and produce nothing.
The third model — paying from what the referral actually generates in ad revenue — is the only one that cannot lose money, because the payment is a share of income rather than a share of cost. It is harder to explain and harder to farm, and it is what a site that intends to still exist next year should use.
// Model A: percentage of the referral's earnings. Paid BY THE HOUSE, not
// deducted from the referral — deducting it is the fastest way to lose users.
function commission_on_earning(PDO $pdo, int $userId, int $earnedUnits): void
{
$st = $pdo->prepare('SELECT referrer_id FROM users WHERE id = ?');
$st->execute([$userId]);
$referrerId = (int) $st->fetchColumn();
if ($referrerId <= 0) {
return;
}
$pct = (float) setting('ref_percent', '10');
$units = (int) floor($earnedUnits * $pct / 100);
if ($units < 1) {
return; // rounds to nothing: skip the row
}
// Lifetime cap turns an unbounded liability into a known one.
$cap = setting_int('ref_lifetime_cap_units', 0);
if ($cap > 0) {
$st = $pdo->prepare('SELECT COALESCE(SUM(units),0) FROM ledger WHERE user_id = ? AND kind = "referral" AND meta_user_id = ?');
$st->execute([$referrerId, $userId]);
$paid = (int) $st->fetchColumn();
if ($paid >= $cap) {
return;
}
$units = min($units, $cap - $paid);
}
$pdo->prepare('UPDATE users SET balance = balance + ? WHERE id = ?')->execute([$units, $referrerId]);
$pdo->prepare('INSERT INTO ledger (user_id, kind, units, meta_user_id, created_at) VALUES (?, "referral", ?, ?, NOW())')
->execute([$referrerId, $units, $userId]);
}
// Model B: one-off bonus, paid only after the referral proves itself.
function commission_on_activation(PDO $pdo, int $userId): void
{
// Paying at signup pays for bots. Pay after real activity.
$st = $pdo->prepare('SELECT COUNT(*) FROM ledger WHERE user_id = ? AND kind = "claim"');
$st->execute([$userId]);
if ((int) $st->fetchColumn() < 20) {
return;
}
// …then credit once, guarded by a unique key on (referrer, referral).
}
Using it
Never deduct commission from the referral's own earnings. Users compare notes, and a site that quietly pays referred users less loses both of them.
Cap the lifetime total per referral. It converts an open-ended liability into a number you can put in the profitability calculator.
Pay activation bonuses on demonstrated activity, never on signup.
What bites people
Multi-level commission looks generous and turns a faucet into something regulators have opinions about. One level is enough.
Commission is a real cost and belongs in your margin arithmetic. At ten percent of payouts it is frequently the difference between profit and loss.
Round down and skip rows that round to zero, or you will accumulate thousands of ledger entries worth nothing.
This one touches real money. Point it at a throwaway wallet and watch a full cycle before you trust it with a live balance.