Skip to content

Accounts and PDA seeds

Current Anchor account identities and the limits of the initial storage model.

Source inspected: programs/grapl-amm/src/state/{mod,ticks}.rs, instructions/pool/initialize.rs, instructions/positions/lifecycle.rs, and hooks/abi/wire.rs. These are implementation details under development, not a stable deployed ABI.

Current addresses

Seeds are listed in order. Numeric identifiers use little-endian bytes; pubkeys use their raw 32 bytes. Derive the bump with the program ID from your deployment configuration.

AccountSeedsDeriving program
Factory mintb"mint", creator, token_id: u64 LECore
Initial issuance token accountb"issuance", mintCore
Graduation positionb"graduation", poolCore
ProtocolTreasuryb"protocol_treasury"Core
Poolb"pool", creator, pool_id: u64 LECore
Vault A/Bb"vault", pool, mintCore
TickDirectoryb"ticks", poolCore
Tick arrayb"tick_array", pool, array_index: i32 LECore
Positionb"position", pool, owner, position_id: u64 LECore
Hook callback authorityb"hook", poolCore
Hook policy account at index ib"policy", pool, one-byte indexConfigured hook

The current pool seed does not include the token pair. The implementation identifies it by creator and pool ID; the architectural pair/salt identity is not the current seed scheme.

State responsibilities

AccountSelected fields
PoolMints, vaults, creator, configuration, hook program, Q64.64 price, tick, active liquidity, fee growth, beneficiary debts, protocol owed amounts and per-mint fractional carry, sequence, entry flag, curve state; Pool version 6 reserves 1160 bytes
ProtocolTreasuryBump and immutable claim recipient; 41 bytes including discriminator
PositionPool, owner, ID, ticks, liquidity, inside-growth checkpoints, fees owed
TickDirectoryPool, spacing, bump, two-level bitmap; 1816 bytes, borrowed through AccountLoader
Tick arrayCanonical page header plus fixed or compact boundary records
TickBoundarySigned index, gross/net liquidity, outside fee growth for A/B

Each page represents 64 aligned ticks. Only initialized boundaries occupy compact records; fixed pages reserve all slots. The directory covers the entire supported price domain. A swap accepts at most 16 page accounts, and transaction bytes/CUs can impose a smaller practical budget. See tick arrays and full range.

Authority and token accounts

The treasury initializer authenticates the deployed program's upgrade authority through ProgramData. Protocol collection requires the configured recipient's signature and recipient-owned token accounts. Fees accrue per pool; the treasury record does not become a shared writable account on each swap. See Fees and revenue.

Vaults use the pool PDA as token authority. The callback PDA owns no vault. It is the only core signer forwarded to the hook; the pool is read-only. Extra accounts need explicit HookAccountAccess descriptors and configured per-phase permissions. Defaults allow four read-only hook-owned extras; configured maxima are 16 extras and eight writable extras per callback.

PolicyPda indices 0–3 use the table above. HookState has hook-defined address/discriminator relationships. ExternalState owners and ExternalProgram IDs must be declared; external programs remain read-only. Signer extras, duplicates, core-owned extras, and aliases of protected market/actor/settlement accounts reject. See permissions.

The initial core uses classic SPL Token accounts. Initialization permits issuer freeze authority; frozen token accounts cannot settle transfers. See token compatibility.

Program identity

Obtain the core program ID from the deployment configuration used by your application and verify the account owner against it. These docs do not publish a mainnet address registry.