> ## 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.

# Dynamic Vault Developer Guide

> Learn how to build Dynamic Vault integrations with the vault program, TypeScript SDK, Rust helpers, Data API, and release notes.

Dynamic Vault is Meteora's yield vault layer on Solana. Integrators deposit a supported token into a vault, receive vault LP tokens, and withdraw by burning LP tokens against the vault's unlocked amount. To learn more about the product model, read the product documentation.

> [card] [Learn more about Dynamic Vault](https://docs.meteora.ag/legacy-products/dynamic-vault/what-is-dynamic-vault)
>
> Overview of vault behavior, yield routing, access rules, and product concepts.

> [card] [Dynamic Vault Formulas](https://docs.meteora.ag/legacy-products/dynamic-vault/formulas.md)
>
> Formulas for virtual price, locked profit, LP share, and withdrawal accounting.

## Integration

> [card] [Program Accounts](https://docs.meteora.ag/developer-guides/dynamic-vault/program/accounts.md)
>
> Account model for vaults, strategies, locked profit, bumps, PDA seeds, and constants.

> [card] [Program Instructions](https://docs.meteora.ag/developer-guides/dynamic-vault/program/instructions.md)
>
> Instruction families for user deposits, withdrawals, strategy rebalancing, rewards, operators, and admin flows.

> [card] [Program Events](https://docs.meteora.ag/developer-guides/dynamic-vault/program/events.md)
>
> Anchor events emitted by liquidity, strategy, reward, performance fee, loss, and simulation flows.

> [card] [Program Errors](https://docs.meteora.ag/developer-guides/dynamic-vault/program/errors.md)
>
> Anchor custom errors, messages, likely causes, and source/IDL naming notes.

> [card] [TypeScript SDK](https://docs.meteora.ag/developer-guides/dynamic-vault/typescript-sdk/getting-started.md)
>
> Official TypeScript SDK for creating vault clients, deposits, withdrawals, state reads, helpers, and affiliate flows.

> [card] [Rust Integration](https://docs.meteora.ag/developer-guides/dynamic-vault/rust-integration/library.md)
>
> Rust account readers, CLI helpers, and CPI account planning for the vault program.

> [card] [Dynamic Vault APIs](https://docs.meteora.ag/developer-guides/dynamic-vault/api-reference/overview.md)
>
> Indexed read-only vault, APY, virtual price, vault address, and strategy allocation data.

## Program IDs

The public `vault` program ID is the same on mainnet and devnet:

| Network | Program ID |
| - | - |
| Mainnet Beta | `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi` |
| Devnet | `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi` |

The TypeScript SDK also exposes the affiliate program ID:

| Program | Address |
| - | - |
| Affiliate vault program | `GacY9YuN16HNRTy7ZWwULPccwvfFSBeNLuAQP7y38Du3` |

## Constants

| Constant | Value | Use |
| - | - | - |
| `VAULT_BASE_KEY` / `get_base_address()` | `HWzXGcGHy4tcpYfaRDCyLNzXqBTv3E6BttpCH2vJxArv` | Base key used in rebalance vault PDA seeds. |
| `get_base_address_for_idle_vault()` | `11111111111111111111111111111111` | Base key used in idle vault PDA seeds. |
| `get_treasury_address()` | `9kZeN47U2dubGbbzMrzzoRAUvpuxVLRcjW9XiFpYjUo4` | Owner required for fee vault and reward destination token accounts. |
| `MAX_STRATEGY` | `29` | Maximum strategy addresses stored on a vault. |
| `MAX_BUMPS` | `10` | Maximum bump bytes stored on a strategy. |
| `LOCKED_PROFIT_DEGRADATION_DENOMINATOR` | `1_000_000_000_000` | Denominator for locked-profit drip calculations. |
| Performance fee | `500 / 10000` | 5% performance fee minted as vault LP tokens when rebalance reports profit. |

## Source Repositories

> [card] [Vault Program](https://github.com/MeteoraAg/mercurial-vault/tree/main/programs/vault)
>
> Anchor source for the current vault program handlers, accounts, events, and errors.

> [card] [Vault SDK](https://github.com/MeteoraAg/vault-sdk)
>
> Public TypeScript SDK, Anchor IDL, vendored program crate, tests, and Rust client helper.

> [card] [TypeScript SDK Package](https://www.npmjs.com/package/@meteora-ag/vault-sdk)
>
> Published package for transaction builders, state reads, helper functions, and affiliate support.

> [card] [Rust Client](https://github.com/MeteoraAg/vault-sdk/tree/main/rust-client)
>
> CLI-style Rust examples for showing vault state, simulating unlocked amount, deposits, and withdrawals.

> [!NOTE]
>
> The current program source in `mercurial-vault/programs/vault` is newer than the TypeScript SDK's checked-in IDL in a few areas. These docs call out source-backed behavior and avoid documenting older IDL-only entries as current program handlers.

## Commands

| Task | Command |
| - | - |
| Build TypeScript SDK | `cd vault-sdk/ts-client && pnpm install && pnpm run build` |
| Run TypeScript SDK tests | `cd vault-sdk/ts-client && pnpm test` |
| Run affiliate SDK tests | `cd vault-sdk/ts-client && pnpm run test-affiliate` |
| Build Rust client | `cd vault-sdk/rust-client && cargo build` |
| Inspect Rust client commands | `cd vault-sdk/rust-client && ../target/debug/rust-client --help` |
| Build current vault program | `cd mercurial-vault && NO_DNA=1 anchor build` |
| Run current vault program tests | `cd mercurial-vault && NO_DNA=1 anchor test` |

## Stay Updated

> [card] [Dynamic Vault Changelog](https://docs.meteora.ag/developer-guides/dynamic-vault/changelog.md)
>
> Program, SDK, IDL, Rust helper, and API notes for integration planning.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.