Architecture
One Anchor program (Anchor 0.31.1). No admin keys beyond the launch config, which only the program's upgrade authority can write once.
Accounts
| Account | Seeds | Holds |
|---|---|---|
| Config | ["config"] | LEASE mint, the two Raydium CP-Swap burn pools (LEASE/USDC, LEASE/wSOL), quote spent on buys, LEASE burned |
| Pool | ["pool", base_mint, quote_mint] | Reserves, LP shares, rent per share, the live seat (top), the queued bid (next), settlements, open slot |
| Vault | ["vault", pool, mint] | Token accounts for the base and quote side. Reserves, fees, deposits and owed rent sit here |
| Position | ["position", pool, owner] | An LP's shares and its rent checkpoint |
| Bidder ledger | ["bidder", pool, owner] | Refunds and fees owed to a bidder whose seat or bid ended |
| Fees | ["fees", quote_mint] | Protocol rent waiting for the burn crank |
The pool PDA is built from the pair, so a pair has exactly one pool. The quote side is USDC when the pair contains USDC, otherwise wrapped SOL.
Instructions
| Instruction | Who | Does |
|---|---|---|
init_config | Upgrade authority, once | Sets the LEASE mint and burn pools |
create_pool(base_amount, quote_amount) | Anyone | Opens a pool and its first seat auction |
add_liquidity(max_base, max_quote, min_shares) | Anyone | Mints LP shares |
remove_liquidity(shares, min_base, min_quote) | LP | Burns shares, pays a 0.011% withdrawal fee to the seat holder |
claim_rent() | LP | Pays out rent owed to the position |
swap(amount_in, min_out, base_in) | Anyone | Exact-in swap at the seat holder's fee, 0 for the holder, 1% with no holder |
bid(rent, deposit, fee_ppm) | Anyone | Queues a bid for the seat |
add_deposit(amount, queued) / withdraw_deposit(amount, queued) | Bidder | Tops up or draws down a deposit |
set_fee(fee_ppm) | Seat holder | Sets the fee from the next slot |
claim_bidder() | Bidder | Collects refunds and fees |
poke() | Anyone | Settles the seat and rent up to now |
sweep() | Anyone | Moves a pool's protocol rent to the burn vault |
crank_burn(amount) | Anyone | Buys LEASE with swept rent on Raydium and burns it |
State is lazy
Rent is charged as if the pool were updated every slot, but the work happens when any instruction touches the pool. Pool::advance(now) walks the seat forward: the holder pays until its deposit runs dry or a queued bid that beats it reaches its start slot. To read the current seat without sending a transaction, simulate poke.