ZamOps Pool documentation
Introduction
ZamOps Pool is a no-loss prize savings app on Ethereum Sepolia. Zama FHEVM lets the pool calculate a fair, deposit-weighted winner without exposing individual balances or the result to everyone.
The assets have no real-world value. You still need Sepolia ETH for wallet transactions.
01
Using the pool
Start with cUSDC for the clearest path. The app guides you through each wallet request.
- Get
Request public USDC from the in-app faucet.
- Shield
Convert it into its confidential ERC-7984 form, cUSDC.
- Deposit
Choose an amount. It is encrypted before the pool receives it.
- Reveal
Sign a free EIP-712 viewing request to see your own principal and winnings.
- Win
Stay in the pool for the next encrypted, deposit-weighted draw.
- Leave
Claim a prize if you have one, or withdraw your principal whenever you choose.
02
How the draw stays fair
When a draw begins, deposits pause and the pool freezes each eligible encrypted balance. Every saver receives a contiguous part of the selection range proportional to their deposit.
Zama's encrypted randomness selects a target inside that combined range. A saver with 60 of 100 eligible tokens has a 60% chance; a saver with 10 still has a 10% chance. The random target, comparisons, winner and winnings remain encrypted.
Weight is measured at the draw snapshot. Time held does not increase it. This keeps the odds exact, avoids empty winning slots, and keeps confidential computation bounded.
03
What stays private
FHE protects financial values, not the existence of blockchain transactions.
- Encrypted
- Deposit and withdrawal amounts
- Principal and winnings
- Individual odds
- Random target and comparisons
- Winner identity in pool events
- Public
- Participating wallet addresses
- Transaction timing
- Draw state and schedule
- Participant count
- Combined eligible weight
A reveal is authorized by the connected wallet and shown only in that browser session. It does not publish the value onchain.
04
Why principal is protected
Principal, the prize reserve and awarded winnings are separate encrypted balances. The Sepolia keeper supplies mock yield for the demo; it never takes the prize from savers' deposits. Principal remains withdrawable during every draw stage.
A production version would replace mock funding with an audited yield adapter while preserving the same separation between principal and prizes.
05
Timing and automation
Each pool opens for deposits for one hour. The keeper checks eligible pools every ten minutes, so a draw will usually begin roughly 60–70 minutes after the pool opens or reopens. Once the request is mined, deposits pause until selection finishes and the next draw opens.
Every transition is permissionless. If scheduled automation is delayed, the app exposes a fallback after the grace period so a saver can advance the same proof-checked step. The keeper cannot read balances, provide the random number, or choose the winner.
06
Contracts and proof
The app, contracts and confidential computation are open for inspection.
27 FHE operations • 1,797,102 HCU • 899k maximum depth