# Lotteries? Wow!

Raffle runs only one lottery at a time.

In order for people to participate, lottery must be 'opened' or 'created' by an admin (contract owner).

There will be periods of time in which no lotteries are running and users cannot participate. During these 'closing' periods, lottery parameters can be adjusted for the next lottery, so to have a variety of games all different from one another.

Also, during closing time, users can mint [$RAF tokens](/raffle/usdraf-tokens.md), which are needed to enter the lottery once it opens up. $RAF tokens can be minted at any time, also if a lottery is already running, so to be able to enter the game by spending the just minted $RAF tokens.

What users spend to mint $RAF tokens contributes to fill the Jackpot for the current lottery, if open, or next lottery, if we are in closing time.

You can think of $RAF tokens as the equivalent of a lottery ticket, except it's not yet played: when a player enters the lottery, he pays with 1 $RAF and the token gets entirely burned.

Each lottery has different parameters that determine it's duration, the prize won by participants and other aspects. Let's see them in detail:

### **💯 Magic Number**

Represents user chances to be a winner using a [basic ticket](/raffle/luck-factor.md).\
If we have a <mark style="color:yellow;">Magic Number</mark> of 8, we'll have 1 winner every 8 participants.\
The <mark style="background-color:purple;">higher this number</mark> is, the less winning chances users have, and the <mark style="background-color:purple;">higher the prize</mark> will be.

### 👨‍👩‍👧‍👦 Minimum participants

It's the minimum number of tickets needed to be entered before a lottery draw can be triggered.\
This will always be higher than the Magic Number.

### ⏰ Hurry Up Time

Once the minimum number of participant is met, a countdown will start (likely 24 hours).\
Once the countdown is over, lottery draw can be triggered by any user.\
This countdown is named <mark style="color:yellow;">Hurry Up Time</mark>.\
If a lottery is in *Hurry Up Time,* users can still mint [$RAF](/raffle/usdraf-tokens.md) and enter the lottery.\
The ingredients used for minting $RAF during the *Hurry Up Time* are still being used for the current lottery Jackpot.

### 🍀 Max Luck Bonus

Briefly: how much you can push your ticket luck by spending more TITANX tokens when you enter the lottery.\
For a detailed explanation of Luck Bonus, see the dedicated section: [Tickets & Luck Factor](/raffle/luck-factor.md).

Each lottery can have its own different maximum Luck Bonus.\
This is done to balance the use of ETH and TitanX when users wish to have more chances to win, and to mitigate or diversificate the whale impact on the lotteries.

### Max Ecosystem Boost

Similar to Luck Bonus, Ecosystem Boost is an increase of tickets luck, obtained by spending Ecosystem Tokens instead of TITANX. Only tickets who have a maximized Luck Bonus can access Ecosystem Boost.

Luck "bought" with Ecosystem Tokens is <mark style="background-color:yellow;">cheaper</mark> than Luck obtained with TITANX.

### 🧸 SuperJackpot vs SuperLuck mode

Lotteries can run in "Super Jackpot" mode, or in "SuperLuck" mode.

#### 🎈 SUPER JACKPOT

1 winner is picked every time the number of participats reaches multiples of [Magic Number](#magic-number).\
Examples:

Magic Number for the current lottery is 10.

* If we have 10 entries, 1 winner gets extracted and he gets 100% the Jackpot.
* If we have 19 entries, still only 1 winner gets picked. The 9 extra entries are not enough to reach 20 to have a second winner. Winner prize is \~90% higher.
* If we have 25 entries, 2 winners get extracted. Winners get +\~25% than a regular prize if there were 20 entries.

Formula for the **extra % prize**:\
&#x20;`100 * (MagicNumber * extra entries above the multiple / Magic Number) / (participants - Magic Number).`

#### 🎈 SUPER LUCK

1 extra winner is extracted if entries are more than a multiple of the Magic Number.\
Prize will be lower, but chances to be a winner wil be higher.\
Examples:

Magic Number for the current lottery is 8.

* If we have 8 entries, 1 winner gets extracted and he gets 100% the Jackpot.
* If we have 9 entries, 2 winners get extracted. The jackpot is divided by the 2 winners.\
  Instead of having 1 on 8 chances to win, participants have 1 on 4.5 chances to win.

Formula for the winning chances:

`1 / (participants / ([participants/MagicNumber] + 1))`

\
Formula for the absolute extra % luck (e.g. you had 12.5% chances, now you have 22.22%, it's an absolute +9.72%):

`100 * (1 / (part / ([part/mn] + 1)) - ([part/mn]/([part/mn]*mn)`

Formula for the relative extra % luck (e.g. you had 12.5% chances, now you have 22.22%, it's a relative +77.6% ):

```
A = 1 / (participants / ([participants / MagicNumber] + 1))
B = [participants / MagicNumber] / ([participants /MagicNumber] * MagicNumber))
Luck impact +% = 100 * (A-B) / B
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dave-davinci.gitbook.io/raffle/lotteries-wow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
