Sweep Protocol · Internal Design Doc · v1

Sweep Protocol
— Design v1

Beat Every Competitor · Perpetual Lottery · Card Payments · B2B API · Base + USDT

⬡ 7 Contracts
🏃 8 Sprints
💰 3 Revenue Streams
🔵 USDT on Base
🏆 10 Prize Tiers

Competitive Synthesis — What We Steal

🎰
From Megapot
  • 3-role flywheel: Players / Backers / Referrers
  • 10-tier prize structure
  • NFT-based tickets (SweepTicket)
  • Pyth entropy for on-chain randomness
  • Dynamic bonusball difficulty (pool-size responsive)
  • 2-level referrals: 8% + 2% second-tier
  • Auto-subscription & recurring play
  • Telegram / WhatsApp notification bots
🏊
From PoolTogether
  • ERC-4626 vault for LP positions — DeFi-native, composable
  • Permissionless pool deployment via PoolFactory
  • Optional no-loss PLSA mode for risk-averse users
🏪
From Traditional Lotteries
  • Credit / debit card payments (no wallet needed)
  • Subscription model — daily auto-play
  • Familiar prize tiers: daily / weekly / monthly / jackpot
  • Simple pick-numbers UX
  • Email + push prize notifications
  • Retailer / distributor network hooks
Our Additions
  • B2B white-label API for partners
  • PoolFactory — permissionless pool deployment
  • RandomnessRouter: Pyth + Chainlink + drand fallback
  • PayoutEscrow for high-volume B2B trust
  • Rolling jackpot (never resets to zero)
  • Chainlink Automation — no human to trigger draws
  • Coinbase Smart Wallet: email signup, zero crypto UX

Contract Architecture

100% 7 core contracts · drag to pan
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#1c1917','primaryTextColor':'#fafaf9','primaryBorderColor':'#f97316','lineColor':'#ec4899','secondaryColor':'#0c0a09','nodeBorder':'#f97316','mainBkg':'#1c1917','clusterBkg':'#292524','titleColor':'#fafaf9','edgeLabelBackground':'#1c1917','fontFamily':'Space Mono, monospace'}}}%% graph LR User([👤 User]) --> SweepLottery CardPayment[💳 Card/Stripe] --> BackendOps[🔧 Backend Operator] BackendOps --> SweepLottery SweepLottery --> SweepTicket[🎫 SweepTicket NFT] SweepLottery --> PrizeDistributor[🏆 PrizeDistributor] SweepLottery --> ReferralRegistry[🔗 ReferralRegistry] SweepLottery --> LPVault[🏦 LPVault ERC-4626] SweepLottery --> RandomnessRouter[🎲 RandomnessRouter] SweepLottery --> SweepSubscription[🔄 SweepSubscription] RandomnessRouter --> Pyth[Pyth Entropy] RandomnessRouter --> ChainlinkVRF[Chainlink VRF] RandomnessRouter --> Drand[drand] PrizeDistributor --> Winner[🥇 Daily Winner 40%] PrizeDistributor --> WeeklyPool[📅 Weekly Pool 30%] PrizeDistributor --> MonthlyPool[🗓️ Monthly Pool 15%] PrizeDistributor --> OpsReserve[⚙️ Ops+Reserve 15%] LPVault --> Backers[💎 LP Backers 20% yield] ReferralRegistry --> Referrers[🔁 Referrers 8%+2%] PoolFactory[🏭 PoolFactory] --> SweepLottery PayoutEscrow[🔒 PayoutEscrow] -.->|B2B trust| B2BPartner([🤝 B2B Partner]) classDef core fill:#1c1917,stroke:#f97316,stroke-width:2px,color:#fafaf9 classDef infra fill:#1c1917,stroke:#ec4899,stroke-width:2px,color:#fafaf9 classDef external fill:#292524,stroke:#6b7280,stroke-width:1px,color:#a8a29e classDef output fill:#1c1917,stroke:#22c55e,stroke-width:2px,color:#fafaf9 class SweepLottery,SweepTicket,PrizeDistributor,ReferralRegistry,LPVault core class RandomnessRouter,PoolFactory,PayoutEscrow,SweepSubscription infra class CardPayment,BackendOps,User,B2BPartner external class Winner,WeeklyPool,MonthlyPool,OpsReserve,Backers,Referrers,Pyth,ChainlinkVRF,Drand output
Core contracts
Infrastructure
Outputs / recipients
External actors

Revenue Model — 3 Streams

$1 USDT/ticket
Ticket Revenue
🏆 Prize pools 70%
🏦 LP Vault (backer yield) 20%
🔗 Referral registry 8%
⚙️ Protocol treasury 2%
Backers earn ~20% APY on deposited liquidity. Jackpot never resets below guaranteed minimum.
$7 /week
Subscription Revenue
💳 Stripe weekly billing auto
🎫 Daily tickets per week ×7
🔧 Backend auto-buys daily
📱 Smart wallet handles onchain ERC-4337
Recurring revenue, low churn. Traditional lottery feel. Users never touch crypto — Stripe subscription just works.
2% protocol fee
B2B Protocol Fee
🏭 Per pool via PoolFactory 2%
🔗 Partner referrer yield auto
🏆 Distributed per draw on-chain
📄 Invoices needed? zero
Partners earn referrer yield automatically every draw. No payment terms, no invoicing. Bond required for large volume partners.

Card Payment + Subscription Flow

1
User Signs Up
Email + card only
No crypto wallet needed
2
Stripe Billing
Charges card
weekly / monthly
3
Backend Operator
Buys USDT via
MoonPay / Circle B2B
4
Smart Wallet
Coinbase ERC-4337
provisioned, gas sponsored
5
Ticket Minted
SweepTicket NFT
to user's smart wallet
6
Draw Runs
Chainlink Automation
triggers 9PM UTC daily
7
Win Notification
Email / push + USDT
in wallet OR Stripe payout
ERC-4337 Account Abstraction Stripe Webhooks Chainlink Automation Gas Sponsored

10-Tier Prize Structure

Tier Match Required Pool Allocation Odds
T1 — JACKPOT
5 normals + bonusball
40% of prize pool
1 in 3,000,000
T2
5 normals
6%
1 in 600,000
T3
4 normals + bonusball
6%
1 in 90,000
T4
4 normals
6%
1 in 15,000
T5
3 normals + bonusball
6%
1 in 3,000
T6
3 normals
12%
1 in 600
T7
2 normals + bonusball
12%
1 in 100
T8
2 normals 🎫 Free ticket 1 in 25
T9
1 normal + bonusball
12%
1 in 12
T10
Bonusball only 🎫 Free ticket 1 in 8
1 in 4 tickets wins something. Bonusball range is dynamic — widens as pool grows, narrows as pool shrinks. Guaranteed minimums per tier + premium pool share on top. T8 and T10 reward players with free tickets, keeping them in the game.

Sprint Roadmap

S1
Core · NOW
SweepLottery / Ticket / Distributor · USDT · Multi-tier prizes
ACTIVE
S2
Liquidity
LPVault ERC-4626 · ReferralRegistry · RandomnessRouter
S3
Infrastructure
PoolFactory · PayoutEscrow · SweepSubscription · Chainlink Automation
S4
API + SDK
REST API · Stripe billing · MoonPay · React SDK · Webhooks
S5
App + Bot
Next.js B2C app · Telegram bot · Smart Wallet · Card flow
S6
Audit + Testnet
Base Sepolia · Load testing · Zellic / Code4rena audit
S7
Launch
Base mainnet · Monitoring · First B2B partner live

B2B API — What Partners Get

🔌
REST API
POST /v1/pools # create custom pool POST /v1/pools/:id/tickets # buy ticket for user GET /v1/draws/:id # draw result + winners POST /v1/webhooks # register endpoint GET /v1/referrals/:addr # earnings balance
  • OpenAPI 3.0 spec + Postman collection
  • API key + webhook signature auth
  • Idempotency keys on all writes
White-label SDK
// 3-line integration import { SweepWidget } from '@sweep/react' <SweepWidget poolId="your-pool" theme={{ primary: "#f97316" }} />
  • React component, fully customizable theme
  • Partner wallet auto-earns referral yield
  • PayoutEscrow unlocked for >$50k/mo partners
  • Mobile-first, accessible, responsive
💎
Revenue Share
🎫 Of all ticket sales 8%
🏆 Of all wins on platform 8%
  • On-chain, auto-distributed every draw
  • No invoices, no NET-30, no chasing payments
  • Bond required for large volume partners
  • Track earnings real-time via /v1/referrals/:addr

Decisions Needed

🚨 BLOCKING SPRINT 1
These must be resolved before contracts are finalized
01
LP / Backer Model
Megapot-style external backers fund prize pool + earn ~20% yield? Or ticket-sales-only funding? This choice is foundational.
Impact → LPVault architecture + prize floor guarantees
02
Prize Split BPS
Confirm: 70% prizes / 20% LP yield / 8% referrers / 2% protocol? Or different allocation? Hard-coded in contract constructor.
Impact → PrizeDistributor constructor, upgrade path
03
First B2B Partner
Who is the anchor integration? Shapes API design, error handling, onboarding flow, and the entire B2B sales motion.
Impact → API design + PayoutEscrow threshold + sales pitch
04
Audit Budget
$50–150k range. Who funds? Zellic has 6–8 week lead time. Need to engage now or miss the launch timeline window.
Impact → Sprint 6 start date + mainnet launch date