Expand description
Buffer PDA seed and address derivation.
Each buffer is a per-token SPL token account that holds funds controlled by the settlement state PDA. It lives at a PDA keyed by the token mint, so there is exactly one buffer address per token.
The token account stored at this address is initialized by the
CreateBuffer instruction; its SPL owner (token authority) is the
settlement state PDA (see crate::pda::state), the single authority
controlling every buffer.
The seeds start with SETTLEMENT_SEED, which carries
the cargo package major and minor version, so a version bump moves every buffer.
Since only the state PDA can spend a buffer and that address moves too,
buffers must be drained under the old version before a bump ships, or their
contents are stranded.
Native SOL has a buffer of its own (see find_native_sol_buffer_pda): an
empty account owned by the settlement program, whose lamports on top of rent
pay out orders buying native SOL. It isn’t keyed by a mint, so its seeds
follow a pattern of their own.
Unlike the order PDA, which stores its own bump (see
crate::data::order::OrderAccount), a buffer’s layout belongs entirely to
the token program, leaving no room for one.
Constants§
- BUFFER_
SEED - Trailing seed identifying the buffer PDAs.
- KNOWN_
MINTS - The 63 most-traded mints over the 12 full months to September 2026, filtered for staying power (traded in every month). Generated from https://dune.com/queries/8905140 Sorted by address for easier diffing
- NATIVE_
SOL_ BUFFER_ PDA_ SEEDS - Canonical seed components for the native SOL buffer PDA.
- NATIVE_
SOL_ BUFFER_ SEED - Trailing seed identifying the native SOL buffer PDA.
Functions§
- buffer_
pda_ seeds - Canonical seed components for the buffer PDA holding the specified
minttoken. - buffer_
pda_ signer_ seeds - Canonical seeds for re-deriving the buffer PDA for
mintwithbump. - find_
buffer_ pda - Derive the canonical buffer PDA address (and bump) for the token
mint. - find_
native_ sol_ buffer_ pda - Derive the canonical native SOL buffer PDA address (and bump).