Skip to content

Commit 23c304f

Browse files
committed
No referral credits
1 parent 5b92516 commit 23c304f

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

common/src/constants/limits.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ export const MAX_DATE = new Date(86399999999999)
55
export const BILLING_PERIOD_DAYS = 30
66
export const SESSION_MAX_AGE_SECONDS = 30 * 24 * 60 * 60 // 30 days
77
export const SESSION_TIME_WINDOW_MS = 30 * 60 * 1000 // 30 minutes - used for matching sessions created around fingerprint creation
8-
export const CREDITS_REFERRAL_BONUS = 500
8+
// Referral credits disabled 2026-04-17: setting bonus to 0 stops new referral credit grants
9+
// without removing the referral-tracking records. See scripts/opus-or-bleed.ts for the
10+
// abuse pattern that motivated this (self-referral rings farming 1000 free credits per
11+
// signup and burning them on Opus). Development focus is shifting to freebuff which has
12+
// no credit system, so we don't need this growth lever going forward.
13+
export const CREDITS_REFERRAL_BONUS = 0
914
export const AFFILIATE_USER_REFFERAL_LIMIT = 500
1015

1116
// Default number of free credits granted per cycle

web/src/app/api/referrals/helpers.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,17 @@ export async function redeemReferralCode(referralCode: string, userId: string) {
138138

139139
const operationId = referralRecord[0].operation_id
140140

141-
// 2. Process and grant credits for both users (one-time, never expires)
141+
// 2. Grant credits for both users (skipped entirely when bonus is 0 — we still
142+
// record the referral above for tracking, but don't write 0-principal rows
143+
// into the credit ledger).
144+
if (CREDITS_REFERRAL_BONUS <= 0) {
145+
logger.info(
146+
{ operationId, referrerId: referrer.id, referredId: userId },
147+
'Referral recorded; credit grants skipped (CREDITS_REFERRAL_BONUS=0).',
148+
)
149+
return
150+
}
151+
142152
const grantPromises = []
143153

144154
const grantForUser = (user: { id: string; role: 'referrer' | 'referred' }) =>

0 commit comments

Comments
 (0)