> For the complete documentation index, see [llms.txt](https://theluckyducks.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://theluckyducks.gitbook.io/docs/competition/jackpot.md).

# The jackpot

A pot of SOL and tokens that races pay into, won whole by one of the top players of each period. How a jackpot runs, who can win, how the winner is picked and how the prize is claimed.

The jackpot is a pot of SOL and tokens that builds up from races and is won, whole, by one of the top players of each period. There is no ticket to buy. You enter by racing well enough to finish the period near the top.

## How a jackpot runs

1. **A jackpot starts** and runs for a set number of days. Its start and end are written on chain at that moment and cannot be moved afterwards.
2. **Races feed the pot.** While it runs, every race that pays out sends a share of its prize pool to the pot.
3. **Players are ranked** on what they did during those days. The top of the ranking become the finalists.
4. **A winner is drawn** when the period ends, at 12:00 UTC on its last day. The finalists are published first, then a random number picks one of them. This takes a few minutes.
5. **The winner claims the whole pot**, and the next jackpot starts the moment the winner is known.

The Jackpot tab shows where the current one stands. At the top are the pot and a countdown to the draw, in days, hours, minutes and seconds. A row of boxes under them gives the jackpot's number (**Jackpot draw**), its length in days (**Period**), and when it **Starts** and **Ends**, in your own time zone. Then come the rules in force, what the pot holds, and the players in front under **Current standings**.

{% columns %}
{% column width="70%" %}

<figure><img src="https://3421471796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7dtEnU4lv7j0vOpw19z4%2Fuploads%2Fgit-blob-456039bcb7638cd4e3c4bafd67fb39b46471bf47%2Fapp-jackpot-tab-desktop.png?alt=media" alt="The Jackpot tab showing the pot, the countdown to the draw, the rules in force and the current standings"><figcaption><p>Where the jackpot stands: the pot, the clock and who is in front.</p></figcaption></figure>
{% endcolumn %}

{% column width="30%" %}

<figure><img src="https://3421471796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7dtEnU4lv7j0vOpw19z4%2Fuploads%2Fgit-blob-29508b5d95f715ba9a93c5e2c00ed7132aabab70%2Fapp-jackpot-tab-mobile.png?alt=media" alt="The Jackpot tab showing the pot, the countdown to the draw, the rules in force and the current standings, on a phone"><figcaption><p>On a phone</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

## Where the pot comes from

While a jackpot is running, every race that pays out sends a share of its prize pool to the pot, in the currency the race was run in: SOL from a SOL race, the token from a token race. That share is the jackpot fee. It sits beside the platform fee, and winners receive the pool less both. [Fees and prizes](/docs/economy/fees-and-prizes.md#the-jackpot-fee) has the rest: the rate and its ceiling, the arithmetic, what pays none, and how a race's creator switches it off for that race.

Two things about it matter on this page. The share is taken when the prize is claimed, and only [while a jackpot is running](#between-two-jackpots). And a race that feeds the jackpot carries the jackpot mark, while one that does not shows none and its winners keep that share.

<figure><img src="https://3421471796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7dtEnU4lv7j0vOpw19z4%2Fuploads%2Fgit-blob-8d11a0e1cfbfb12493967ec4ef32f5e23977eaec%2Fapp-jackpot-race-chip-banner.png?alt=media" alt="A race card header carrying the jackpot mark among its chips"><figcaption><p>The mark in a card's header: this race feeds the jackpot.</p></figcaption></figure>

While a jackpot is running, anyone can also send SOL or a supported token straight to the pot, which is how a sponsor tops it up.

## What the pot holds

The figure at the top of the Jackpot tab is the whole pot in dollars, or its SOL alone when [dollar figures](/docs/help/preferences.md) are switched off or no price is available. Under the rules, a dropdown lists what the pot is made of: SOL first, then every token it holds.

Each entry shows the token's icon and symbol with its address under them, shortened, beside a button that copies it in full. SOL has no token address and reads **Native**. Then come the amount, to 3 decimals, its dollar value when dollar figures are on, and a button that opens that balance in a block explorer. The pot's own address is not printed on the page: the explorer button on the SOL entry opens the account that holds it. The amounts update on their own as race prizes are claimed.

## Who can win

Only players who raced during the period can win. The platform sets the rules for each jackpot, and the Jackpot tab shows the ones in force, each in a box of its own.

| Rule                | What it decides                                             |
| ------------------- | ----------------------------------------------------------- |
| Period              | How long each jackpot runs: a number of days, from 1 to 30  |
| Ranked by           | The scoring rule of the period, one of the rules below      |
| Finalists           | How many of the top players are entered, from 1 to 50       |
| Players             | Everyone, or verified players only                          |
| Min. races required | How many races you must have run in the period to be ranked |

Every race counts toward the ranking: paid or sponsored, in SOL or in a token. You have to race to be eligible. Creating races is not enough on its own, even when the ranking is by races created, and a race you created counts only once it has run to a result: a cancelled one does not.

Meeting those rules is all it takes to be ranked, whatever your score. With the ranking by races won, a player who has raced and not won yet is ranked with 0 wins, below everyone who has won. So in a quiet period where 10 players raced and only 2 of them won, all 10 are ranked, and with 10 finalists all 10 go into the draw.

Players level on the score, at zero or at any other, are separated by the second figure on their row, the higher first. Players level on both are separated by the age of their player account: the one created earlier places higher. A rule change applies from the next period, never to the one being played.

### What you are ranked by

Each jackpot is ranked by one scoring rule. They are the rules [tournaments](/docs/competition/tournaments.md#scoring) use, applied to each player on their own, and the **Ranked by** box names the one in force.

| Ranked by                      | Your score                                                     | Second figure |
| ------------------------------ | -------------------------------------------------------------- | ------------- |
| Wins                           | Races won                                                      | Races run     |
| Races                          | Races run                                                      | Wins          |
| XP                             | XP earned from race results                                    | Wins          |
| SOL volume                     | SOL paid in entry fees                                         | Wins          |
| Podiums                        | Top 3 finishes                                                 | Wins          |
| Races created                  | Races you created that ran to a result                         | Races run     |
| Race size                      | The seats of the races you ran                                 | Races run     |
| Wins and races                 | Each win counts 0.6 and each race you run counts 0.4           | Races run     |
| Losses and races               | Each race you do not win counts 0.6 and each race you run 0.4  | Races run     |
| Last places and races          | Each last place counts 0.6 and each race you run counts 0.4    | Races run     |
| Races, double with a Boost NFT | Each race you run counts 1, and 2 when you run it with a Boost | Races run     |
| Races, double with a Duck NFT  | Each race you run counts 1, and 2 when you run it with a Duck  | Races run     |

The two rules that reward losing count taking part as well. One race run and lost scores 1. Eight races run with no loss score 3.2, and nine races with one loss score 4.2. So entering once and losing does not put a player ahead of those who keep racing.

**Current standings** lists the finalists as they stand and nobody below them: the players who would go into the draw if the period ended now. Each row shows the two figures the rule reads, and the score beside them when the score is made of both. A note under the list says that one of them wins the whole pot, and how the score is made when it adds two figures. When you are among them your own row is highlighted. Ranked lower, you are not listed and the tab does not state your place, so the score on the last row is the one to beat.

If you have raced and are not ranked at all, the tab says why above the list: too few races so far, or a period open to verified players only.

<figure><img src="https://3421471796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7dtEnU4lv7j0vOpw19z4%2Fuploads%2Fgit-blob-0aedf807e89a46b249eb5761e30a54a95ea98009%2Fapp-jackpot-standings-banner.png?alt=media" alt="The Current standings list, the finalists as they stand, with one row highlighted as the reader&#x27;s own"><figcaption><p>The players who would go into the draw if the period ended now.</p></figcaption></figure>

The jackpot is for players who are racing now, so only what you did during the period counts, and the program itself refuses a finalist who has not raced since the period began.

{% hint style="warning" %}
A finalist needs a player account that raced during the period. Close yours before the draw and you cannot be named, whatever your rank.
{% endhint %}

## How the winner is picked

When the period ends, the platform writes the finalists on chain and, in the same transaction, asks ORAO for a random number, the same provable source [every race uses](/docs/trust-and-fairness/fairness.md). When the number arrives, a published formula turns it into one position in that list, and the finalist in that position wins. Anyone can send that transaction, so nobody can sit on a result.

With the rules set to a single finalist there is no draw: the period's top player wins the pot. There is no minimum pot either. A pot is drawn whether it is large, mostly tokens, or small after a quiet period.

What you can rely on:

* **The dates are fixed in public.** A jackpot's start, end and length are written on chain when it starts and cannot be changed.
* **The finalists are public before the random number exists**, so the list cannot be chosen to fit a result.
* **Once the finalists are named, the pot can only go to the winner**, less the oracle fee for that draw's random number. From that moment nobody can stop the draw or redirect its prize, the platform included.
* **Before that, the platform can cancel a jackpot.** A cancelled jackpot has no winner, what its pot holds goes to the platform, and a new jackpot opens with an empty pot. See [Between two jackpots](#between-two-jackpots).

{% hint style="info" %}
The ranking is computed off chain, like tournament standings, which is what lets the rules change between periods. What the chain guarantees is everything after it: the list is fixed before the randomness, the pick follows from the two, and the prize cannot go to anyone but that finalist.
{% endhint %}

## Between two jackpots

Jackpots follow each other with no gap, unless the platform holds the next one back. For a race, what counts is the moment its prize is claimed, not when the race was created, and the create form says whether a jackpot is running right now.

| Situation                                            | What happens                                                                                                                                                                                            |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The winner is being drawn, which takes a few minutes | Races keep paying into the pot that is being drawn. The next jackpot starts the moment there is a winner, with standings from zero                                                                      |
| Nobody qualified, or the pot is empty                | There is no draw. The period still ends on its day, the pot keeps whatever it holds, and the next jackpot starts with that pot and fresh standings                                                      |
| The platform holds the next jackpot back             | The Jackpot tab shows that none is running. Nothing is collected meanwhile: a prize claimed then pays no jackpot share, and its winners keep it. A jackpot that is already running is never interrupted |
| The platform's rate is zero                          | New races stop feeding the pot. The jackpot that is running still ends as usual, and no new one starts while the rate is zero                                                                           |
| The random number is late                            | The draw waits, and the number is asked for again for the same finalists. A draw that has started is never cancelled                                                                                    |
| The platform cancels a jackpot before its draw       | It ends with no winner and what its pot holds goes to the platform. A new jackpot opens with an empty pot and standings from zero. Once the finalists are named this is no longer possible              |

## Claiming the prize

A jackpot is claimed, like a race prize. Win one and the Jackpot tab shows your prize at the top, with its Claim button, whichever list you are reading. The same Claim button ends the draw's **Jackpot details**, with what it pays written on it, and the prize appears with your other unclaimed winnings in the Unclaimed Items banner, where **Claim All** claims it after them. A jackpot prize always opens your wallet, so with one waiting Claim All asks your wallet to sign, even where your race claims would otherwise go through without it.

<figure><img src="https://3421471796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7dtEnU4lv7j0vOpw19z4%2Fuploads%2Fgit-blob-3ec2e3c3981a80578a8d82d12e8a72fcf6cb0274%2Fapp-jackpot-claim-banner.png?alt=media" alt="The jackpot prize you won at the top of the Jackpot tab, with what it holds and the claim button beside it"><figcaption><p>The prize you won waits at the top of the Jackpot tab until you claim it.</p></figcaption></figure>

* **You receive everything the pot held**: its SOL and every token, each in its own currency.
* **It lands in your wallet or your player vault**, following the same [payout target](/docs/economy/player-vault.md#where-your-winnings-land) your race prizes use.
* **A token you have never held needs a token account**, with the small deposit Solana asks to keep one open ([SPL token races](/docs/economy/spl-tokens.md#how-a-token-race-works) has the figure). The claim opens it and you pay it. It is yours, and comes back if you ever close the account.
* **A pot with many tokens is claimed in several transactions.** The app sends them in order and tells you how many are left.

{% hint style="success" %}
There is no deadline. An unclaimed prize waits for you, and nobody else can take it: anyone may send the claim, but the money can only go to the winner.
{% endhint %}

## Following along in Telegram

`/jackpot` in a group with the bot shows the jackpot that is running, and groups get a post at each stage of one. The Lucky Ducks X account may post the start and the winner too. See [The Lucky Ducks Telegram bot](/docs/help/telegram-bot.md#jackpot-announcements).

## Checking a draw yourself

**Past winners** on the Jackpot tab lists every draw: its number, its winner, its date, and its prize in dollars at the moment it was drawn. Select a draw to open its **Jackpot details**, laid out as the jackpot under way is: its prize in dollars beside whether it is claimed, its number and the dates of its jackpot, the rules it was ranked under, and a dropdown of each currency the prize held, with a link to where each one sat. Under them, sections open with a tap: its finalists in ranked order with the winner's row in gold, every transaction of the draw, and **Verify fairness**, which shows its request to ORAO for a random number, the transaction that used it, and the check. The check runs in your browser: it recomputes the winning position from the number ORAO published, and warns you if that is not the winner on record.

<figure><img src="https://3421471796-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7dtEnU4lv7j0vOpw19z4%2Fuploads%2Fgit-blob-660b6fc4ac2ff2f3cde9bf635e9b3e2a2d099da7%2Fapp-jackpot-verify-banner.png?alt=media" alt="A draw&#x27;s details: its prize, its dates, the finalists in ranked order with the winner highlighted, and its fairness check"><figcaption><p>A draw's details, with its winner recomputed in your browser from the number ORAO published.</p></figcaption></figure>

Once the winner has claimed the prize, the draw's details also hold a public archive of the draw, under **IPFS**: its finalists in ranked order, the random number, the winner and the claim that paid them. With it and the formula below, anyone can recompute who should have won without relying on the app at all.

<details>

<summary>The formula, for anyone who wants to recompute a draw</summary>

Take the 64 bytes ORAO published for the draw, append the text `jackpot_winner` and the draw's number as 4 little-endian bytes, and hash the result with SHA-256. Read the first 8 bytes of the hash as a little-endian number and divide by the number of finalists. The remainder is the winner's position in the list, counting from zero.

The draw's number is part of the hash so that 2 draws could never share an outcome by sharing a random number.

</details>
