LEASE

Integration

Reading a pool

Derive the pool PDA from ["pool", base_mint, quote_mint] with the quote side chosen by precedence (USDC, then wSOL). Because state is lazy, simulate poke to get the seat and rent as of now.

Quoting a swap

out = reserve_out * net_in / (reserve_in + net_in), where net_in = amount_in - fee and fee = amount_in * fee_ppm / 1_000_000. The fee in force is top.fee_at(now): next_fee_ppm once now > fee_set_slot, else fee_ppm. It is 0 for the seat holder and 10,000 with no holder.

Swapping

swap(amount_in, min_out, base_in) is exact-in. Pass min_out from your quote; the program fails with SlippageExceeded below it.

Bidding programmatically

Pass the Bidder ledgers of every owner in pool.settled, pool.next and pool.top (other than you) as writable remaining accounts so their refunds can be credited (LedgerMissing otherwise).

Events

PoolCreated, BidPlaced, SeatTaken, SeatEnded, Swapped, BidderClaimed and the liquidity and burn events are emitted for indexers.