Skip to main content
After open_ticket, a ticket needs two more transactions. Both are permissionless and prepaid, so anyone can send them: the app, the public keeper, or any other keeper.

The timeline

A ticket's life: at slot s the app signs open_ticket; from s + 2 anyone may request randomness, and keepers can record the seed; the VRF fulfils, typically within seconds; anyone settles, paying the outcome to the beneficiary, with no deadline. If the randomness never arrives by s + 150 slots, about a minute, expire_ticket closes the ticket and the vault keeps the vault credit; the ticket price is not returned, and a ticket never requested needs its seed recorded first. A ticket never requested whose seed was never recorded is refunded its vault credit by refund_expired_ticket once the seed is no longer provable, about 512 slots after open; the protocol and app shares are not returned.A ticket's life: at slot s the app signs open_ticket; from s + 2 anyone may request randomness, and keepers can record the seed; the VRF fulfils, typically within seconds; anyone settles, paying the outcome to the beneficiary, with no deadline. If the randomness never arrives by s + 150 slots, about a minute, expire_ticket closes the ticket and the vault keeps the vault credit; the ticket price is not returned, and a ticket never requested needs its seed recorded first. A ticket never requested whose seed was never recorded is refunded its vault credit by refund_expired_ticket once the seed is no longer provable, about 512 slots after open; the protocol and app shares are not returned.

Only the open needs the app's signature. After it, anyone can request, settle or expire, paid from the fee the ticket prepaid.

T_SETTLE is 150 slots, about a minute. It bounds how long Fade waits for randomness, never how long anyone has to settle: a fulfilled ticket stays settleable indefinitely, and expire_ticket refuses a ticket whose randomness has arrived (AlreadyFulfilled).

Why “open slot + 2”

The oracle seed must come from a block hash that did not exist when the ticket opened. request_randomness takes s*, the first slot present in SlotHashes after the open slot, and its hash h*, and derives the seed on-chain:
That hash is available from two slots after the open. The caller never supplies the seed: the program derives it and checks that the VRF request account passed is the one for that seed. See Randomness, which also names the VRF provider.

Expiry is forfeiture, with one exception

If the randomness is never fulfilled within T_SETTLE, expire_ticket closes the ticket and the vault keeps the vault credit. The ticket price is not returned: a return would let anyone who can withhold a draw (an oracle key holder colluding with whoever opens tickets) cancel every losing ticket for free. Under forfeiture, withholding gains nothing. The guardian can pause new tickets when the oracle stalls, with an operating target of 60 slots, well before 150; that bounds how many honest tickets a long oracle outage can reach, it does not remove the exposure. The SOL side still comes back to the payer at expiry, except what was spent. The exception is a ticket that was never requested and whose seed nobody recorded. Its seed is public from the slot after the open, so anyone could have created its VRF request and read the outcome; once SlotHashes no longer proves s*, the program cannot check whether that request exists. Forfeiting it would let whoever holds the request void every winner, so refund_expired_ticket ends it instead: the vault credit goes back to the beneficiary (or to the payout escrow if the beneficiary cannot receive), and the protocol and app shares are not returned. Recording the seed with record_ticket_entropy from open_slot + 2, which keepers do on every ticket, makes this case rare; expire_ticket refuses an unrecorded ticket (EntropyUnrecorded) and refund_expired_ticket refuses one the chain still proves (EntropyStillProven). Both ends count in Vault.ticket_forfeits_withheld, the figure a monitor watches.

A beneficiary that cannot receive

If the beneficiary’s USDC account cannot receive the payout at settlement (closed, frozen, or not a USDC account any more), settlement still succeeds: the payout moves to the program’s payout escrow, the ticket enters PayoutPending, and anyone can later call claim_payout to deliver it to the same beneficiary. Settlement never fails because of the beneficiary: a ticket that could not settle would block the vault’s epoch pricing for everyone.

The public keeper

Fade runs a keeper at https://api.fade.finance. It holds no authority over any ticket; it is simply a keeper that is always on, paid by the crank fee each ticket prepays like any other keeper. It also serves the app’s USDC faucet.
Browsers can call the API only from Fade’s own app origins (CORS). Call it from your server, or run your own keeper.

POST /v1/tickets

Hands a ticket to the keeper. It checks that the address is a Fade ticket account and queues it.
Posting is optional: the keeper also sweeps the chain about every 30 seconds for open tickets nobody posted. Posting right after the open confirms starts it at once.

GET /v1/tickets/:address

The keeper’s record of a ticket. An untracked ticket that is still open on-chain is queued on the way.

GET /v1/health

lastTick is a Unix time in milliseconds; queue is the number of tickets in progress. rpcError appears when the keeper cannot read the chain.

Faucet

One claim per wallet and per IP address every 5 minutes, and a global daily limit.

Running your own keeper

A keeper needs a funded key and a loop. It earns the crank fees of the tickets it advances.
  1. Find work. Fetch the program’s Ticket accounts (getProgramAccounts filtered on the Ticket discriminator) or subscribe to the program’s transactions and decode TicketOpened events.
  2. Record and request. For each ticket with status = Open and currentSlot ≥ openSlot + 2, send record_ticket_entropy, then derive the seed and send request_randomness (see the Quickstart code).
  3. Settle. For each ticket with status = Requested whose VRF request account is fulfilled, send settle_ticket. For PayoutPending tickets, retry claim_payout from time to time.
  4. Expire or refund. For each ticket past expirySlot whose randomness is unfulfilled, send expire_ticket, or refund_expired_ticket for a ticket whose seed was never recorded and is no longer proven. Sweep closed tickets’ vrf_payer with sweep_ticket_vrf when the VRF refunds rent to it late.
  5. Liquidity side. Strike the live epoch once its close has passed and no ticket opened before the close is still open (strike_epoch), then claim struck requests (claim_deposit, claim_withdraw). Each step is paid; see How the vault works.
Simulate before sending: several keepers may race for the same step, and only the first one lands.