Architecture
RSTAR is one native Solana program (solana-program 1.18.26, no framework) plus an off-chain keeper that copies the official rate. Every account is a program-derived address, so each thing the protocol makes exists exactly once.
| Who | Touches | With |
|---|---|---|
| A user's wallet | the month's vault, LONG and SHORT mints | mint_pair, redeem_pair, redeem_settled |
| The keeper | the market's pending prints | post_print, dispute_print |
| The authority | listings, pending prints, the treasury | list_market, correct_print, void_prints, claim_protocol |
| Anyone | folding and settlement | fold_prints, settle_market |
| Every mint | the treasury receives the 10 bp fee | inside mint_pair |
Accounts
All integers are little-endian.
| Account | Seeds | Size | Holds |
|---|---|---|---|
| Config | ["config"] | 224 bytes | roles, quote mint, treasury, fee counters |
| Treasury | ["treasury"] | 165 bytes | SPL Token USDC account owned by Config |
| Market | ["market", year u16 LE, month u8] | 376 bytes | one calendar month: collar, prints, running sum, payout |
| LONG mint | ["long", market] | 376 bytes | Token-2022, 6 decimals |
| SHORT mint | ["short", market] | 377 bytes | Token-2022, 6 decimals |
| Vault | ["vault", market] | 165 bytes | SPL Token USDC account owned by the market |
Because the market address is derived from (year, month), a second listing of the same month fails. The DEC26 tokens cannot touch the JAN27 vault: every mint and vault is derived from its own market key.
Config layout
| Offset | Field | Type |
|---|---|---|
| 0 | kind (= 1) | u8 |
| 1 | version | u8 |
| 2 | bump | u8 |
| 3 | treasury_bump | u8 |
| 4 | live_markets | u32 |
| 8 | authority | Pubkey |
| 40 | pending_authority | Pubkey |
| 72 | keeper | Pubkey |
| 104 | quote_mint | Pubkey |
| 136 | treasury | Pubkey |
| 168 | buyback_destination | Pubkey |
| 200 | fees_accrued | u64 |
| 208 | ops_claimed | u64 |
| 216 | buyback_claimed | u64 |
Market layout
| Offset | Field | Type | Meaning |
|---|---|---|---|
| 0 | kind (= 2) | u8 | |
| 3 | status | u8 | 0 trading, 1 settled |
| 4 | month | u8 | 1 to 12 |
| 5 | flags | u8 | 1 has carry rate, 2 month closed, 4 settled by fallback |
| 6 | pending_len | u8 | prints waiting in the window |
| 10 | year | u16 | |
| 12 | days_in_month | u32 | |
| 16 | month_start | u32 | UTC day number of the 1st |
| 20 | target_mid | u32 | rate units |
| 24 | collar_lo | u32 | rate units |
| 28 | collar_hi | u32 | rate units |
| 32 | days_accounted | u32 | calendar days folded so far |
| 36 | carry_rate | u32 | rate of the latest folded print |
| 40 | last_folded_day | u32 | |
| 44 | settled_avg | u32 | rate units, zero until settled |
| 48 | rate_sum | u64 | sum of folded daily rates |
| 56 | long_payout_ppm | u64 | USDC per 1,000,000 LONG |
| 64 | pairs_minted | u64 | lifetime, base units |
| 72 | listed_at | i64 | unix seconds |
| 80 | settled_at | i64 | unix seconds |
| 88 | long_mint | Pubkey | |
| 120 | short_mint | Pubkey | |
| 152 | vault | Pubkey | |
| 184 | pending[8] | 24 bytes each | posted_at i64, day u32, rate u32, flags u8 (1 final, 2 disputed) |
The tokens
LONG and SHORT are Token-2022 mints with 6 decimals. The mint authority is the market PDA and only mint_pair uses it. They have no freeze authority, no permanent delegate, no transfer hook and no transfer fee. Each carries on-chain metadata, for example RSTAR DEC26 LONG with symbol DEC26L. They carry no close authority either, so any DEX pool will accept them; the cost is that each month's two mints keep their rent (0.00475996 SOL) for good.
Full backing
mint_pair moves exactly amount USDC into the vault and mints exactly amount of each side, so before settlement the vault equals the supply of either side. After settlement each side pays floor(amount x share / 1,000,000) and the two shares add up to 1,000,000, so the vault always covers what is outstanding. The engine's tests end the September and October markets with a vault of exactly zero after every holder exits.
Measured cost
Measured on LiteSVM with the mainnet token programs, legacy transactions with one signer.
| Instruction | Compute units | Transaction bytes |
|---|---|---|
| mint_pair, first time (creates two token accounts) | 53,723 to about 61,000 | 659 |
| mint_pair | 16,571 | 575 |
| redeem_pair | 14,255 | 509 |
| redeem_settled | 9,568 | 444 |
| post_print (worst case, folds 8 prints) | 2,597 | 246 |
| settle_market | 1,762 | 203 |
| list_market | 58,396 | 475 |
Rent per month-market at the November 2026 rate: the market and vault hold 0.00404876 SOL, returned by close_market; the two mints keep 0.00475996 SOL.