Play & Draw Rules

Ticket Mechanics & 4-in-1 Entry

Understanding how tickets are minted, indexed, and evaluated across multiple concurrent draw tiers is essential to understanding QanVault's architectural elegance.


Ticket Fundamentals#

  • Fixed Price: 100 QANX per ticket.
  • Minimum Purchase: 1 ticket (100 QANX).
  • Maximum Purchase per Transaction: Configurable by network gas limit (typically up to 5,000 tickets per transaction).
  • Settlement Asset: Wrapped QANX on BNB Smart Chain.

Contiguous Integer Range Indexing#

Unlike legacy on-chain lotteries that push individual ticket structs into massive dynamic arrays, QanVault employs Contiguous Integer Range Indexing.

When a player buys N tickets in transaction k:

\text{Ticket Range} = [T_{\text{start}}, T_{\text{end}}] \quad \text{where} \quad T_{\text{end}} = T_{\text{start}} + N - 1

Example

If the contract's cumulative ticket counter is currently at 4,500 and a user buys 500 tickets:

  • T_{\text{start}} = 4,501
  • T_{\text{end}} = 5,000
  • A single compact record is written to storage:
solidity
  struct TicketBatch {
      address owner;
      uint64 startId;
      uint64 endId;
      uint32 purchaseTimestamp;
      uint32 drawDateId;
  }

Why Contiguous Ranges Matter

  1. $O(1)$ Gas Efficiency: Minting 1,000 tickets consumes the same base gas as minting 1 ticket, because only one range record is written.
  2. Binary Search Winner Lookup: When a random winning ticket ID is drawn (e.g. ticket #4,723), the contract identifies the winning owner using binary search in O(\log B) time, where B is the number of purchase batches, requiring zero loop iterations.
  3. No Storage Bloat: Avoids storing millions of individual token IDs, keeping state growth minimal.

4-in-1 Multi-Draw Entry Matrix#

Every ticket purchased is automatically registered into four distinct draws:

1 Ticket (100 QANX) = 4 Automatic Prize Opportunities
50% Pot
Daily Draw (D)
00:00 UTC Daily

First chance to win on the day of purchase

30% Pot
Daily Draw (D+1)
Following Day 00:00 UTC

Free automatic re-entry the very next day

7.5% Pot
Weekly Jackpot (W)
Monday 00:00 UTC

Enters the week-long cumulative prize pool

5.0% Pot
Monthly Grand (M)
1st of Month 00:00 UTC

Enters the massive monthly community pot

1. Current Day Daily Draw (D)

  • Eligibility: All tickets purchased between 00:00:00 UTC and 23:59:59 UTC on calendar day D.
  • Pot Share: 50% of all ticket inflows during day D, plus any rollovers from day D-1.
  • Draw Time: Triggered daily at 00:00:00 UTC.

2. Following Day Daily Draw (D+1)

  • Eligibility: All tickets purchased on day D automatically re-enter the next daily draw (D+1).
  • Pot Share: 30% of day D's ticket proceeds are reserved exclusively to fund this follow-up pot.
  • Player Benefit: Every player gets two full daily opportunities to win with a single ticket purchase.

3. Weekly Jackpot (W)

  • Eligibility: Every ticket purchased throughout the current ISO calendar week (Monday 00:00:00 UTC to Sunday 23:59:59 UTC).
  • Pot Share: 7.5% of all ticket inflows over the 7-day period.
  • Draw Time: Triggered every Monday at 00:00:00 UTC.

4. Monthly Grand Jackpot (M)

  • Eligibility: Every ticket purchased during the entire calendar month.
  • Pot Share: 5.0% of all monthly ticket inflows.
  • Draw Time: Triggered at 00:00:00 UTC on the 1st of each month.

Zero Double Counting Invariant#

The protocol strictly guarantees that funds are never double counted or cross-contaminated:

\sum_{i=1}^{5} \text{Allocation}_i = 50\% + 30\% + 7.5\% + 5.0\% + 7.5\% = 100.0\%

Each pot operates as an independent balance ledger. Winning in Daily Draw D does not invalidate a ticket's eligibility for Daily D+1, Weekly W, or Monthly M. A single lucky ticket can theoretically win all four draws.


Next Steps#