Technical Design for Time-Limited Campaign Rewards: Distribution and Claim Rules

    This article abstracts a limited-time campaign into a general technical design for reward distribution and claim systems. It covers campaign configuration, task progress and conversion, random rewards with deduplication preferences, two-choice claims, redemption codes, limited-time discount windows, idempotency, and anti-abuse controls, with implementation notes for common edge cases.

    In online campaign operations, “limited-time celebration + free rewards + paid discounts” is an extremely common combination. Consider a recent esports championship celebration campaign: it runs for about a month and includes match tasks, login conversion, random chest distribution, a choose-one selection, redemption code exchange, limited-time discounts, currency exchange, and several other business rules. Such campaigns look simple, but behind them is a typical campaign operations system design problem. Using the rules of that campaign as source material, this article abstracts them into a general technical solution and outlines the core modules and implementation details developers should pay attention to when building this type of system.

    1. Overall Architecture of a Campaign System

    A typical limited-time campaign system usually contains the following modules:

    1. Campaign configuration center: manages campaign start and end times, rule parameters, and reward pool configuration, with support for hot updates. Campaign times such as “opens at 10:00 on November 19 and ends on December 20” must never be hard-coded in business code; they should be delivered as configuration.
    2. Task progress service: tracks user behavior such as completing matches, logging into the client, and participating in other modes, and converts that behavior into task progress.
    3. Reward distribution service: triggers reward distribution based on progress and handles logic such as random draws, choose-one selection, and deduplication priority.
    4. Inventory and idempotency control: ensures that the same reward is distributed only once to the same user and prevents repeated claims.
    5. Transaction and discount service: handles scenarios involving resource deduction, such as limited-time half-price offers and currency exchange.

    2. Task Progress and Conversion Mechanics

    The original rule “complete 2 matches to claim a chest, and logging into the companion app can be converted into 1 match” reflects task conversion design. The essence of conversion is to map behavior from different channels into the same progress model:

    1. TASK_GOAL = 2
    2. CONVERSION = {
    3. "match_completed": 1, # Each completed match counts as 1 point
    4. "client_login": 1, # A login converts to 1 point, counted only once
    5. }
    6. def update_progress(user_id, event_type):
    7. if event_type == "client_login" and already_counted(user_id, event_type):
    8. return # Login conversion usually has a usage cap
    9. progress = incr(user_id, event_type, CONVERSION[event_type])
    10. if progress >= TASK_GOAL:
    11. unlock_reward(user_id, "champion_chest")

    Design points: conversion events need deduplication to prevent abuse; progress must be persisted and queryable; and the unlock action after reaching the goal must be idempotent.

    3. Random Distribution and the Deduplication-First Strategy

    “Randomly distribute 1 premium chroma, prioritizing items the account does not already own” is a typical case of random sampling with preference conditions. The implementation should not be purely random; it should filter the candidate set first:

    1. SELECT item_id FROM reward_pool
    2. WHERE item_id NOT IN (
    3. SELECT item_id FROM user_inventory WHERE user_id = ?
    4. )
    5. LIMIT 1;

    When the candidate set is empty because the user already owns everything, a fallback strategy must be defined. For example, the system may allow duplicate distribution or convert the reward into another resource such as a universal currency. This must be made explicit in the product rules; otherwise, customer complaints are likely.

    4. Implementation Pitfalls in Two-Choice Claims

    “The system draws 2 skins, the user chooses one, and no replacement is allowed if the choice is wrong” is the module most prone to incidents in this type of campaign. The key technical points are:

    1. Candidate results must be fixed first: the draw result should be generated and persisted when the user views it, not redrawn on every refresh. Otherwise, users can repeatedly refresh to “gamble” for the reward they want, which breaks the probability design.
    2. The choice action must be atomic:
    1. UPDATE user_reward_choice
    2. SET chosen = ?, choose_time = NOW()
    3. WHERE user_id = ? AND batch_id = ? AND chosen IS NULL;
    1. Transaction protection: the choice, distribution, and log recording must be in the same transaction. If distribution fails, the choice state should be rolled back so the user can retry, but there must never be a case where the user “chose but did not receive” or “received both rewards.”

    5. Redemption Codes and Resource Conversion

    For logic such as “enter a redemption code, choose 5 heroes, and convert any shortfall into a universal currency at the unit price,” the core is input validation + balance check + conversion rules. The main defense is against brute-force enumeration of redemption codes: code-based redemption should be bound to an account, limit attempt frequency, and rate-limit the redemption API.

    6. Time Handling for Limited-Time Discount Windows

    A half-price window that “opens at 10:00 on the 19th and ends at 9:59 on the 23rd” looks simple, but it involves several engineering details:

    • Unified time zones: the server should always store time in UTC, and the presentation layer should render it according to the user’s time zone.
    • Boundary conditions: whether the deadline is inclusive or exclusive must be clearly defined. Whether an order placed at 9:59:59 is valid must be written explicitly into the validation logic.
    • Price snapshot: the price at the time of ordering must be fixed in the order to avoid recalculating the price when users review the order after the campaign ends.
    • Exclusion rules: filtering conditions such as “items newly listed in the last 6 months do not participate” should be configurable rather than scattered throughout the code.

    7. Anti-Abuse and Risk Control

    Free reward campaigns inevitably attract abusers. Common controls include device fingerprint and account association analysis, validation of match behavior to prevent idle farming of match counts, rate limiting and queue-based peak shaving for distribution APIs because traffic spikes often occur on the first day of a campaign, and asynchronous processing of critical operations with fallback compensation.

    8. Conclusion

    The technical difficulty of limited-time campaigns lies not in any single feature, but in the rigor of combined rules: conversion, deduplication, choose-one selection, time windows, and price snapshots. Any omission in these areas becomes a pitfall for users. Good practices are to make all rule parameters configurable, make all distribution actions idempotent, make all time boundaries explicit, and clearly define all edge cases such as an empty candidate set, distribution failure, and repeated clicks. Only when these are handled properly can a campaign system both help users “not miss the time window” and keep engineers from staying up all night fighting fires during the campaign.