Launch App
Getting Started

How It Works

QanVault is an autonomous, provably fair Web3 prize protocol built on BNB Smart Chain. By combining O(1) batch storage architecture with Chainlink VRF v2.5 verifiable randomness and segregated mathematical reserves, QanVault delivers seamless multi-tier vaults with zero custodial risk.

01

Stage 1: Direct QANX Ticket Purchase

Direct Payment

Players approve and pay the configured QANX token on the configured settlement chain. Verify ticketPrice on the deployed vault.

Configured QANXOnly the vault's immutable ERC-20 token is accepted
Other AssetsBNB, ETH, USDT and arbitrary-token payments are unavailable
Configured ChainPurchases and claims use the same deployment
Transaction ReceiptConfirmed TicketsPurchased events establish ticket issuance
02

Stage 2: Deterministic Escrow Allocation

10,000 bps Split

Upon receipt, the smart contract immediately and deterministically partitions the 100 QANX per ticket across 5 segregated accounting reserves.

50% Daily (D)Purchase-day pool closes after the next UTC midnight
30% Daily (D+1)Next-day seed funding only; no D+1 ticket eligibility
7.5% Weekly (W)ISO week vault closing every Monday at 00:00:00 UTC
5.0% Monthly (M)Grand monthly vault closing on the 1st of each month
7.5% Protocol TreasuryAccrued treasury fees for infrastructure, keeper gas, and discretionary growth
03

Stage 3: Provably Fair Draw Execution

Verifiable VRF

Anyone may close an ended period and settle after the original Chainlink VRF request fulfills. Transaction execution is required.

Interval SealingClosure fixes the ended period's eligible count and pool
Coordinator FulfillmentThe original seed feeds a sparse shuffle without replacement
Outage RiskNo retry or cancellation; a pending pool can remain locked indefinitely
04

Stage 4: Canonical Prize Claim & Settlement

Same-Chain Claims

Prizes are paid in the configured QANX token on the settlement chain. Gas, confirmation and token transfer availability are required.

72-Hour Claim WindowWinning wallets claim directly from non-custodial smart contracts
Expiry Processing7.5% treasury fee; remainder reserved for the day after processing
Residual RisksContract, token, oracle and network failures can block funds

1. Direct QANX Ticket Purchase#

Every entry starts by purchasing tickets directly through the smart contract on the configured settlement chain (BNB Smart Chain).

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.

Key Purchase Mechanics

  • Settlement Token: Purchases are denominated in the canonical BEP-20 / ERC-20 QANX token.
  • Fixed Ticket Price: Each ticket is priced at exactly 100 QANX (ticketPrice()).
  • High-Throughput Batching: Purchase up to 10,000 tickets in a single transaction. The contract records entries in O(1) constant time via TicketBatch contiguous ranges, keeping network gas negligible (~1-3 Gwei / ~$0.02 - $0.05).
  • No Daily Wallet Limits: There is no daily or lifetime cap per wallet. Participants can acquire additional batches at any time while the draw window is active.
  • On-Chain Proof: Confirmed blockchain receipts emit the TicketsPurchased event containing your starting ticket ID, count, and period IDs.
Note
Network gas is paid in native BNB. The smart contract core settles strictly in canonical QANX to ensure prize funds are never exposed to frontrunning or swap slippage, while the web application provides automated conversion for BNB and BSC tokens via PancakeSwap, as well as cross-chain assets across Ethereum, Base, Arbitrum, and Polygon via Symbiosis Finance.

2. Deterministic 5-Way Reserve Allocation#

When a ticket is purchased for 100 QANX, the funds never pool into an opaque company wallet. Instead, the smart contract immediately and deterministically partitions the 100 QANX across 5 segregated accounting reserves (10,000 basis points total):

Inflow Source

Allocation Example: 100 QANX Paid Ticket

10,000 Basis Points Total Allocation

50.0%5,000 bps
Daily Pot (D)
50.0 QANX
00:00:00 UTC Daily Draw
30.0%3,000 bps
Daily Seed Reserve (D+1)
30.0 QANX
Seeds Tomorrow's Pot (tickets do not carry over)
7.5%750 bps
Weekly Vault (W)
7.5 QANX
Monday 00:00:00 UTC
5.0%500 bps
Monthly Vault (M)
5.0 QANX
1st of Each Month
7.5%750 bps
Protocol Treasury
7.5 QANX
Accrued treasury reserves
Allocation BucketShareAmount per TicketPurpose & Timing
Active Daily Vault (D)50.0%50.0 QANXFunds today's active daily vault pool closing at 00:00:00 UTC
Next-Day Seed Reserve (D+1)30.0%30.0 QANXSeeds tomorrow's initial daily vault pool so every day starts funded
Weekly Vault (W)7.5%7.5 QANXAccumulates across the ISO calendar week, drawing Monday at 00:00:00 UTC
Monthly Vault (M)5.0%5.0 QANXAccumulates across the calendar month, drawing on the 1st at 00:00:00 UTC
Protocol Treasury7.5%7.5 QANXSustains decentralized infrastructure, keeper gas, and discretionary ecosystem growth or marketing, with no guaranteed schedule or expectation of return
Important
The 30% allocated to D+1 acts purely as seed capital for tomorrow's vault. Tickets purchased today participate exclusively in today's Daily draw (D), Weekly vault (W), and Monthly vault (M). They do not dilute or roll over into tomorrow's daily ticket count.

3. Draw Period Closure & VRF Request#

Draws operate on strict, immutable UTC time boundaries:

  • Daily Draws: Close every night at 23:59:59 UTC.
  • Weekly Draws: Close every Sunday night at 23:59:59 UTC (Monday 00:00:00 UTC).
  • Monthly Draws: Close on the final second of each calendar month.
Phase 1OPEN

Tickets can be purchased; range records increment sequentially until 23:59:59 UTC cutoff.

Phase 2RANDOMNESS REQUESTED

Anyone closes an ended nonempty draw. Its pool and eligible count are fixed with one VRF request.

Phase 3SETTLED

After original coordinator fulfillment, anyone can settle. No retry or cancellation exists; outages can lock the pool indefinitely.

Phase 4CLAIMED or ROLLED OVER

Winning wallets claim before 72 hours from settlement. Expiry processing assigns 7.5% to Protocol Treasury and reserves the remainder for the following day.

The Randomness Lifecycle

  1. Permissionless Closure: Once a period's timestamp has elapsed, any participant or keeper bot can call closeDraw(drawType, periodId).

  2. Freezing the Pool: Closure freezes the draw's vault pool and eligible ticket count. All subsequent ticket purchases automatically enter the next active period.

  3. Chainlink VRF v2.5 Dispatch: For nonempty draws, the contract requests provably fair randomness from the immutable ChainlinkVRFProvider coordinator.

  4. Empty Draw Optimization: If zero tickets were purchased during a period, the contract skips the paid VRF oracle call and automatically rolls 100% of the vault pool into the future daily reserve.


4. Cryptographic Settlement & Sparse Fisher-Yates Sampling#

Once the Chainlink VRF Coordinator fulfills the randomness request with a cryptographically verified seed, the draw can be settled via settleDraw(drawId).

Winning Ticket Selection Algorithm

  • Distinct Winning Indices: The contract executes a sparse Fisher-Yates shuffle using keccak256(abi.encode(seed, slotIndex)) to select winning ticket indices without replacement.
  • Multi-Ticket Fairness: Draws select distinct ticket IDs, not wallet addresses. If a participant owns multiple tickets in the eligible range, each ticket has an independent chance of winning. Once a ticket wins any prize tier, it is retired from future draws; wallets with multiple tickets may win multiple prizes across draws if separate tickets are drawn.
  • $O(\log B)$ Binary Search Resolution: The contract resolves the winning wallet address by performing a binary search (getBatchForTicket) across the ticketBatches array in logarithmic time, keeping settlement gas strictly bounded.

Vault Tier Distribution

  • Daily Draw (Up to 10 Winning Tickets):
  • Tier 1: Grand Prize (1 winning ticket) takes 70% of the vault pool + all rounding dust.
  • Tier 2 (up to 3 winning tickets) takes 5% each (15% total).
  • Tier 3 (up to 6 winning tickets) takes 2.5% each (15% total).
  • Weekly Draw (Up to 3 Winning Tickets): Grand Prize (70%), 1st Runner-Up (20%), 2nd Runner-Up (10%).
  • Monthly Draw (1 Winning Ticket): 100% Vault Share Single Winning Ticket.

5. Non-Custodial Claims & 72-Hour Community Rollover#

When a draw settles, winning funds are immediately credited to totalClaimLiabilities on-chain.

Step 1

Draw Finalized

Closure is allowed after the UTC period ends. Settlement requires original VRF fulfillment and a separate transaction; its time is not guaranteed.

Hour 0 to 72

Active Winning Wallet Claim

Winning wallet calls claimPrize(drawId, winnerIndex) on the configured chain before the 72-hour deadline. A successful transaction transfers QANX.

Hour 72+

Expiry Can Be Processed

At 72 hours, anyone may process expiry. 7.5% becomes protocol treasury fees; the remainder seeds the daily reserve for the day after processing.

Claiming Rules

  • 72-Hour Claim Window: Winning wallets have exactly 72 hours (259,200 seconds) from the settlement timestamp to withdraw their prizes by calling claimPrize(drawId, winnerIndex).
  • Direct Wallet Payout: Funds are transferred directly to the winning wallet in canonical QANX tokens.
  • Community Rollover: If a prize remains unclaimed after 72 hours, anyone can call expireAndRollover(drawId, winnerIndex). 7.5% is allocated to the protocol treasury, and the remaining 92.5% is rolled into the future daily prize reserve to enrich upcoming community draws.