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.

The alpha-vault IDL exposes the instructions below. Integrators should use the TypeScript SDK for transaction construction or build through CPI.

Vault Initialization

InstructionParametersMain signers and accountsBehavior
initialize_prorata_vaultpool_type, quote_mint, base_mint, depositing_point, start_vesting_point, end_vesting_point, max_buying_cap, escrow_fee, whitelist_modefunder, base signer, vault, pool, system_programCreates a direct Pro Rata vault PDA from base and pool. Validates pool linkage, mints, timing, cap, escrow fee, and whitelist mode.
initialize_fcfs_vaultpool_type, quote_mint, base_mint, depositing_point, start_vesting_point, end_vesting_point, max_depositing_cap, individual_depositing_cap, escrow_fee, whitelist_modefunder, base signer, vault, pool, system_programCreates a direct FCFS vault PDA from base and pool. Validates pool linkage, mints, timing, caps, escrow fee, and whitelist mode.
initialize_vault_with_prorata_configpool_type, quote_mint, base_mint, whitelist_modefunder, vault, pool, quote_mint, config, system_programCreates a Pro Rata vault PDA from a reusable config and pool. Computes vesting points from pool activation plus config durations.
initialize_vault_with_fcfs_configpool_type, quote_mint, base_mint, whitelist_modefunder, vault, pool, quote_mint, config, system_programCreates an FCFS vault PDA from a reusable config and pool. Computes deposit start from pool last_join_point minus config deposit duration.
transfer_vault_authoritynew_authorityCurrent vault_authority, vaultUpdates the vault authority.

Config Management

InstructionParametersAuthorityBehavior
create_prorata_configmax_buying_cap, start_vesting_duration, end_vesting_duration, escrow_fee, activation_type, indexProgram adminCreates a reusable Pro Rata config PDA from index.
close_prorata_configNoneProgram adminCloses a Pro Rata config and sends rent to rent_receiver.
create_fcfs_configmax_depositing_cap, start_vesting_duration, end_vesting_duration, depositing_duration_until_last_join_point, individual_depositing_cap, escrow_fee, activation_type, indexProgram adminCreates a reusable FCFS config PDA from index.
close_fcfs_configNoneProgram adminCloses an FCFS config and sends rent to rent_receiver.
update_prorata_vault_parametersmax_buying_cap, start_vesting_point, end_vesting_pointProgram adminUpdates Pro Rata vault cap and vesting points before pool timing constraints expire.
update_fcfs_vault_parametersmax_depositing_cap, depositing_point, individual_depositing_cap, start_vesting_point, end_vesting_pointProgram adminUpdates FCFS vault caps and timing. max_depositing_cap cannot be below current total_deposit.

Escrow Creation

InstructionParametersMain accountsBehavior
create_new_escrowNonevault, pool, escrow, owner, payer, optional escrow_fee_receiver, system_programCreates a permissionless escrow during the deposit window. Transfers escrow_fee to the treasury when the vault charges one.
create_permissioned_escrowmax_cap, proofvault, pool, escrow, owner, merkle_root_config, payer, optional escrow_fee_receiver, system_programCreates a Merkle-proof escrow after verifying that the owner and max_cap leaf belongs to the root.
create_permissioned_escrow_with_authoritymax_capvault, pool, escrow, owner, payer, system_programCreates an authority-permissioned escrow. The payer must equal vault_authority, and max_cap must be greater than zero.
close_escrowNonevault, escrow, owner, rent_receiverCloses an escrow when it is empty or when all required claims and quote refunds are complete.

User Token Actions

InstructionParametersMain accountsBehavior
depositmax_amountvault, pool, escrow, source_token, token_vault, token_mint, token_program, ownerDeposits quote during the deposit window. FCFS deposits are clipped to remaining vault capacity; all modes are clipped to escrow quota.
withdrawamountvault, pool, escrow, destination_token, token_vault, token_mint, token_program, ownerPro Rata only. During the deposit window, withdraws deposited quote. After the join window and before the buying window ends, withdraws deposit overflow.
withdraw_remaining_quoteNonevault, pool, escrow, token_vault, destination_token, token_mint, token_program, ownerAfter the buying window, withdraws the escrow’s unused quote share once.
claim_tokenNonevault, escrow, token_out_vault, destination_token, token_mint, token_program, ownerClaims vested bought base tokens after start_vesting_point.

Fill Instructions

Fill instructions can run during the connected pool’s pre-activation buy window. They swap from the vault quote token account into the vault base token account.
InstructionParametersPool accountsBehavior
fill_dlmmmax_amount, remaining_accounts_infoDLMM pair, reserves, bin array bitmap extension, oracle, token mint programs, DLMM event authority, memo program, optional Token 2022 transfer-hook remaining accountsCalls DLMM swap2. The SDK estimates a partial quote, passes transfer-hook remaining accounts, and returns null when a partial DLMM fill has insufficient liquidity.
fill_dynamic_ammmax_amountDynamic AMM pool, vault A/B accounts, LP mints, LP vaults, admin token fee, Dynamic Vault programCalls DAMM v1 / Dynamic AMM swap.
fill_damm_v2max_amountDAMM v2 pool authority, pool, token A/B vaults, token A/B mints and programs, DAMM v2 event authorityCalls DAMM v2 swap.
Each fill validates the expected PoolType, caps the amount by remaining swappable quote, updates swapped_amount and bought_token, emits SwapFill, and charges the crank fee unless a valid CrankFeeWhitelist is supplied.

Merkle Proof Metadata

InstructionParametersAuthorityBehavior
create_merkle_root_configroot, versionProgram admin or vault_authorityCreates a Merkle root config for PermissionWithMerkleProof vaults.
create_merkle_proof_metadataproof_urlProgram admin or vault_authorityStores an optional proof URL for SDK clients.
close_merkle_proof_metadataNoneProgram admin or vault_authorityCloses Merkle proof metadata and returns rent.

Crank Fee Whitelist

InstructionParametersAuthorityBehavior
create_crank_fee_whitelistNoneProgram adminCreates a whitelist PDA for a cranker public key.
close_crank_fee_whitelistNoneProgram adminCloses the whitelist PDA and emits the removed cranker.

Validation

AreaRule
Pool linkageThe connected pool must store the derived Alpha Vault address before initialization succeeds.
Mint orderquote_mint must match pool token Y or token B; base_mint must match pool token X or token A.
Permissioned feesMerkle-proof and authority-permissioned vaults must set escrow_fee to zero.
Deposit windowEscrow creation and deposits require current slot or timestamp between depositing_point and pool last_join_point.
Fill windowFills require current slot or timestamp between pool pre_activation_start_point and last_buying_point.
ClaimsClaims require current slot or timestamp at or after start_vesting_point.
Remaining quotewithdraw_remaining_quote requires current slot or timestamp after last_buying_point and can only run once per escrow.