Conversation
- New POST /api/cron/airdrop-points endpoint (every 5 min) - Syncs trade_history mint events → pl_points with streak boost - Awards referral points (20%) to referrers with their own streak boost - Filters out ZAP_PLOTLINK self-mints - Idempotent via metadata.trade_id dedup - Respects campaign window (no points after CAMPAIGN_END) - New lib/airdrop/points.ts with computeBuyPoints/computeReferralPoints Fixes #881 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The cron structure is reasonable, but the referral points calculation does not currently match the issue requirements. As written, referrers receive 20% of the buyer's unboosted base spend instead of 20% of the buyer's actual awarded buy points.
Findings
- [high] Referral points ignore the buyer's streak boost, even though the issue explicitly says referral points should be 20% of the buyer's buy points.
- File:
lib/airdrop/points.ts:43 - Suggestion: compute referral points from the already-calculated
buyPointsvalue (or pass the buyer streak into the helper), then apply the referrer's own streak boost on top if that is the intended product rule.
- File:
- [high] The route passes
plotSpentintocomputeReferralPoints()instead of the buyer's awarded buy points, which bakes the same under-award into every referral insert.- File:
src/app/api/cron/airdrop-points/route.ts:149 - Suggestion: reuse
buyPointsfrom the buy branch when deriving referral points for the referrer.
- File:
Decision
Requesting changes because the current implementation under-awards referral points relative to the ticket spec.
computeReferralPoints now takes the buyer's streak-boosted buyPoints instead of raw plotSpent, so referral awards correctly reflect 20% of the buyer's actual earned points. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The referral-points calculation now matches the ticket requirement. Referral awards are derived from the buyer's actual boosted buyPoints, then adjusted by the referrer's own streak boost as implemented in the helper.
Findings
- No blocking findings in the updated patch.
Decision
Approving from a code-review standpoint. The blocker from my previous review is resolved, and the cron logic now matches the spec for buy and referral point calculation.
Summary
POST /api/cron/airdrop-pointsendpoint — syncstrade_historymint events topl_pointspl_streaks)ZAP_PLOTLINKself-mints, respects campaign windowmetadata.trade_iddedup — re-running won't create duplicateslib/airdrop/points.tswithcomputeBuyPoints()andcomputeReferralPoints()helpersFiles Changed
src/app/api/cron/airdrop-points/route.ts— cron endpointlib/airdrop/points.ts— points computation with streak boostTest plan
npm run typecheckpasses/api/cron/airdrop-pointswith valid CRON_SECRET — verify points insertedpl_referralsCAMPAIGN_ENDFixes #881
🤖 Generated with Claude Code