Solana-native · Blinks · Solana Pay · Token-2022

The bigger the flock, the lower the price.
Fall short and you still get paid.

Run the simulator
Sample campaignTier 0 / 3
Buyers0
Price each$120

Steer the flock · tap or click to add buyers

Scroll
Two endings

Pick an ending. Watch the money move.

Tap an ending to play it

Program24Solana instructions
Automated tests15424 unit and fuzz · 88 core · 42 Solana-native, on a local chain
Self-audit9findings fixed, each with a test
This page's math62/62checks match on-chain results
Who it's for

Built for batch makers and the people who back them

Simulator

Run a campaign before you open one

The on-chain math, line for line from logic.rs. Hours into a 7-day window.

Campaign Example

Volume tiers · min units → USDC per unit
Fees, timing and track record
Seller track record · succeeded / failed / cancelled

Outcome
Units pledged
Clearing price
Back to buyers
Tier ladder and timeline
BuyerUnitsJoins at hLeaves at hWeightDepositGets backNet per unit

Merchant settlement

Try it

Create, join and settle a campaign yourself

Test wallets, the program's own math, nothing sent anywhere.

New campaign

Timing, early bonus and track record

No campaign yet Create one with the form. Three test buyers start with 1,000 test USDC each, and the shop starts with 500.
Built on Solana

A campaign is a link, a QR code and a token

Local chain One tap, one transaction, one receipt.

Localnet evidence: the Blink, the QR, receipts and the raw transaction

Every card is drawn from a real localnet run of client/solana-test.ts. Test wallets and test USDC; nothing here is on devnet or mainnet yet.

Solana Action

Rendered from the GET response. A wallet's POST gets back a v0 transaction: compute budget, join, mint_receipt. Unfurling on X needs a public HTTPS host, which comes after this local-only stage.

Solana Paytransaction request

Or as a QR at the stall

The wallet POSTs its address and signs what comes back. The POS finds the payment by its reference key (). In the test run this lookup found exactly that signature. The domain is a placeholder; the test ran on 127.0.0.1.

Token-2022soulbound

Every pledge gets a receipt

  1. Pledged minted in the same transaction as the join
  2. Settled campaign succeeded: kept as proof of purchase
  3. Burned refund or exit: burned by the program, rent back to the buyer
Token-2022soulbound

Sellers carry their record

A non-transferable credential copied from the on-chain seller profile. Anyone can refresh it and nobody can inflate it. Other protocols read the score without asking Flocca.

FieldFirst syncAfter a refresh
Transaction

The join a Blink builds, as an explorer shows it

Success
    Inner instructions (from the program logs)
    Transaction (measured)Compute units
    Account rent (refundable)SOL
    RealLookup tables and priority fees

    v0 transactions with a per-campaign address lookup table. Priority fee taken from recent fees on the campaign account (zero on a local chain).

    RealSquads v4 multisig

    A 2-of-3 vault holds the upgrade authority and the fee admin, behind an on-chain timelock. Tested against the real Squads program cloned from mainnet.

    Adapter real · swap mockedPay with any token

    Jupiter swap instructions and the join run in one atomic v0 transaction. Locally the swap is a mock with Jupiter's instruction format, since real routes need mainnet liquidity.

    Design onlyCompressed receipts

    Bubblegum cNFT receipts for very large campaigns. They need a Merkle tree and a DAS indexer, so they aren't built yet. See CRYPTO_DESIGN.md.

    How it works

    One campaign, four moves

    Why it holds

    Joining is a dominant strategy

    See the math

    A dominant assurance contract built into a volume-priced group buy. Either the group forms and you pay the group price, or it doesn't and you are paid for having tried. Staying out is never better.

    success rebate_i = units_i × (ceiling − clearing) failure payout_i = deposit_i + ⌊pool × w_i / Σw⌋ weight w_i = units_i × (1 + early × (deadline − t_i) / span) merchant net = units × clearing − fee, plus pool back
    Delivery escrow

    Paid on delivery, not on promise

    A seller can hold back part of the proceeds until the order ships. Buyers can flag a bad delivery, and the held money is only ever split across all of them.

    1. Finalize15 units sell out at $6
    2. Settle80% of the net paid, 20% held
    3. Ship proofa 32-byte hash, before ship-by
    4. Dispute windowbuyers can flag the order
    5. Releasesplit by the rules
    To the seller$17.55
    Back to buyers, by units$0.00

    ≤50%of the net can be held
    20%of units disputing sends it to the arbiter
    0paid to a lone disputer: refunds go to every buyer
    50/50if the arbiter stays silent past its deadline
    Agent mandates

    Let an agent buy for you, inside limits the chain enforces

    Sample campaigns The money stays in your wallet. The mandate can spend only its budget, and only where every rule holds.

    agent · 7xKq…m4FzActive
    Spent
      Analytics

      What the indexer sees

      Sample data A local test run, read back by the indexer. Not real activity.

      Volume settledUSDC at clearing prices
      Completion rate
      Active pools
      Bonus paid to buyersfrom campaigns that fell short
      Buyer savingsrebates below the ceiling price
      Seller leaderboard and recent campaigns
      SellerScoreW / L / CBonus floorVolume
      Recent campaignStateUnitsPrice
      Where Flocca stands

      Working on a local chain today

      Tap a milestone

      Program

      Twenty-four instructions, one vault per campaign

      Every account, and who moves money between them.

      Twenty-four instructions, the keeper, the SDK and 402 checkout

      An Anchor 0.31 program with a pure math module and unit tests, localnet integration tests and an end-to-end demo. Accounts: config, treasury, campaign[id], vault[campaign], pledge[campaign, buyer], merchant[seller], plus Token-2022 mints receipt[campaign, buyer] and credential[seller].

      InstructionWhoWhat it does
      initializeUpgrade authorityCreates config and treasury, and sets the protocol fee (10% max) and the admin timelock. Only the program's upgrade authority can call it.
      propose_fee / apply_feeAdminQueues a fee change that applies only after the timelock. Open campaigns keep the fee they started with.
      withdraw_treasuryAdminMoves protocol revenue (fees and rounding dust) to an admin account.
      create_campaignMerchantValidates tiers and schedule (90 days max), checks the bonus against the seller's reputation floor, opens the vault, and deposits the bonus.
      joinBuyerDeposits units at the ceiling price. A repeat join tops up the same pledge.
      leaveBuyerAllowed before the lock. Refunds the deposit minus the exit fee and closes the pledge.
      finalizeAnyoneAfter the deadline or at sell-out, marks the campaign Succeeded at the clearing price, or Failed, and records the outcome on the seller's profile.
      cancelMerchantBefore the deadline. The campaign fails, buyers keep the bonus, and the seller's profile records a cancel.
      claimBuyerPays the rebate, or the refund plus weighted bonus, and closes the pledge.
      settle_merchantAnyonePays proceeds minus the fee plus the pool to the merchant, and the fee to the treasury.
      sweepAnyoneOnce everyone is settled, sends rounding dust to the treasury and closes the vault.
      mint_receiptAnyone (buyer in a Blink)Mints the buyer's soulbound Token-2022 receipt with campaign, join order, tier, units and status in on-chain metadata.
      retire_receiptAnyoneAfter claim or leave: marks the receipt settled on success, or burns it and closes the mint on refund, returning the rent to the buyer.
      sync_credentialAnyoneMints or refreshes the seller's soulbound credential from the on-chain seller profile.
      configure_escrowMerchantBefore the first join: share of the net to hold back (up to 50%), time to ship, length of the dispute window.
      mark_shippedMerchantPosts a 32-byte shipping proof before the ship-by time and opens the dispute window.
      disputeBuyerFlags a shipped order inside the window. A vote toward a 20% quorum, never a payout.
      release_escrowAnyoneRefunds the held part if nothing shipped, releases it under quorum, opens arbitration at quorum, or applies the 50% default if the arbiter is silent.
      resolve_disputeArbiterRules a refund share for all buyers by units; the rest goes to the seller.
      set_arbiterAdminNames the arbiter (a Squads multisig in production).
      create_mandateBuyerGives an agent key a budget, price ceiling, per-campaign cap, seller floor, escrow minimum and expiry; the mandate becomes the delegate for exactly the budget.
      join_via_mandateAgentPledges with the buyer's funds after every mandate rule passes; the pledge is the buyer's.
      revoke_mandateBuyerClears the delegation and closes the mandate.