Skip to main content
These examples use the SDK methods exported by @meteora-ag/alpha-vault. The SDK returns unsigned Transaction objects or instructions; sign and send them with your wallet adapter, backend signer, or test keypair.

Load A Vault

Read User State

Deposit

deposit(maxAmount, owner, merkleProof?) creates the escrow first when needed for permissionless and Merkle-proof vaults. For PermissionWithAuthority, the vault authority must create the escrow before the user can deposit.

Authority-Created Escrows

Use this flow for WhitelistMode.PermissionWithAuthority. The vault authority pays rent and creates an escrow with a wallet-specific cap.
For batches, build instructions and place them in your own transaction:

Withdraw During Deposit Window

withdraw is only available for Pro Rata vaults. During the deposit window it withdraws a user’s deposit share. After the join window and before the buying window ends, it can withdraw Pro Rata deposit overflow.

Withdraw Remaining Quote

After the buying window ends, users can withdraw unused quote once from their escrow.

Claim Bought Token

Users can claim bought base tokens after the vault’s startVestingPoint. Claims vest linearly until endVestingPoint.

Fill The Vault

fillVault(payer) chooses the correct pool-specific fill helper from vault.poolType. It returns null when no fill transaction should be sent, such as a fully filled vault or a DLMM quote with insufficient liquidity for a partial fill.
Fill instructions can charge the Alpha Vault crank fee unless the cranker has a CrankFeeWhitelist PDA.

Merkle Proof Metadata

For PermissionWithMerkleProof, the vault authority or admin can create an on-chain Merkle root config and optional proof URL metadata. The SDK falls back to Meteora’s default proof API when metadata is missing.

Build A Merkle Tree Locally

The SDK exports BalanceTree for creating Merkle roots and proofs from wallet caps.