Architecture

DOME is a single Anchor 0.31 program. There is no off-chain service in the trading path.

Accounts

AccountSeedsHolds
Config["config"]DOME mint, the Raydium CP-Swap pool used for the burn, its quote mint, running totals quote_spent and orbit_burned
Pool["pool", mint_set]Up to 16 mints and vaults, reserves, protocol fees, pending LP fees, tau, eight Bands
Position["position", pool, owner, band]One owner's radius in one band, fee checkpoints, fees owed
Vaultsassociated token accounts of the poolThe pool's tokens, one per coin

mint_set is the hash of the pool's mints in ascending order. Because the pool address is derived from it, one set of coins has exactly one pool. A second pool for the same coins cannot exist.

Pool is zero-copy (4,216 bytes plus the 8-byte discriminator); clients read it by byte offset, and a compile-time assertion keeps the layout fixed.

Instructions

InstructionWhoPurpose
init_configupgrade authority, onceNames the DOME mint and the burn market
create_poolanyoneOpens the pool for 2 to 16 mints with the same decimals
open_positionanyoneCreates a position in one band
add_liquidity / remove_liquidityposition ownerAdds or removes radius, moving every coin of the pool
collect_feesposition ownerPays fees in one coin
close_positionposition ownerReturns rent of an empty position
swapanyoneAny coin to any other
convert_feesanyoneTurns protocol fees in one coin into the burn coin, inside the pool
buy_and_burnanyoneBuys DOME with protocol fees and burns it

Which mints can join

create_pool accepts SPL Token and Token-2022 mints. On Token-2022 it refuses a transfer hook, a non-zero transfer fee and non-transferable mints, because each could move or skim the pool's balances outside its accounting (MintExtension). Every coin of a pool must share the same decimals (DecimalsMismatch).

Arithmetic

All swap math is fixed point in 128 bits. MAX_VIRTUAL_RESERVE (2^58) and MAX_TOTAL_RADIUS (2^60) keep every product inside range; a trade that would leave it fails with CapExceeded instead of wrapping.

From paper to program

PaperProgram
Sphere AMMmath::Geometry, per band
Tickseight fixed bands per pool (BAND_DEPEG_PPM)
Interior and boundary ticksBand.boundary
Consolidation into a torusmath::trade over Pool.tau and the band book
Crossing tickstrade split at each edge, Swapped.band_crossings
Next: How it works