Launch App
Play & Draw Rules

Ticket Mechanics & 3-in-1 Entry

QanVault uses an optimized O(1) batch range storage model that enables players to purchase up to 10,000 tickets in a single transaction with minimal network gas, while granting every single ticket concurrent entry across three separate prize schedules.

1 Ticket (100 QANX) = 3 Automatic Prize Opportunities (Daily D, Weekly W, Monthly M)
50% Pot
Daily Draw (D)
00:00 UTC Daily

First chance to win on the date of purchase

7.5% Pool
Weekly Vault (W)
Monday 00:00 UTC

Enters the week-long cumulative vault pool

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

Enters the massive monthly community pot

Seed Reserve Architecture (30%): An additional 30% of sales funds tomorrow's Daily Pot (D+1) starting seed reserve. Tickets purchased today participate strictly in today's Daily draw (D) and do not roll over to future daily draws.


1. Ticket Pricing and Batch Architecture#

  • Token & Price: Tickets are purchased using the canonical ERC-20 / BEP-20 QANX token at a fixed price of 100 QANX per ticket (ticketPrice()).
  • Batch Scaling: Each transaction can purchase from 1 to 10,000 tickets.
  • $O(1)$ Constant Gas Efficiency:

Unlike legacy lottery contracts that mint and iterate individual NFT tokens or storage slots for every ticket, QanVault stores purchases as contiguous TicketBatch structs in a single storage write:

solidity
struct TicketBatch {
uint256 startTicketId;
uint256 endTicketId;
address owner;
uint64 purchaseTimestamp;
uint32 dayId;
uint32 weekId;
uint32 monthId;
}

Whether you purchase 5 tickets or 10,000 tickets, the contract performs only a single batch push to the ticketBatches array, keeping gas virtually constant (~1-3 Gwei / ~$0.02 - $0.05).


2. Contiguous Range Indexing & Ticket ID Resolution#

Every ticket receives a unique, sequential global identifier from nextTicketId:

  • A purchase of 1,000 tickets when nextTicketId is 5,001 generates tickets #5,001 through #6,000.
  • The contract updates the contiguous range tracker for each active schedule:
  • dayTicketRanges[currentDay]
  • weekTicketRanges[currentWeek]
  • monthTicketRanges[currentMonth]

Logarithmic O(log B) Owner Resolution

When a winning ticket is selected during draw settlement, the contract resolves the owner by performing a binary search over the ticketBatches array via getBatchForTicket(ticketId):

Search Time = O(log B)

Where B is the total number of batches created. This enables instant, gas-efficient ownership lookup without storing redundant ticket-level records.


3. The 3-in-1 Triple Chance Draw Entry#

Every ticket purchased during UTC timestamp T receives up to three opportunities to win across progressive prize schedules:

ScheduleEnrolled PeriodClose TimestampProgression & Retirement Rules
Daily Draw (D)UTC Day containing T23:59:59 UTC midnightCompetes in Day D. Winning tickets are retired; un-drawn tickets advance to Weekly and Monthly draws
Weekly Vault (W)ISO calendar week containing TMonday 00:00:00 UTCCompetes in active week among un-drawn tickets. Winning tickets are retired; un-drawn tickets advance to Monthly draw
Monthly Vault (M)Calendar month containing T1st of next month 00:00:00 UTCCompetes in active month among un-drawn tickets from Day 1 to month close
Important
Single-Win Ticket Rule: A single ticket can win at most one prize across all vaults. Once a ticket receives any prize tier (Daily Grand, Tier 2, Tier 3, Weekly, or Monthly), it is immediately retired and cannot be drawn again. Un-drawn tickets automatically advance to the next eligible draw.

4. Referral Program & Bonus Tickets#

  • Referee Welcome Bonus: New players who enter with a valid referral link and purchase 10 or more tickets in a single transaction automatically receive 2 free bonus tickets (+20% bonus) minted directly into their purchase batch (e.g. buying 10 tickets issues 12 tickets). This is strictly a one-time welcome bonus per wallet enforced directly by the smart contract state (hasReceivedWelcomeBonus); no wallet can ever receive more than 2 welcome bonus tickets.
  • Referrer Lifelong Bonus: Participants who share their referral link earn 1 free bonus ticket for every 10 paid tickets purchased by their referees across all current and future transactions forever.
  • On-Demand Claiming for Referrers: Referrer bonus tickets are claimed on demand via claimReferralBonusTickets(count) (up to 100 bonus tickets per transaction).
  • Draw Eligibility: Bonus tickets are assigned sequential ticket IDs from nextTicketId and enter the Daily, Weekly, and Monthly draws active at the moment of issuance/claim.
  • Identical Win Probability: Bonus tickets hold the exact same mathematical probability of winning as paid tickets.