Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt

Use this file to discover all available pages before exploring further.

This page summarizes the alpha_vault account model from the local Anchor source and SDK IDL. For exact generated TypeScript layouts, use the account types exported by @meteora-ag/alpha-vault.

Address Map

AddressHow it is chosenUse
VaultPDA from vault, base, and poolMain state for one Alpha Vault. The base seed is either a direct base signer or a reusable config account.
Quote token vaultAssociated token account for the Vault PDA and quote mintHolds user quote deposits until fills, withdrawals, or remaining-quote refunds.
Base token vaultAssociated token account for the Vault PDA and base mintHolds tokens bought from the connected launch pool for vesting claims.
EscrowPDA from escrow, Vault, and ownerUser state for deposits, claims, refunds, caps, and close eligibility.
ProrataVaultConfigPDA from prorata_config and config indexAdmin-created reusable Pro Rata timing and cap template.
FcfsVaultConfigPDA from fcfs_config and config indexAdmin-created reusable FCFS timing and cap template.
MerkleRootConfigPDA from merkle_root, Vault, and versionMerkle root for permissioned Merkle-proof escrow creation.
MerkleProofMetadataPDA from merkle_proof_metadata and VaultOptional proof URL used by clients to fetch wallet cap proofs.
CrankFeeWhitelistPDA from crank_fee_whitelist and crankerLets a cranker fill a vault without paying the crank fee.
Event authorityAnchor event-CPI PDARequired by event-emitting instructions as generated by Anchor clients.

PDA Seeds

SDK helperSeedsUse
deriveAlphaVault(base, pool, programId)["vault", base, pool]Main vault account.
deriveEscrow(alphaVault, owner, programId)["escrow", alphaVault, owner]User escrow account.
deriveMerkleRootConfig(alphaVault, version, programId)["merkle_root", alphaVault, version]Merkle root account for one version.
deriveMerkleProofMetadata(alphaVault, programId)["merkle_proof_metadata", alphaVault]Optional proof URL metadata account.
deriveCrankFeeWhitelist(cranker, programId)["crank_fee_whitelist", cranker]Crank fee whitelist account.
Direct Pro Rata or FCFS vault["vault", base signer, pool]Used by direct customizable vault initialization.
Config-based vault["vault", config, pool]Used by initialize_vault_with_prorata_config and initialize_vault_with_fcfs_config.

Constants

ConstantValueMeaning
PROGRAM_ID.mainnet-betavaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2Public Alpha Vault program ID.
PROGRAM_ID.devnetvaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2Devnet Alpha Vault program ID.
PROGRAM_ID.localhostSNPmGgnywBvvrAKMLundzG6StojyHTHDLu7T4sdhP4kLocalnet program ID with the localnet feature.
ALPHA_VAULT_TREASURY_IDBJQbRiRWhJCyTYZcAuAL3ngDCx3AyFQGKDq8zhiZAKUwTreasury for escrow fees and crank fees.
SLOT_BUFFER3000 slotsMinimum slot-based deposit duration on non-localnet builds.
TIME_BUFFER1200 secondsMinimum timestamp-based deposit duration on non-localnet builds.
MAX_ESCROW_FEE_IN_LAMPORT10_000_000 lamportsMaximum permissionless escrow creation fee.
CRANK_FEE100_000 lamportsFee paid by non-whitelisted crankers during fill instructions.
Max lock durationOne yearEnforced separately for slot and timestamp activation on non-localnet builds.
Max vesting durationOne yearEnforced separately for slot and timestamp activation on non-localnet builds.

Enums

EnumValues
PoolType0 DLMM, 1 Dynamic AMM / DAMM v1, 2 DAMM v2. The SDK names these DLMM, DAMM, and DAMMV2.
VaultMode0 Pro Rata, 1 FCFS.
WhitelistMode0 permissionless, 1 permission with Merkle proof, 2 permission with authority.
ActivationType0 slot, 1 timestamp. The vault inherits the activation type from the connected pool.
VaultStatePREPARING, DEPOSITING, PURCHASING, LOCKING, VESTING, ENDED in the TypeScript SDK.
AccountsTypeDLMM remaining-account slices for transfer-hook X, transfer-hook Y, and transfer-hook reward accounts.

Vault

Vault is the primary zero-copy state account. Padding and deprecated fields are omitted from this table.
FieldTypeUse
poolPubkeyConnected DLMM, Dynamic AMM, or DAMM v2 launch pool.
token_vaultPubkeyQuote token vault controlled by the Vault PDA.
token_out_vaultPubkeyBase token vault controlled by the Vault PDA.
quote_mintPubkeyPool quote token accepted for deposits. Must match the pool token Y or token B mint.
base_mintPubkeyPool launch token bought by the vault. Must match the pool token X or token A mint.
basePubkeyDirect base signer or reusable config account used in the vault PDA.
max_buying_capu64Maximum quote amount a Pro Rata vault can swap.
max_depositing_capu64Maximum total quote amount an FCFS vault can accept.
individual_depositing_capu64Per-user cap for FCFS permissionless deposits. Permissioned escrows use their own max_cap.
depositing_pointu64First slot or timestamp when escrow creation and deposits are allowed.
start_vesting_pointu64First slot or timestamp when bought tokens become claimable.
end_vesting_pointu64Slot or timestamp when linear vesting ends.
total_depositu64Total quote deposited across escrows, excluding quote transfer fees.
total_escrowu64Number of open escrow accounts.
swapped_amountu64Quote amount already used by fill instructions.
bought_tokenu64Base token amount received from fills.
total_refundu64Quote refunded through overflow or remaining-quote withdrawals.
total_claimed_tokenu64Base token claimed across all escrows.
escrow_feeu64Flat lamport fee charged when a permissionless escrow is opened. Must be zero for permissioned vaults.
total_escrow_feeu64Aggregate escrow fees collected.
pool_typeu8PoolType enum value.
vault_modeu8VaultMode enum value.
whitelist_modeu8WhitelistMode enum value.
activation_typeu8ActivationType enum value inherited from the pool.
vault_authorityPubkeyCreator authority that can transfer authority and manage Merkle proof metadata/root configs.
bumpu8Vault PDA bump.

Escrow

An Escrow belongs to one owner and one vault.
FieldTypeUse
vaultPubkeyParent Vault.
ownerPubkeyUser that owns the escrow and signs user actions.
total_depositu64User quote amount currently attributed to this escrow.
claimed_tokenu64Base token already claimed.
last_claimed_pointu64Last slot or timestamp used by claim accounting.
refundedu8Boolean-like flag set after withdraw_remaining_quote.
max_capu64Permissioned wallet cap. Permissionless escrows store 0.
withdrawn_deposit_overflowu64Pro Rata overflow quote already withdrawn before the buy window ends.

Config Accounts

Reusable config accounts are admin-created templates. Config-based vault initialization multiplies quote-denominated caps by the quote mint decimals and derives absolute vesting points from the connected pool activation point.
AccountFieldsUse
ProrataVaultConfigmax_buying_cap, start_vesting_duration, end_vesting_duration, escrow_fee, activation_typeReusable Pro Rata config.
FcfsVaultConfigmax_depositing_cap, start_vesting_duration, end_vesting_duration, depositing_duration_until_last_join_point, individual_depositing_cap, escrow_fee, activation_typeReusable FCFS config.

Permission Accounts

AccountFieldsUse
MerkleRootConfigroot, vault, versionStores one Merkle root for wallet caps. The Merkle leaf is derived from wallet address and max_cap.
MerkleProofMetadatavault, proof_urlOptional URL used by the SDK to fetch Merkle proof data for deposits.
CrankFeeWhitelistownerStores the cranker public key that can skip the crank fee.

Timing Windows

WindowSourceProgram behavior
Deposit windowdepositing_point through pool last_join_pointEscrow creation and deposits are allowed. Pro Rata withdrawals are allowed.
Buy windowPool pre_activation_start_point through last_buying_pointFill instructions can swap quote into base through the connected pool.
Lock windowAfter buy window and before start_vesting_pointUsers cannot claim yet, but can withdraw remaining quote after the buying window.
Vesting windowstart_vesting_point through end_vesting_pointBought base tokens vest linearly and can be claimed.

Token 2022 Support

Alpha Vault uses checked transfers through the token program associated with the connected pool and mint.
Extension or behaviorSupport
Transfer FeeSupported. Deposits calculate transfer-fee excluded amounts; withdrawals and claims emit excluded output amounts.
Transfer MemoSupported for outgoing vault-to-user transfers when the destination Token 2022 account requires incoming memos. Pass the memo program as the first remaining account.
DLMM transfer hooksSupported through fill_dlmm RemainingAccountsInfo and remaining accounts.
SPL TokenSupported.
Dynamic AMM / DAMM v1 Token 2022Not used by the program utility; Dynamic AMM pool info resolves SPL Token programs.