LEASE

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

AccountSeedsHolds
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

InstructionWhoDoes
init_configUpgrade authority, onceSets the LEASE mint and burn pools
create_pool(base_amount, quote_amount)AnyoneOpens a pool and its first seat auction
add_liquidity(max_base, max_quote, min_shares)AnyoneMints LP shares
remove_liquidity(shares, min_base, min_quote)LPBurns shares, pays a 0.011% withdrawal fee to the seat holder
claim_rent()LPPays out rent owed to the position
swap(amount_in, min_out, base_in)AnyoneExact-in swap at the seat holder's fee, 0 for the holder, 1% with no holder
bid(rent, deposit, fee_ppm)AnyoneQueues a bid for the seat
add_deposit(amount, queued) / withdraw_deposit(amount, queued)BidderTops up or draws down a deposit
set_fee(fee_ppm)Seat holderSets the fee from the next slot
claim_bidder()BidderCollects refunds and fees
poke()AnyoneSettles the seat and rent up to now
sweep()AnyoneMoves a pool's protocol rent to the burn vault
crank_burn(amount)AnyoneBuys 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.