Distribute Rewards to Leaderboard: Points → Tokens

Convert leaderboard points into ERC‑20 token payouts and distribute to the top N winners automatically.

Overview

Automatically convert leaderboard points into ERC‑20 token rewards and pay the top N members from a single reward wallet. This automation: fetches leaderboard entries, converts each user’s total points into a token amount using a points→tokens multiplier, resolves the user’s connected EVM wallet, attempts the transfer, and writes timestamped log rows with status and tx details while sending notifications for success or failure.

How it works

  1. Trigger the automation (manual webhook trigger).
  2. Fetch the top X leaderboard entries (X = numberOfRecipients, defaults to 1000).
  3. For each leaderboard entry:
    • Load the corresponding community member and resolve their connected EVM wallet.
    • Compute the token amount: tokens = totalPoints / pointsToTokensMultiplier (defaults to 1).
    • If tokens > 0 and a valid EVM wallet exists, send the computed ERC‑20 amount from your configured reward wallet on the chosen network.
    • On success: record a row in the generated "Reward Distribution - <timestamp>" table and send a success notification (includes tx hash and position).
    • On failure (no EVM wallet, zero points, or transaction error): record a failure row and send a failure notification explaining the reason.

Setup (what to provide)

  • community: select the community that owns the leaderboard.
  • leaderboard: choose the leaderboard to pull winners from. The automation rewards the top X entries where X = numberOfRecipients.
  • network: blockchain network to use for transfers (e.g., arbitrum-one).
  • wallet: the sending/reward wallet that holds the ERC‑20 tokens and gas. Add via Connections → Wallets and fund it with the token + native gas.
  • token: the ERC‑20 token contract to pay out (must be available on the selected network).
  • pointsToTokensMultiplier (optional): how many points equal 1 token. Example: if 10 points = 1 USDT, set multiplier = 10. With multiplier = 10000, 10000 points → 1 token. Defaults to 1.
  • numberOfRecipients (optional): distribute rewards to the top X leaderboard members (defaults to 1000).

Important notes & best practices

  • Conversion formula: tokenAmount = totalPoints / pointsToTokensMultiplier. Double‑check your multiplier so reward sizes match expectations.
  • Token decimals: specify token amounts in token units (e.g., a token with 18 decimals — sending 0.001 sends 0.001 tokens). The automation computes a decimal token amount from points.
  • Funding: ensure the reward wallet has both the ERC‑20 token balance and native gas funds on the selected network. Insufficient funds cause transaction failures.
  • Recipient resolution: the automation looks for the user’s connected EVM wallet (type EVM). If a user has no connected EVM wallet, the workflow logs a "No EVM wallet" entry and sends a notification instead of attempting a transfer.
  • Zero or too‑few points: if the computed token amount is 0 (totalPoints ≤ 0 or less than the multiplier threshold), the run logs a "No Points" entry and notifies you — no transfer is attempted.
  • Partial leaderboards: if numberOfRecipients > actual leaderboard size, extra positions are logged as "No user found on leaderboard for this reward."
  • Retry handling: transaction errors are recorded and notified. Fix funding/nonce/gas issues and re-run the automation for failed recipients.

Logs & notifications

  • A table named "Reward Distribution - <timestamp>" is created (or found) for each run. Columns: name, wallet, network, token, amount, txId, status, timestamp, position.
  • Notifications contain: user name, recipient wallet, network, token, computed amount (points / multiplier), status, tx id (if available), timestamp, position and a link to the reward logs table.

Example inputs (from this template)

  • token: 0xaf88d065e77c8cc2239327c5edb3a432268e5831
  • prizes: [0.006, 0.005, 0.004, 0.002, 0.001] (note: this specific workflow computes payouts from points using the multiplier; if you want fixed per‑position prizes use the fixed prize template)
  • wallet (sender): 0xe10ecb78924b34ae8d677ea97435aec6058a24f0
  • network: arbitrum-one
  • community: 0e08ae46-d158-498e-a74d-6889399de363
  • leaderboard: 153566ae-6bd8-4b51-a4d3-af3a5b79917a
  • numberOfRecipients: 2
  • pointsToTokensMultiplier: 10000

Quick example calculation

  • If a user has 3,500 points and pointsToTokensMultiplier = 10000 → 3,500 / 10000 = 0.35 tokens will be sent.

Tip

Before running, verify the reward wallet address, token contract and network alignment, and confirm that your community members have linked EVM wallets to avoid missed payouts.

Automations for every community

Domino Lets Anyone
Build Easy Web3 Automations

Do more with your dApps without technical skills or a coding know-how. Domino makes it easy to build and share new functionality for protocols, no matter if you're part of the team or the community!

App screenshot

Level Up Your dApps

Start using Domino in minutes. Use automations created by the others or build your own.

App screenshot