CAUCUSLaunch app

Architecture

CAUCUS is one Solana program, three keeper bots and this site. The program holds the money and keeps the score. The keepers bring in the two things a blockchain cannot read by itself: the House Clerk's reports and the daily closing prices. The site reads the program and lets your own wallet send your requests.

The program

One Anchor program. Its accounts:

AccountAddress seedsWhat it holds
ConfigconfigThe operator, the three keepers and their threshold, the waiting window, the fee, the launch day, the pause flag
Assetasset, indexOne stock or ETF: ticker, the latest accepted close and the one before it. Index 0 is SPY
Filingfiling, document hash, rowOne report line, the keepers' votes, which baskets it went into, and its score
Membermember, Bioguide IDBuys scored, buys that beat the S&P 500, the sum of how much, and the history total the keepers voted in
Top5top5The five seats
Basketbasket, keyThe open holdings, the money on each side and the shares that own it, the waiting requests
Vaultvault, basketThe basket's USDC
Requestrequest, basket, owner, day count, side, kindOne person's deposit or withdrawal waiting for the close
Epochepoch, basket, day countWhat one settlement filled, for the claims
Positionposition, basket, owner, sideOne person's shares on one side

The money only leaves a vault to the owner of a request, through cancel or claim. There is no instruction that sends it anywhere else, and no admin withdrawal.

The keepers

Each keeper runs keeper with its own key on its own machine and reads the public sources itself. A pass, run every ten minutes, does these jobs in order:

  1. Reads the House Clerk index and every report of the year before launch, posts the lines of the last 100 days that nobody posted yet, and confirms the lines another keeper posted only if it read exactly the same fields.
  2. After 16:30 in New York, takes each stock's official close from Nasdaq, checks it against a second source within 0.5%, and votes for it. A stock that did not trade that day on either source carries its last close.
  3. Starts and finishes scores on their one valid close, and before launch posts each member's history total and the entry of buys whose 90 days end after launch.
  4. Seats a better member in the Top 5 when there is one.
  5. Moves accepted lines into baskets, oldest filing first.
  6. Settles every basket whose stocks have the same new close.
  7. Closes filing records that can no longer matter and returns their rent to the keeper who posted them.

Every job reads its state from the chain, so the keepers can run in any order and a job another keeper already did simply fails.

The site

The site reads the program through its own read-only relay (/api/sol). It never sends a transaction: your wallet (Phantom or Solflare) signs and sends each request, cancel and claim.

Next: How it works