Ticket Mechanics & 3-in-1 Entry
On this page (5 sections)
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.
Daily Draw (D)
First chance to win on the date of purchase
Weekly Vault (W)
Enters the week-long cumulative vault pool
Monthly Grand (M)
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
QANXtoken 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:
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
nextTicketIdis5,001generates tickets#5,001through#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):
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:
| Schedule | Enrolled Period | Close Timestamp | Progression & Retirement Rules |
|---|---|---|---|
| Daily Draw (D) | UTC Day containing T | 23:59:59 UTC midnight | Competes in Day D. Winning tickets are retired; un-drawn tickets advance to Weekly and Monthly draws |
| Weekly Vault (W) | ISO calendar week containing T | Monday 00:00:00 UTC | Competes in active week among un-drawn tickets. Winning tickets are retired; un-drawn tickets advance to Monthly draw |
| Monthly Vault (M) | Calendar month containing T | 1st of next month 00:00:00 UTC | Competes in active month among un-drawn tickets from Day 1 to month close |
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
nextTicketIdand 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.