RSTAR

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.

WhoTouchesWith
A user's walletthe month's vault, LONG and SHORT mintsmint_pair, redeem_pair, redeem_settled
The keeperthe market's pending printspost_print, dispute_print
The authoritylistings, pending prints, the treasurylist_market, correct_print, void_prints, claim_protocol
Anyonefolding and settlementfold_prints, settle_market
Every mintthe treasury receives the 10 bp feeinside mint_pair

Accounts

All integers are little-endian.

AccountSeedsSizeHolds
Config["config"]224 bytesroles, quote mint, treasury, fee counters
Treasury["treasury"]165 bytesSPL Token USDC account owned by Config
Market["market", year u16 LE, month u8]376 bytesone calendar month: collar, prints, running sum, payout
LONG mint["long", market]376 bytesToken-2022, 6 decimals
SHORT mint["short", market]377 bytesToken-2022, 6 decimals
Vault["vault", market]165 bytesSPL 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

OffsetFieldType
0kind (= 1)u8
1versionu8
2bumpu8
3treasury_bumpu8
4live_marketsu32
8authorityPubkey
40pending_authorityPubkey
72keeperPubkey
104quote_mintPubkey
136treasuryPubkey
168buyback_destinationPubkey
200fees_accruedu64
208ops_claimedu64
216buyback_claimedu64

Market layout

OffsetFieldTypeMeaning
0kind (= 2)u8
3statusu80 trading, 1 settled
4monthu81 to 12
5flagsu81 has carry rate, 2 month closed, 4 settled by fallback
6pending_lenu8prints waiting in the window
10yearu16
12days_in_monthu32
16month_startu32UTC day number of the 1st
20target_midu32rate units
24collar_lou32rate units
28collar_hiu32rate units
32days_accountedu32calendar days folded so far
36carry_rateu32rate of the latest folded print
40last_folded_dayu32
44settled_avgu32rate units, zero until settled
48rate_sumu64sum of folded daily rates
56long_payout_ppmu64USDC per 1,000,000 LONG
64pairs_mintedu64lifetime, base units
72listed_ati64unix seconds
80settled_ati64unix seconds
88long_mintPubkey
120short_mintPubkey
152vaultPubkey
184pending[8]24 bytes eachposted_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.

InstructionCompute unitsTransaction bytes
mint_pair, first time (creates two token accounts)53,723 to about 61,000659
mint_pair16,571575
redeem_pair14,255509
redeem_settled9,568444
post_print (worst case, folds 8 prints)2,597246
settle_market1,762203
list_market58,396475

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.