Skip to main content

Completing Draw Auctions

In order for PoolTogether to work, a random number is required to choose winners and complete draws. PoolTogether incentivizes anyone looking to request and relay random numbers from a trusted and verifiable RNG service.

To earn from completing draw auctions you will need to:

  1. Check to see if there are open auctions
  2. Compute the rewards that can be earned
  3. If completing an auction is profitable, execute a transaction to complete it
  4. Periodically withdraw the rewards you have earned from the Prize Pool

1. Check for Open Auctions

There are two auctions that need to take place before the draw is awarded. The first is the startDraw auction which triggers a random number to be generated by the designated RNG source. Once generated, the finishDraw auction is completed to award the draw with the generated random number.

To check if the startDraw auction can be triggered, call the canStartDraw function on the DrawManager. Likewise, the canFinishDraw function can be called to check if the finishDraw auction can be completed.

The startDraw auction process may be slightly different on each chain and depends on the RNG source that is being used for the prize pool. For example, Witnet is used on the Optimism deployment and can be started by calling the startDraw function on the RngWitnet contract associated with that deployment. Check the deployment contracts for each chain to see which RNG source is being used.

2. Compute Rewards

To compute the rewards (denominated in prize tokens) the startDrawReward and finishDrawReward functions can be called before completing each associated auction.

3. Completing an Auction

If an auction is profitable and can be completed, trigger the associated function to complete the auction and earn the reward. The rewards are accumulated in the rewardRecipient's balance on the prize pool and can be withdrawn at any time.

4. Withdrawing Rewards

Rewards for the rewardRecipient will be stored as a balance on the Prize Pool contract. You can check the balance of a reward recipient by calling rewardBalance, and you can withdraw using withdrawRewards.