Claim Winnings & Fees
Two kinds of payout matter to an integration: the winnings your users earn, and the referral fees you earn. Both are pull-based. Nothing is sent automatically, so a claim function has to be called. Here is how each one works.
Users claiming winnings
After a drawing settles, any winnings sit as a claimable balance against the winning ticket NFTs until claimed. In your app, surface the claim and call it on the user's behalf (they sign the transaction):
Find the user's winning tickets for a settled drawing. You can detect winners with on-chain reads, or list a wallet's wins across many drawings with the Data API (
GET /v1/wallets/{address}/wins).Call
Jackpot.claimWinnings(uint256[] _ticketIds)with those ticket IDs. Winnings pay out in USDC to the ticket owner.
The full win-detection and claim recipe (tier lookup, batching large claims) is at llms.megapot.io. Use the Data API when you need a wallet's unclaimed wins across drawings.
Claim and re-buy in one step (auto-compound)
To let a user roll their winnings straight into new tickets in a single transaction, use auto-compound instead of a plain claim.
Contract:
TicketAutoCompoundVault.depositAndCompound(...)What it does: claims the winnings and buys new tickets in one call.
You still earn: it takes the same trailing
_referrers,_referralSplit, and_sourcearguments as a purchase, so your referral fees apply to the re-buy.
See the Protocol Reference for the full signature.
Claiming your referral fees
Your referral earnings (ticket fees plus win-share from users you referred) accrue as a claimable USDC balance inside the Jackpot contract.
Read your claimable balance (USDC, 6 decimals):
Withdraw the full balance (there is no minimum):
This transfers everything you have accrued to your wallet in one call. For how those fees are set, split, and rated, see Referrals & Attribution.
Next: Referrals & Attribution · Protocol Reference · Add the jackpot to your site
Last updated

