Skip to content

[Airdrop P2] Streak check-in system (SIWE) #882

@realproject7

Description

@realproject7

Parent: #877
Depends on: #878, #879

Scope

Daily check-in via Sign-In With Ethereum (SIWE). Streak tier applies a multiplier on all other PL earnings (not standalone points).

Streak Tiers

Streak Boost
0-6 days +0%
7+ days +5%
14+ days +10%
30+ days +20%
50+ days +30%
100+ days +50% (cap)

API

POST /api/airdrop/checkin

Request: SIWE signed message + signature from connected wallet

Logic:

  1. Verify SIWE signature → extract wallet address
  2. Query pl_streaks for this address
  3. Reject if same calendar day (UTC) as last_checkin
  4. Reject if last_checkin was less than 30 minutes ago
  5. If last_checkin was the previous calendar day → increment current_streak
  6. If 2+ days missed → drop one tier:
    • streak 100+ → set to 100
    • streak 50-99 → set to 50
    • streak 30-49 → set to 30
    • streak 14-29 → set to 14
    • streak 7-13 → set to 7
    • streak 1-6 → set to 0
  7. Update last_checkin = NOW(), update longest_streak if applicable
  8. Return: { streak, boostPercent, nextTier, checkedInToday }

Streak Helper

lib/airdrop/streak.ts:

  • getStreakBoost(streak: number): number — returns multiplier (e.g., 0.20 for 30d streak)
  • dropOneTier(streak: number): number — returns new streak after one missed day
  • getNextTier(streak: number): { days: number, boost: number } | null

Files

  • src/app/api/airdrop/checkin/route.ts
  • lib/airdrop/streak.ts

Acceptance Criteria

  • SIWE signature verified server-side
  • One check-in per calendar day (UTC), 30-min minimum gap
  • Streak increments on consecutive days
  • Missed day drops one tier (not hard reset)
  • Streak counter resets to the lower tier's threshold
  • Returns current streak + boost % + next tier info
  • Boost multiplier used by buy points sync cron ([Airdrop P2] Buy points sync cron #881)

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentairdropPLOT 10x Airdrop Campaign

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions