Skip to main content
Fade is one Anchor program. Three rules shape it:
  1. Two sides that never share a write. Tickets and liquidity-provider flows each have their own state account and token accounts. Only two instructions touch both: the strike, and the request that opens an epoch. A rush of deposits or withdrawals never competes with tickets for the same accounts.
  2. Constant cost per instruction. No instruction iterates over requests, tickets or apps. The strike costs the same with one request or ten thousand.
  3. Every unit of work is prepaid to whoever does it. Requesting randomness, settling, expiring, striking and claiming are all paid, so none depends on goodwill or on the party that created the work coming back.

Accounts

Every token account is owned by the data-less ["vault-authority"] PDA. Integers in seeds are little-endian u64. A program app signs as ["fade-integrator"] under its own program id. Every account carries its layout number as its first field.

Vault

total_assets, total_shares, total_reserved_liability, open_vault_credits; the epoch counters that gate the strike (tickets opened before and after the live close, and a generation number); a copy of the live close time; a ring of hourly share-price maxima for the drawdown breaker; volume_total; ticket_forfeits_withheld, the expiries and refunds a withheld draw may explain; and the results of tickets opened after the live close, which the strike leaves out of its price. Identity: the vault USDC account holds at least total_assets, and the payout escrow at least the payouts parked in it.

Queue

The two live epochs (current, waiting for its price, and next, filling), each with its deposits, queued withdrawal shares and request counts; the running indices that let a withdrawal served over several epochs be claimed once; the next epoch id. Its lamports above its rent-exempt minimum are the strike fund.

Ticket

859 bytes. status (Open, Requested, PayoutPending), integrator, nonce, payer, beneficiary, price, vault_credit, payout_max, reserved_liability, the cap that applied, margin_bps, app_share_bps, vault_margin_bps, open_slot, open_ts, expiry_slot, the bound randomness account, entropy_slot, entropy_hash, seed, outcome, payout, the crank fee still held, and the payout table itself (up to 32 outcomes).

Integrator

The authority (the app’s signing address), the share_account, open liability, open ticket count, next_nonce, volume_total, a paused flag and its creation time.

Config

The council, the guardian, the protocol treasury, the USDC mint, the pause flags, the risk parameters (RiskParams), and at most one pending parameter change.

What each instruction writes

Liquidity claims never read Vault: the price is in the epoch record.

Money flows

Throughput

A block may spend at most 12 million compute units on transactions that write any one account, and every open and settlement writes Vault. Measured: an open and its settlement cost about 94 800 units, about 126 tickets per block. The liquidity side never contends with Vault except at the strike and at the request that opens an epoch.

Composition

open_ticket, settle_ticket and the other ticket instructions can sit in any transaction. request_deposit and request_withdraw inspect the transaction’s top-level instructions and refuse any outside an allowlist (compute budget, system, token, associated token and Fade’s own liquidity instructions). The check sees only top-level instructions, so it is defence in depth; epoch pricing carries the real load.