Invariants
Each is enforced on-chain at the instruction named.Solvency
- Gross solvency.
reserved liability + open vault credits ≤ assets, checked insideopen_ticket. The vault can pay every open ticket’s maximum at once. A net-only rule is not enough: with 200 of assets, a ticket price of 100 at 3.5× and no app share credits 99.00 and reserves 251.00; a net check accepts it, yet the payout owed is 350. - Global exposure. Reserved liability never exceeds κ = 80 % of assets, enforced at open and at every operation that lowers the vault (the strike). Never at settlement, which may not be refused.
- Internal accounting.
total_assetsis never derived from a token balance. Donations and stray transfers move nothing. Each token account holds at least what the ledger says it owes: the vault USDC account at leasttotal_assets.
Fairness
- Probabilities sum to exactly 1 000 000 000 and none is zero.
- The expected-return check runs in 128-bit integers with no floating point anywhere in the path.
- Outcome selection is exactly uniform: 128-bit words with rejection sampling. (Reducing a 32-bit word modulo 1e9 would carry a 23 % bias.)
- The payout table, the margin, the app share, the reserved liability and the cap stored at open are the ones used at settlement. Settlement never reads live parameters and never re-checks a cap.
Custody
- No admin instruction can rewrite a liquidity provider’s balance, override a ticket’s outcome, or move vault funds outside the program’s own paths (requests, strike, claims, settlement, expiry, the expired-ticket refund and payout claims).
- No pause can block
settle_ticket,expire_ticket,refund_expired_ticket,record_ticket_entropy,sweep_ticket_vrf,claim_payout,strike_epoch, a claim of a struck request, orrequest_withdraw. - Settlement always succeeds: a beneficiary that cannot receive gets its payout parked in escrow, so one frozen account can never block the vault’s pricing.
Identity
- The app is the signer of
integrator_authority. A program app’s identity is its["fade-integrator"]PDA, which only that program can sign for. Neither the calling program id nor the instructions sysvar is used to identify a caller (the sysvar cannot see inner CPIs). - Every account carrying money or identity is pinned by address, seeds or a stored key against already-trusted state, never accepted by position.
Randomness
- The oracle seed is derived on-chain from entropy that did not exist at open. No instruction accepts a caller-supplied seed or request account, and the ticket nonce is the app’s next nonce, never chosen.
settle_ticketaccepts the VRF request account only if its address, owner, type, state, stored seed and length all match. A pending request leaves the ticket untouched. A ticket whose request can no longer be checked for is refunded its vault credit, never forfeited.
Epochs
- Clean strike. An epoch is struck only after its close and once every ticket opened before the close has resolved. The strike’s cost is independent of the number of requests and tickets, and it excludes the credits and results of tickets opened after the close.
- Two sides. No ticket instruction writes the liquidity side, and no liquidity instruction writes
Vaultexcept the strike and the request that opens an epoch.
Token policy
Fade accepts legacy SPL USDC only. Token-2022 is rejected: a transfer hook would hand a third party a guaranteed call into every payout. The flip side is that USDC’s issuer can freeze any USDC account, including the vault’s.Governance
Why the upgrade key exists. Burning it would leave liquidity stranded behind the first bug. It is a real power: the never-list above binds the program as deployed, and an upgrade replaces the program. Who holds each role on mainnet, and the procedure around an upgrade or a parameter change, are published once the governance setup is final.
The trust that remains
Stated plainly, so nobody has to discover it.- Randomness is oracle-assumed, not proven. The honest claim is publicly verifiable odds, not provable fairness. Today’s VRF is written by a set of authorities, who can stall a request (bounded by forfeiture) and, because their signatures are deterministic, could compute outcomes in advance (bounded by binding the seed to a block that did not exist at open). A malicious upgrade of the VRF program could write arbitrary randomness after the fact. See Randomness for the provider and its trust assumptions.
- An oracle outage forfeits the tickets in flight. If the VRF stops fulfilling for more than
T_SETTLE, every ticket opened in roughly the preceding minute expires and its ticket price is forfeited. The guardian’s pause bounds how many tickets are exposed, not whether they are. - Fade verifies the odds, not the recipient. An app can name any beneficiary. A business that is its own beneficiary, as in Fade’s use cases, is trusted by its customers to credit them.
- A compromised app keeps its access. Whoever takes an app’s key, or its program’s upgrade authority, can open tickets as that app, bounded by the caps, its 20 % ceiling and the funds it controls. Where its app share is paid is fixed in the record.
- Smart contract risk. The program has not completed an external audit.