# MDAO Maker lottery and ticket distribution mechanics

The description of the mechanics of how the** ****MDAO Maker**** **works is a handy guide to how the lottery and ticket distribution works on our site. In this section, we will describe this process using clear examples.

Let’s imagine that a new project called **TEST **has appeared on the **MDAO Maker**** **and has a token of the same name. We know the following about the **TEST **project:

- The project allocation is $10,000
- Number of winning tickets — 100
- Number of tickets available for payment — 50
- One winning ticket gives the right to buy an allocation for $200.
- There are three users: A, B and C.
- MDAO Telegram

A — 100,000 MDAO

B — 25 100 MDAO

C — 1 700 MDAO

***

In the **Subscription **phase, all three users fulfill the conditions of having a minimum number* of **MDAOs **in their **MDAO Telegram Wallet.**

** For this example, the minimum number of MDAO on your MDAO Telegram*** ***Wallet to participate in the TEST project on the MDAO Maker Launchpad is 1000 MDAO.*

***

During the **Hold **phase, each user maintained the existing balance on their **MDAO Telegram Wallet**, so the average balance turned out to be equal.

At the Ticket Distribution stage, users received:

A — 100 tickets

B — 25 tickets

C — 1 ticket

***

At the beginning of the **Lottery **stage, it is necessary to remember that certain multipliers affect the chance of a regular ticket becoming a winning one:

- from a minimum number of
**MDAOs**to participate, the success multiplier gives + 10% - from 10 000 MDAO, the success multiplier gives + 20%
- from 25 000 MDAO, the success multiplier gives + 30%
- over 50 000 MDAO, the success multiplier gives + 40% + 1 guaranteed winning ticket

Because users with significant balances have a higher success multiplier, there was initially a high probability that such users would pick up most of the winning tickets. This, in turn, would prevent other users from participating and purchasing an allocation.

Because of this, it was decided to make a cyclic determination of the winning tickets among all users:

- The algorithm starts the analysis from the largest holder to the minor holders (with the minimum MDAO holding amount on the MarsDAO Wallet).
- From the beginning, the algorithm analyzes users with a balance of 50,000 MDAO or more.
- As soon as the user gets one winning ticket, the algorithm switches to the following user and repeats itself.

When the analysis of all users holding **50K MDAO** or more in their **MDAO Telegram Wallet** is complete, users with balances of **25K MDAO** or more are checked. Then the algorithm repeats the above-described scheme and moves on to users with balances higher than **10K MDAO**.

Thus, eventually, the algorithm begins analyzing users whose balance is higher than the minimum amount required by the project.

***

The next step starts **a cycle where the algorithm repeats all the above steps.** The algorithm begins to reanalyze all users’ tickets holding **50K MDAO** or more, except for tickets already won from users.

The algorithm then moves on to the subsequent users by balance spread and repeats the process until the number of winning tickets previously defined for the project is reached.

**Here’s an example:**

User A received 100 tickets and is guaranteed 1 winning ticket among all their tickets. Accordingly, in the next step of determining the winning ticket, the algorithm will choose from only 99 tickets.

Next, the algorithm moves on to user B. They have 25 tickets, which is quite a large number, and the success multiplier is 30%. With such a large number of tickets, the probability of the user not getting the winning tickets is small, but it is still there. Suppose the user receives one winning ticket. For the next round, there are 24 left.

Let’s move on to user C. The user has only one ticket and a small success multiplier. The user still has a chance of getting a ticket, but for example, we will assume that their only ticket lost the lottery draw. At this point, the user did not get the winning ticket. But they still have that same ticket for the next cycle.

The cycle then repeats until the maximum number of winning tickets is accumulated. Tickets are determined randomly, so we can also assume by chance that users received the following number of winning tickets (with 40 cycles of selecting winners):

A — 33 winning tickets

B — 16 winning tickets

C — 1 winning ticket

***

**A short formula for determining the probability of an regular ticket becoming a winning ticket:**

For 50K MDAO and higher:

*IS_WINNING_TICKET = random([[True, 40], [False, 60]])*

**40 — the probability that the ticket will be the winning one*

***60 — the probability that the ticket will not win*

For 25K MDAO and higher:

*IS_WINNING_TICKET = random([[True, 30], [False, 70]])*

For 10K MDAO and higher:

*IS_WINNING_TICKET = random([[True, 20], [False, 80]])*

From minimum MDAO balance and above:

*IS_WINNING_TICKET = random([[True, 10], [False, 90]])*

***

**The MDAO Maker Lottery** is one of our launchpad’s mechanics that allows multiplying your capital by investing a certain amount of MDAO. Purchase tickets, compete for an allocation, and win!