Skip to main content
The vault program exposes user liquidity instructions, strategy rebalance instructions, and admin/operator instructions. Apps should normally use the TypeScript SDK for transaction construction. Programs using CPI should generate bindings from the IDL and cross-check account order against the current source.
The current mercurial-vault/programs/vault source includes initialize_idle_vault and JupLend strategy support. The checked-in TypeScript IDL in vault-sdk is older in a few places, so this page follows the current program handlers.

User Liquidity

deposit rejects zero amounts and rejects deposits when vault.enabled == 0. withdraw does not check enabled, so users can still exit a disabled vault.

Deposit Accounting

Withdrawal Accounting

Vault Initialization

Initialization sets admin and operator from the configured program admin, initializes the token vault and LP mint PDAs, clears all strategy slots, initializes locked profit, and enables the vault.

Strategy Management

initialize_strategy requires vault.fee_vault to be set. The handler validates the strategy bump layout and fails with InvalidBump if other_bumps[0] or other_bumps[1] do not match the expected strategy index and PDA bump.

Rebalancing And Rewards

Strategy instructions pass protocol-specific remaining accounts to the active strategy handler. The current source-backed external handler is JupLend.

Rebalance Wrapper Behavior

deposit_strategy, withdraw_strategy, remove_strategy, remove_strategy2, and withdraw_directly_from_strategy run through shared rebalance accounting.

Admin And Operator Controls

All admin and operator controls except get_unlocked_amount require a rebalance vault.

TypeScript SDK Mapping

Low-Level Gotchas