# NFT Lottery

PaySwap enables normal users/businesses to launch and run their own lotteries. An NFT lottery is a lottery that rewards its players with non-fungible tokens. The tickets are purchased in fungible tokens but the prize won is one or multiple NFT tokens

Here is a step-by-step guide to launching your own NFT lottery:

* Go to the [lotteries page](https://payswap.org/lotteries) and click on the **Create Lottery** button

<figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-ca745eddeadd3603344f3c8f33e67db36d5ab0ec%2Flottery5.png?alt=media" alt=""><figcaption></figcaption></figure>

* Fill in the form with the appropriate values and validate the transaction. You can read the description of each parameter by hovering your cursor over the help icon next to each parameter.\
  Make sure you pick the type of your NFT reward for the NFT prize parameter.

<figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-26716c9f8ba48d0c8709cfde69f02096f89bd1d6%2FScreenshot%20from%202024-02-05%2010-55-11.png?alt=media" alt=""><figcaption></figcaption></figure>

You can learn more about how lotteries work by reading the documentation on the page below:

{% content-ref url="" %}
[](https://docs.payswap.org/products/lottery)
{% endcontent-ref %}

* After you've deployed your lottery, reload the page and tick the **Mine Only** button to only show your lotteries. This will enable you to find your lottery faster.

<figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-9db1383d24cb84fa553d966a9ee050c20f8a7061%2Flottery4.png?alt=media" alt=""><figcaption></figcaption></figure>

* For a list of all the functions you have access to, to run your lottery, click on the **Control Panel** button to view its menu of functions
* The next step is to add tokens to your NFT lottery, these are the fungible tokens with which your users will be purchasing your tickets. You can add as many tokens as you please but you have to also add a ticket prize for the token you are adding. To add a token, go to your lottery's control panel menu and click on the **Add New Token** button. Fill in the form with appropriate information and validate the transaction

<div><figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-77d9a94a30ea4ba70142325a5e597d74419fdf82%2FScreenshot%20from%202024-02-05%2012-39-45.png?alt=media" alt=""><figcaption></figcaption></figure> <figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-7b3fe57d76fe81d65ebb10684ae2e9e0987e51be%2FScreenshot%20from%202024-02-05%2012-40-03.png?alt=media" alt=""><figcaption></figcaption></figure></div>

* You should see your added tokens listed in the bottom left section of your lottery's panel.
* The step after that is to add your NFT prizes. To do so, click on the **Add NFT Prize** button in the control panel menu of your lottery

  <div><figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-77d9a94a30ea4ba70142325a5e597d74419fdf82%2FScreenshot%20from%202024-02-05%2012-39-45.png?alt=media" alt=""><figcaption></figcaption></figure> <figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-21448923322df66de083bb3854c1e33ab372bb81%2FScreenshot%20from%202024-02-05%2012-53-05.png?alt=media" alt=""><figcaption></figcaption></figure></div>

  Fill in the form and validate the transaction. Your NFT prize will be transferred from your wallet to the lottery helper contract for lottery players to win. You can add as many prizes as you wish. You should be able to see your NFT prizes from the [lotteries page](https://payswap.org/lotteries) by clicking on the **View NFT Prize** button

<figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-0b804809cd0331d1ec5428896dbb86db0ddbafa1%2FScreenshot%20from%202024-02-05%2012-55-41.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-6f353f7acc3179a6311c2d05e30c149ad9a323e2%2FScreenshot%20from%202024-02-05%2012-56-11.png?alt=media" alt=""><figcaption></figcaption></figure>

You can also view your NFT prizes by going to your lottery's page (click on the **View Lottery** link)

<figure><img src="https://3481829468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbuuWgsRQF3QPmDvV7XJQ%2Fuploads%2Fgit-blob-07a3767a36e2528fd86711ccc1e37bfd0cf49b71%2FScreenshot%20from%202024-02-05%2012-57-45.png?alt=media" alt=""><figcaption></figcaption></figure>

## Buying Tickets, Closing Lottery, Drawing Final Numbers

These steps are exactly the same as in the [FT Lottery](https://docs.payswap.org/products/lottery/ft-lottery) and you should read those guides if you're looking to know how to perform them.

## Note

NFT lotteries can be a formidable way to sell your NFTs or to purchase new NFTs.

Take an NFT that might be worth 100k USD, put it in an NFT lottery, sell the tickets for 100 USD to 1k people, and voila! You've sold your NFT and the winner of the lottery just won a 100k USD NFT for just 100 USD.

[Get further support from the community here.](https://paychat.payswap.org/#/room/%23paycom%3Amatrix.org?via=matrix.org)


---

# 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://docs.payswap.org/products/lottery/nft-lottery.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.
