How raffles work?

The raffle system consist in 4 well defined workflows:

Raffle start

The first workflow happens when a user selects an NFT from their wallet, a ticket coin and a ticket price and then starts a raffle. Once the user signs the transaction, the NFT prize will be sent to our smart contract and be locked along with 2 ADA until the raffle ends.

Buy tickets

Once the start transaction is confirmed and the NFT is locked in our smart contract, the raffle will be available in Labs website. Other users will then be able to buy tickets.

In order for a user to buy tickets, they must send enough coins to cover the number of entries they want. For example, if the ticket price is 10 $MUTANT and the user wants to buy 10 entries to the raffle, they will have to send 100 $MUTANT to our smart contract.

All those 100 $MUTANT will then be locked along with the NFT prize and be summed up to the rest of the amount already collected by the raffle.

NFT prize will always be locked in a single UTxO along with the total amount collected by the raffle. This process facilitates the prize claim in the end of the raffle and guarantees that the raffle owner or the raffle winner will be able to claim their prize in a single transaction.

Once a user buys a ticket, other users will have to wait for that transaction to be confirmed to buy new tickets. This is due to the Cardano UTxO format. We have to wait until a new UTxO is generated with the new total ticket amount so another user can buy tickets and generate a new total amount.

Draw winners

When a raffle reaches its end date users won't be able to buy more tickets for it. Our API will then generate the winner based on the raffle entries using MongoDB $sample functionality. The more entries you have, the more likely it will be for one of your entries to be drawn, but keep in mind that the only way for you to be sure you will win a raffle is if you have all the entries (100% chance) for that raffle. Even though it's very unlikely, even if you have 99% chance of winning a raffle you can still lose. The algorithm to select the winner is not owned by us and will never favor any entry candidate.

Claim prizes

Once we have a winner defined for the raffle, he/she will be able to claim the prize in the Rewards page. The raffle owner will also be able to claim 95% of the total amount collected for the raffle under Created tab on Raffles page. Only a single claim transaction has to be made, so if the winner claims the prize before the raffle winner, the raffle winner will automatically receive the prize in their wallet without having to do anything (and vice-versa).

Last updated