🌟Draw & Rules

Normally, each round of betting lasts for 24 hours. The betting rate of the round needs to be greater than or equal to 100% to meet the conditions for a draw. The trigger will be checked every 2 minutes. The round that meets the conditions for the draw will automatically end, and then the next round will be started.

  1. The Round Duration is ≥ 24 hours, and the difference between the end time and the start time must be ≥ 24 hours.

  2. The Betting Rate ≥ 100%, When a round starts, 50% of the previous round's pool balance will be allocated as the basic rewards. Betting rate = (total betting amount / basic rewards) * 100%.

Round Switching

As mentioned above, the betting rate of a round may not reach 100% within the expected time. If the opening time exceeds 24 hours, the round will exist in one of the following three states:

  1. The opening time exceeds 24 hours, and the betting reaches 100%. The next round will start immediately, and the betting records of the current round will be archived, waiting for the draw.

  2. If the opening time exceeds 24 hours but the betting rate does not meet the lottery conditions, the current round will remain open for new bets until the betting rate reaches ≥ 100%.

  3. If the opening time exceeds 168 hours and the betting rate is still less than 100%, the round will be canceled. Since the drawing conditions are not met, all bets in this round will be refunded to users, and the basic rewards will be transferred to the next round.

Lucky Numbers

The lucky numbers are generated at the 5th block height after the round ends. The lucky numbers are generated based on Issac Cipher. The hash of the block (the block height of the round ends + 5), the number of participants, the number of bets in the round, and other unpredictable factors are used as the seed of the random function. This ensures that the number generation is random, verifiable, and unpredictable:

  1. Unpredictability: Arweave's block hash is a unique ID generated by all transaction contents of the block. The hash of the 5th block after the round ends means that no one can predict the seed of the lottery algorithm during the betting period.

  2. Verifiability: The random number function of the Issac Cipher generates a certain result when the seed is determined, which means that the lucky numbers generated by the CU node can be verified, avoiding the possibility of black-box operations by the CU (computing unit) node during execution;

  3. Randomness: The 3-digit number is not generated at one time, but the random function is called bit by bit, and the uniform seed and position number are used as input to generate random values ​between 0-9, respectively, which ensures the randomness of the value distribution of the 3-digit number.

example of the lottery algorithm
--[[
  The initial input for the lottery algorithm is a string that contains the following information::
  ao.id: the process ID of the pool;
  Block.Hash: the block hash of the Arweave blockchain;
  Round.no: the no of the round;
  Round.TotalBets: the number of bets in the round;
  Round.Participator: total user of this round;
]]--
local seed = ao.id..Block.Hash..Round.no..Round.TotalBets..Round.Participator

local getLuckyNumber = function(seed,len)
  local numbers = ""
  for i = 1, len or 3 do
    local n = crypto.cipher.issac.random(0, 9, tostring(i)..seed..numbers)
    numbers = numbers .. n
  end
  return numbers
end

local luckyNumber = getLuckyNumber(seed,3)

Rewards Distribution

After the round ends, 50% of the pool balance will be transferred to the next round, so the actual reward is 50% of the total pool balance: Actual reward = (basic reward + bets amount) * 0.5. After the lucky number is generated, the lottery machine checks the betting records in the round, and the bets with completely matching numbers are considered winning bets:

  1. Winning bets <1, no one wins in the round, the reward will be evenly distributed to all participants in the pool, according to the proportion of each participant's total bets: actual reward for each participant = reward / total bets * participant's total bets.

  2. Winning bets ≥1, If there are one or more winning bets, the winners with winning bets share the reward equally: actual reward for each winner = reward/total winning bets * winner's winning bets.

For rounds that do not meet the lottery conditions and are forcibly canceled, the participants' bets will be refunded. This scenario is not included in the rules described above.

Check lottery results

After the draw, the winner will receive a Win-Notice from the Pool process. Use Inbox[#Inbox].Data to print the message data to view the winning amount. If you miss the message, you can query the winners of the round using the command below.

Send({Target=POOL,Action="Winners",Round="1"})

You can also follow Aolotto's official Discord to get the latest winning announcement in real-time.

Last updated