Offer cost-effective incentives

"Sign up and fund your account for a chance to win $1,000,000"

"Top 10 in the leaderboard get a chance to win $1M"

Instantly incentivize any action on your app in 1 hour. Most people overvalue a shot at $1,000,000 even if the ticket is less than $1. That's why Robinhood's “sign up for a free stock” offer went viral.

Demos & Examples

Developer API: Speed up development with our data APIs.

Community Example

Moai Cash, a Telegram mini app, incentivizes signups with free Megapot tickets. Try it here!

How to Gift Tickets

Set your wallet address as the referrer parameter to the ticket purchase function and add the recipient parameter to the ticket purchase function of the wallet you want to gift the tickets to.

Walkthrough

Let's take a look at the purchaseTickets function:

purchaseTickets(address referrer, uint256 value, address recipient)
  • referrer: Your wallet address. Triggers the contract to pay you 10% of the ticket price for each ticket purchased.

  • value: The number of tickets to purchase, in szabo (6 decimals). 1_000_000 szabo = 1 ticket.

  • recipient: The address of the recipient of the tickets. This is the wallet of the person receiving the ticket(s).

Just set yourself as the referrer parameter and the recipient parameter to the wallet you want to gift the tickets to.

Example

Let's say you want to gift 1 ticket to the jackpot. You would set the referrer parameter to your wallet address and the value parameter to 1 tickets.

purchaseTickets(
    address referrer,
    uint256 value,
    address recipient
);

purchaseTickets(
    0x1234567890123456789012345678901234567890, // referrer
    1000000,                                    // value
    0x7890123456789012345678901234567890123456  // recipient
);

Getting Purchased Tickets Info

You can get the number of tickets purchased by a wallet by calling the usersInfo function with the recipient wallet address as the parameter.

usersInfo(address user)

This will return some data about the wallet. The ticketsPurchasedTotalBps is the number of tickets purchased by the wallet this round. To get the number of tickets purchased, you can divide this number by 7000. Our contract uses a basis points number to calculate tickets in the contract. Every ticket is worth 10_000 ticket units (See our deep dive). 30% of the ticket price goes to LPs & referral fees. So to calculate the number of tickets purchased, you divide the total bps by 7000.

uint256 ticketsPurchased = usersInfo.ticketsPurchasedTotalBps / 7000;

Last updated