Distribute Rewards to Leaderboard Toplist

Automatically send ERC‑20 prizes to the top N leaderboard winners and record every transfer.

Overview

Distribute ERC‑20 rewards to the top performers on a Domino leaderboard in one run. This automation: fetches the top X leaderboard entries (where X is the number of prize rows you provide), resolves each user’s connected EVM wallet, sends the configured token amounts from your reward wallet, and writes a timestamped log table with status, tx IDs and notifications for success/failure.

How it works

  1. Trigger the automation (manual webhook trigger).
  2. Get the leaderboard entries limited to the number of prizes you provided.
  3. Loop over each prize (prize array order = leaderboard position):
    • Fetch the corresponding leaderboard user and their connected EVM wallet.
    • If a valid EVM wallet exists, send the 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 or transaction error): record a failure row and send a failure notification explaining the reason.

Setup (what to provide)

  • community: select the community containing the leaderboard.
  • leaderboard: choose the leaderboard to pull winners from. The action will reward the top X entries where X = number of prizes.
  • prizes: an ordered array of amounts (first element = 1st place prize, second = 2nd place, …). Provide values in token units (match the token decimals). Example: [0.006, 0.005, 0.004, 0.002, 0.001].
  • token: select the ERC‑20 token contract to pay out (must be available on the selected network).
  • wallet: the sending/trading wallet that holds the reward tokens and gas. Add via Connections → Wallets and top up with token + gas funds.
  • network: network to use for transfers (e.g., arbitrum-one). Ensure token and wallet are funded on this network.

Important notes & best practices

  • Prize order matters: the first prize corresponds to leaderboard position 1. Add as many prize rows as positions you want to pay out.
  • Amount units: amounts should be specified in token units (adjust for decimals). If you use a token with 18 decimals, sending 0.001 will send 0.001 tokens.
  • Funding: make sure the reward wallet has both the token balance and native gas funds on the specified network, otherwise transactions will fail.
  • Recipient resolution: the automation looks for the user’s connected EVM wallet (type EVM). If the user has no connected EVM wallet, the workflow logs a "No EVM wallet" entry and sends a notification instead of attempting a transfer.
  • Partial leaderboards: if you supply more prize rows than there are users on the leaderboard, the workflow will log "No user found on leaderboard for this reward" for those extra positions.
  • Retry handling: transaction errors are recorded and notified. You can re-run the automation after fixing funding or other issues.

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, amount, 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]
  • wallet (sender): 0xe10ecb78924b34ae8d677ea97435aec6058a24f0
  • network: arbitrum-one
  • community: <your-community-id>
  • leaderboard: <your-leaderboard-id>

Tip

Double-check the reward wallet and token network alignment before running. Also confirm that your users have linked EVM wallets in their profiles 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