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:
| Account | Address seeds | What it holds |
|---|---|---|
| Config | config | The operator, the three keepers and their threshold, the waiting window, the fee, the launch day, the pause flag |
| Asset | asset, index | One stock or ETF: ticker, the latest accepted close and the one before it. Index 0 is SPY |
| Filing | filing, document hash, row | One report line, the keepers' votes, which baskets it went into, and its score |
| Member | member, Bioguide ID | Buys scored, buys that beat the S&P 500, the sum of how much, and the history total the keepers voted in |
| Top5 | top5 | The five seats |
| Basket | basket, key | The open holdings, the money on each side and the shares that own it, the waiting requests |
| Vault | vault, basket | The basket's USDC |
| Request | request, basket, owner, day count, side, kind | One person's deposit or withdrawal waiting for the close |
| Epoch | epoch, basket, day count | What one settlement filled, for the claims |
| Position | position, basket, owner, side | One 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:
- 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.
- 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.
- 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.
- Seats a better member in the Top 5 when there is one.
- Moves accepted lines into baskets, oldest filing first.
- Settles every basket whose stocks have the same new close.
- 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
