Earning coins
Players earn coins when they complete gameplay events. There are two triggers:level_complete— fires automatically when aLevelCompletedevent is ingested andcoins_enabledistruefor the game. This is the standard earning path for level-based games.event_trigger— fires when a configurable threshold of custom events is reached (controlled byevent_trigger_thresholdin the game’s config). This path is disabled by default and suits endless or score-based games.
coins_transactions collection. Each transaction captures:
Coin transactions are an immutable ledger. Once written, they cannot be updated or deleted. Any adjustment requires a new
deduct transaction.coins_balance field on their profile.
Coin reward modes
Each game has areward_mode that controls how the coin amount is calculated per award:
fixed— every award grants exactlyreward_fixed_amountcoins.random_range— the amount is drawn randomly betweenreward_min_amountandreward_max_amount.
level_completion_multiplier (default 1.0) and event_trigger_multiplier (default 0.5).
Converting coins to USD
A scheduled conversion job runs on an interval defined byconversion_interval_hours in the active conversion setting. When the job runs, it selects users whose next_conversion_at timestamp is in the past and whose coins_balance is above zero.
There are two conversion modes, set per conversion setting:
standard— a fixed coin-to-USD ratio (standard_coin_to_usd_ratio) is applied. For example, a ratio of0.00001means 1,000 coins convert to $0.01.elastic— the payout is derived from the user’s actual ad revenue, multiplied byads_revenue_share. This mode ties payouts directly to the ad income a player generates.
min_payout_usd, the conversion is skipped for that run and the user’s coins remain pending until the next interval.
Each successful conversion is recorded in the money_conversions collection with:
Money conversions are also an immutable ledger. Once created, they cannot be modified.
coins_balance decreases and their money_balance_usd increases by the converted amount. The profile is also updated with last_conversion_at and next_conversion_at.
Requesting a withdrawal
Once a player has amoney_balance_usd above the configured minimum, they can request a PayPal withdrawal. Withdrawal behaviour is governed by two app-level settings:
minimum_withdrawal_amount— the minimum USD amount required to submit a request.withdraw_cooldown_hours— how many hours must pass between two withdrawal requests from the same player.
- The
amount_usdis immediately debited from the player’smoney_balance_usd. - The withdrawal record is created with
status: "pending". - The player provides their
paypal_emailto receive the payment.
paid or failed.
The currently supported payment_method values are:
End-to-end flow
1
Player completes a level
Your game sends a
LevelCompleted event to POST /ingest/events. If coins_enabled is true for the game, the event processor fires a coin award.2
Coin transaction is recorded
A
coins_transactions entry is written with type: "earn" and trigger: "level_complete". The player’s coins_balance increases.3
Conversion job runs
On the next scheduled interval, the conversion job processes the player. Coins are converted to USD using the active conversion setting’s mode and rate. A
money_conversions record is written and money_balance_usd increases.4
Player requests a withdrawal
When the player’s
money_balance_usd meets the minimum, they call POST /v1/withdrawals with their PayPal email and the amount they want to withdraw.5
Admin processes the payout
An admin reviews the withdrawal in the dashboard and marks it
paid (triggering the PayPal transfer) or failed (which refunds the balance back to the player).