open_wager, plus a way to get the wager settled. Everything after the open is permissionless.
Who signs what
open_wager names four parties. They can all be the same key, or four different ones.
Two more accounts belong to the app:
feeAccount: the USDC account that receives the app fee. Set by the app’s first wager, and afterwards must match the record; it moves only throughset_fee_account, signed by the app.nonce: must equal the record’snext_nonce(0 for a new app). The wager address is["wager", integrator, nonce], so it is known before the transaction lands.
Common shapes
Fade verifies the odds and pays the beneficiary named at open. It does not verify that the beneficiary is the app’s own user. An operator that is its own beneficiary is trusted by its users to credit them; it can make that checkable by showing each user the public wager behind their bet.
What an app needs
- No capital, no deposit, no registration. The first
open_wagercreates the app record. - A paytable that clears the edge floor: declared edge ≥ 100 bps (LP floor) + 20 bps (protocol fee) + the app’s fee. See Paytables.
- A USDC account for its fee (it may be the stake’s own source when the app takes no fee).
- SOL on the payer for the open, most of which comes back when the wager closes. See Fees.
- A keeper, or its own transactions, to request randomness and settle. See Settlement and keepers.
Three ways to call Fade
- From a server or wallet
- From a program (CPI)
- Over HTTP
Build
open_wager with the TypeScript client generated from the IDL, sign it with your keys (and the user’s wallet when the user stakes), and send it. Hand the wager to a keeper. This is the Quickstart.Composing with other instructions
open_wager can sit in any transaction: after a payment, a swap, a mint. If any instruction fails, nothing lands. It takes about 65 000 compute units. The only composition rule in the program applies to liquidity providers: request_deposit and request_withdraw refuse a transaction containing top-level instructions outside a short allowlist.
Before you sign: simulate
Every refusal is decided inopen_wager, against the pool as it stands. Simulate the transaction first: a refusal comes back with the program’s error name and message, and costs nothing. Errors lists every code and what to do about it. The sizing rules are explained in Paytables, so an interface can show the largest prize or the largest stake the pool accepts instead of letting a user hit a refusal.
The client
Fade publishes the devnet program’s Anchor IDL atfade.finance/idl/fade.json. Generate a typed TypeScript client from it with Codama, on top of @solana/kit. The Quickstart walks through it.