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 is based on mercurial-vault/programs/vault for the current on-chain program account model and vault-sdk/ts-client for public TypeScript helper names.

PDA Map

AccountSDK helperSeeds
Rebalance vaultgetVaultPdas(tokenMint, programId)vault, token mint, VAULT_BASE_KEY
Idle vaultcustom derivationvault, token mint, 11111111111111111111111111111111
Token vaultgetVaultPdas(tokenMint, programId)token_vault, vault
LP mintgetVaultPdas(tokenMint, programId)lp_mint, vault
Strategydirect derivationvault, reserve, strategy_index byte
Collateral vaultdirect derivationcollateral_vault, strategy
Affiliate partner PDASDK internal affiliate helpervault, partner token ATA
Affiliate user PDASDK internal affiliate helperpartner PDA, user wallet
The vault signs token transfers and LP minting with the rebalance or idle vault seeds stored in Vault.bumps.

Constants

ConstantValueUse
PROGRAM_ID24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTiPublic vault program ID.
AFFILIATE_PROGRAM_IDGacY9YuN16HNRTy7ZWwULPccwvfFSBeNLuAQP7y38Du3Public affiliate wrapper program used by the SDK when affiliateId is configured.
VAULT_BASE_KEYHWzXGcGHy4tcpYfaRDCyLNzXqBTv3E6BttpCH2vJxArvBase key for rebalance vault PDA derivation.
Treasury9kZeN47U2dubGbbzMrzzoRAUvpuxVLRcjW9XiFpYjUo4Required owner for fee_vault and reward token destination accounts.
MAX_STRATEGY30Number of strategy pubkeys stored in each vault.
MAX_BUMPS10Number of stored bump bytes in each strategy.
LOCKED_PROFIT_DEGRADATION_DENOMINATOR1_000_000_000_000Denominator for locked-profit release math.

Vault

Vault stores the accounting state for one token mint.
FieldTypeMeaning
enabledu81 allows deposits and withdrawals. 0 blocks deposits; withdrawals still use normal withdrawal handlers.
bumpsVaultBumpsVault and token-vault bump bytes used for PDA signer seeds.
total_amountu64Total vault liquidity, including reserve tokens and strategy liquidity.
token_vaultPubkeySPL token account holding vault reserves.
fee_vaultPubkeyLP token account owned by treasury that receives performance fee LP.
token_mintPubkeyUnderlying token mint accepted by the vault.
lp_mintPubkeyVault LP mint. Deposits mint LP; withdrawals burn LP.
strategies[Pubkey; 30]Strategy accounts active for the vault. Empty slots are the default pubkey.
basePubkeyBase seed key. Matches rebalance or idle vault base.
adminPubkeyAdmin authority for vault configuration and strategy management.
operatorPubkeyOperator authority allowed to rebalance and claim strategy rewards.
locked_profit_trackerLockedProfitTrackerTracks profit that unlocks over time after a rebalance reports gain.
Use the TypeScript SDK’s VaultImpl.create(connection, tokenMint) or VaultImpl.createMultiple(...) for hydrated vault clients. Low-level readers can fetch the Anchor vault account directly by PDA.

LockedProfitTracker

FieldTypeMeaning
last_updated_locked_profitu64Locked profit remaining from the last report.
last_reportu64Unix timestamp of the last locked-profit update.
locked_profit_degradationu64Per-second unlock rate over LOCKED_PROFIT_DEGRADATION_DENOMINATOR. Default fully releases profit over 6 hours.
Vault.get_unlocked_amount(current_time) returns total_amount - current_locked_profit. Deposits, withdrawals, virtual price, and SDK helpers use this unlocked amount rather than raw total_amount.

Strategy

Strategy stores one external or internal strategy attached to a rebalance vault.
FieldTypeMeaning
reservePubkeyExternal reserve, market, or pool account used by the strategy handler.
collateral_vaultPubkeyVault-owned token account holding strategy collateral tokens.
strategy_typeStrategyTypeStrategy handler enum.
current_liquidityu64Last recorded liquidity in underlying token units.
bumps[u8; 10]Strategy and downstream protocol PDA bump bytes.
vaultPubkeyParent vault account.
is_disableu8Non-zero means the strategy was disabled and cannot be re-added.
The current program source supports StrategyType::Vault and StrategyType::JupLend handlers. Other enum variants remain in the enum for historical compatibility, but their handlers panic as unsupported in the current source.

StrategyType

VariantCurrent source behavior
PortFinanceWithoutLMUnsupported handler.
PortFinanceWithLMUnsupported handler.
SolendWithoutLMUnsupported handler.
MangoUnsupported handler.
SolendWithLMUnsupported handler.
ApricotWithoutLMUnsupported handler.
FranciumUnsupported handler.
TulipUnsupported handler.
VaultInternal vault-reserve handler and compatibility strategy.
DriftUnsupported handler.
FraktUnsupported handler.
MarginfiUnsupported handler.
KaminoUnsupported handler in the current source.
JupLendJupiter Lend strategy handler in the current source.

Bump Types

TypeFieldMeaning
VaultBumpsvault_bumpBump for the vault PDA.
VaultBumpstoken_vault_bumpBump for the token-vault PDA.
StrategyBumpsstrategy_indexSeed byte used in strategy PDA derivation.
StrategyBumpsother_bumpsTen downstream bump bytes. The current initialize_strategy handler requires other_bumps[0] == strategy_index and other_bumps[1] == strategy PDA bump.

Account Reads

NeedTypeScript SDKRust / Anchor
Vault state from token mintVaultImpl.create(connection, tokenMint)Derive vault PDA, then fetch mercurial_vault::state::Vault.
Vault state from vault PDAVaultImpl.createMultipleWithPda(connection, [vault])Fetch Vault directly by pubkey.
Vault LP supplyvault.getVaultSupply() or getLpSupply(connection, lpMint)Fetch anchor_spl::token::Mint for vault.lp_mint.
User LP balancevault.getUserBalance(owner) or VaultImpl.fetchMultipleUserBalance(...)Read the owner’s ATA for vault.lp_mint.
Strategiesvault.getStrategiesState()Iterate non-default vault.strategies and fetch Strategy.

Gotchas

TopicDetail
Rebalance vs idle vaultAdmin, operator, strategy, fee vault, and rebalance instructions require vault.get_vault_type() == RebalanceVault. Idle vaults cannot be rebalanced.
Fee vaultinitialize_strategy fails with FeeVaultIsNotSet unless fee_vault was set to a treasury-owned LP token account.
Locked profittotal_amount can be higher than the amount available for withdrawal until locked profit has degraded.
Strategy slotsA vault can hold up to 30 strategy pubkeys. Removed strategies clear their slot unless removed through the advance-payment path, which also disables the strategy.
Source and IDL driftThe public TS IDL in vault-sdk is older than the current mercurial-vault program source. Prefer source-backed docs for low-level program behavior and SDK docs for public client behavior.