§ 05 — Flywheel

Fees repay the credit, then flow to holders for good.

Every swap through the graduation pool pays a 1% fee in the quote asset. One function, splitFees, decides where each atom goes, and it flips phase at exactly zero outstanding credit.

splitFees · tests passingLive in demoOffchain ledgerOn-chain · tests pending

§ 5.1Two phases

Phase A · repaying

credit outstanding > 0

80%
20%
  • Credit repayment → Credit Pool 80%
  • Platform burn / ops 20%

Phase B · flywheel

credit outstanding = 0

50%
35%
15%
  • Holders (quote asset) 50%
  • Platform buyback-burn 35%
  • Treasury 15%

§ 5.2The formulas

Integer quote atoms, rounding down; rounding dust goes to treasury so the parts always sum to the input.

While credit is outstanding

repay_share = fees × 8000 / 10,000
credit_repay = min(repay_share, outstanding)
platform_ops = fees × 2000 / 10,000
flywheel_base = repay_share − credit_repay // overflow in the crossover batch

Once outstanding is zero

flywheel_base = fees
holders = flywheel_base × 5000 / 10,000
platform_buyback_burn = flywheel_base × 3500 / 10,000
treasury = fees − credit_repay − platform_ops − holders − platform_buyback_burn

Worked cases

CaseFeesOutstandingRepayOpsHoldersBurnTreasuryAfter
Repaying1,00010,0008002000009,200
Crossover batch1,000300300200250175750
Flywheel1,0000005003501500
Computed with splitFees at build time; the same cases are asserted in core.test.ts. In the crossover batch the 500 atoms of the 80% share left after repaying 300 are split by the flywheel ratios.

§ 5.3Where each share goes

Credit repayment
Back to the Credit Pool vault (credit_vault), reducing outstanding. Recycled into the next launch's credit line.
Platform ops (20%) and platform buyback-burn (35%)
Platform-token burn · plannedBoth are sent in the quote asset to the platform_ops token account. Buying and burning a platform token with it happens outside the program and is not implemented yet.
Holders (50%)
Sent to the launch's rewards_vault and accrued per staked token: reward_per_share += holders × 10¹² / total_staked. Holders claim with claim_rewards.
Treasury (15% + dust)
The treasury token account set at initialize_protocol.

§ 5.4The anti-snipe rule

Bots that buy the instant a pool opens extract value from everyone else. Sealed does not stop the buy, it removes the reward:

  • Onchain: a buy in the same slot as graduation_slot creates an AntiSnipeEntry PDA for that wallet and emits SniperFlagged. That wallet's stake, claim_rewards and staking at claim fail with SniperIneligible.
  • Offchain: buys executed within 2 s of graduation are flagged (ANTI_SNIPE_WINDOW_SEC), listed in sniperFlags on the account, and earn 0% holder rewards.
  • The flag is permanent per launch and wallet. It does not apply to other launches.