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

> Track Dynamic Vault release notes, compatibility changes, and upgrade guidance for the vault program, TypeScript SDK, and Rust helpers.

> [!TIP]
>
> Track Dynamic Vault releases here.

**mercurial-vault 0.9.5**

Tracked vault LP supply

> [!NOTE]
>
> Program `0.9.5` is live on mainnet. Use `@meteora-ag/vault-sdk@2.4.0` or later.

## Release summary

| Component | Version | PR |
| - | - | - |
| Program | `0.9.5` | [mercurial-vault #314](https://github.com/MeteoraAg/mercurial-vault/pull/314) |
| TypeScript SDK | `2.4.0` | [vault-sdk #141](https://github.com/MeteoraAg/vault-sdk/pull/141) |

## What We Shipped

* Version 1 vaults price LP shares with `vault.total_lp_supply`
* Permissionless `migrate_vault` moves a version 0 vault to version 1
* `withdraw` and `withdraw_directly_from_strategy` require the LP account owner to sign

## What To Do

<table>
  <thead>
    <tr>
      <th>Integrators</th>
      <th>What Changed</th>
      <th>What To Do</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Deposit and withdraw apps**</td>

      <td>
        <ul>
          <li>`withdraw` and `withdraw_directly_from_strategy` require `user_lp.owner == user` before burning LP.</li>
          <li>Version 1 vaults price LP shares with `vault.total_lp_supply`.</li>
        </ul>
      </td>

      <td>
        <ul>
          <li>Have the LP token account owner sign `withdraw` and `withdraw_directly_from_strategy`.</li>
          <li>Upgrade to `@meteora-ag/vault-sdk@2.4.0`.</li>
        </ul>
      </td>
    </tr>

    <tr>
      <td>**Quote and virtual price**</td>

      <td>
        <ul>
          <li>Version 1 vaults use `total_lp_supply` in `deposit`, `withdraw`, `withdraw_directly_from_strategy`, and the performance fee calculation.</li>
          <li>Version 0 vaults keep using `lp_mint.supply`.</li>
        </ul>
      </td>

      <td>
        <ul>
          <li>Use `getVaultLpSupply` or `getVaultSupply` in TypeScript, or `Vault::get_lp_supply` in Rust.</li>
          <li>Use `total_lp_supply` when `version == 1`, and `lp_mint.supply` otherwise.</li>
        </ul>
      </td>
    </tr>

    <tr>
      <td>**Account decoders**</td>

      <td>
        <ul>
          <li>`Vault.strategies` now has 29 entries. `version`, `total_lp_supply`, and `_padding0` occupy the former 30th strategy slot.</li>
          <li>`migrate_vault` is permissionless, runs once per vault, and starts `total_lp_supply` at the current `lp_mint.supply`.</li>
        </ul>
      </td>

      <td>
        <ul>
          <li>Update the IDL to program `0.9.5` before `migrate_vault` runs. The instruction is `migrateVault` in the SDK IDL.</li>
          <li>New vaults are created as version 1.</li>
        </ul>
      </td>
    </tr>
  </tbody>
</table>

## Program: `mercurial-vault` `0.9.5`

Program ID (mainnet and devnet): `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi`

### Fixed

* Fixed `withdraw` and `withdraw_directly_from_strategy` letting anyone redeem vault LP held in a token account owned by the System Program or the incinerator. SPL Token skips the owner check when burning from such accounts, so the vault now requires `user_lp.owner == user` before burning LP.
* Fixed LP share pricing being manipulable by burning LP outside the vault. LP held by the System Program or the incinerator can be burned by anyone, which lowered `lp_mint.supply` and inflated the value of the remaining LP. Version 1 vaults price LP shares with their own tracked supply, `vault.total_lp_supply`, which only changes when the vault mints or burns LP.

### Added

* New endpoint `migrate_vault` (permissionless) that moves a version 0 vault to version 1 and starts `total_lp_supply` at the current `lp_mint.supply`. It can only run once per vault.
* New `Vault` fields `version`, `total_lp_supply` and `_padding0`.
* New event `VaultMigrated`.
* New errors `InvalidLpOwner`, `InvalidLpSupplyAccounting` and `VaultAlreadyMigrated`.

### Changed

* `MAX_STRATEGY` reduced from 30 to 29. The 32 bytes of the former 30th strategy slot, unused by every vault, now hold `version`, `total_lp_supply` and `_padding0`. The account size and the offsets of all other fields are unchanged.
* Version 1 vaults use `total_lp_supply` in `deposit`, `withdraw`, `withdraw_directly_from_strategy` and the performance fee calculation, and update it whenever LP is minted or burned. Version 0 vaults keep using `lp_mint.supply`.
* New vaults are created as version 1.

### Breaking Changes

* `withdraw` and `withdraw_directly_from_strategy` no longer accept an LP account that `user` only controls as a delegate; the LP account owner must sign as `user`.
* `Vault.strategies` now has 29 entries. Clients decoding the vault with the old IDL see the former 30th slot as a non-default pubkey once the vault is migrated, and must update the IDL before `migrate_vault` runs.
* Integrations that compute the underlying amount of vault LP must use `total_lp_supply` when `version == 1`, and `lp_mint.supply` otherwise.

## TypeScript SDK: `@meteora-ag/vault-sdk` `2.4.0`

> [!TIP]
>
> Production: [`@meteora-ag/vault-sdk@2.4.0`](https://www.npmjs.com/package/@meteora-ag/vault-sdk/v/2.4.0).

### Added

* `getVaultLpSupply` to get the LP supply a vault prices shares with
* `initializeIdleVault` and `migrateVault` in the IDL

### Changed

* Sync IDL with vault program 0.9.5: `Vault` has 29 strategies followed by `version`, `totalLpSupply` and `padding0`, new `VaultMigrated` event and errors up to `VaultAlreadyMigrated` (6024)
* `getVaultSupply` refetches the vault and returns `totalLpSupply` for version 1 vaults
* Version 1 vaults price shares with `totalLpSupply`, not the LP mint supply. Reading `lpMint.supply` directly gives wrong share and amount calculations, use `getVaultLpSupply` / `getVaultSupply` in TS or `Vault::get_lp_supply` in Rust
* `deposit` no longer refetches the vault, it only uses the vault's LP mint and token mint
* `refreshVaultState` also refreshes `tokenLpMint`
* Rust `Vault` state uses the 0.9.5 layout and adds `get_lp_supply`, `VaultError` matches the program

### Removed

* `collectDust` and `withdraw2` from the IDL, the program no longer has them

### Fixed

* Strategies of type `Kamino` and `JupLend` decode, the IDL `StrategyType` was missing both and the Rust `StrategyType` was missing `JupLend`
* `StrategyType` type matches the strategy names Anchor decodes: adds `kamino` and `jupLend`, renames `apricotWithoutLM` to `apricotWithoutLm`, removes `cypher` and `psylend`

**mercurial-vault 0.9.4**

Anchor 0.31.1 and Jupiter Lend

## Release summary

| Component | Version | PR |
| - | - | - |
| Program | `0.9.4` | [mercurial-vault #297](https://github.com/MeteoraAg/mercurial-vault/pull/297) |

## What We Shipped

* Anchor 0.31.1
* Jupiter Lend

## Program: `mercurial-vault` `0.9.4`

Program ID (mainnet and devnet): `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi`

[Program PR #297](https://github.com/MeteoraAg/mercurial-vault/pull/297)

### Changed

* Upgrade to anchor 0.31.1

### Added

* Jupiter lend

### Removed

* Removed marginfi
* Removed kamino
* Removed solend

### Fixed

* Use of `+1` as rounding for `from_liquidity_to_collateral`

**mercurial-vault 0.9.3**

Initial deposit overflow fix

## Release summary

| Component | Version | PR |
| - | - | - |
| Program | `0.9.3` | [mercurial-vault #290](https://github.com/MeteoraAg/mercurial-vault/pull/290) |

## What We Shipped

* Overflow fix for a large initial deposit

## Program: `mercurial-vault` `0.9.3`

Program ID (mainnet and devnet): `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi`

[Program PR #290](https://github.com/MeteoraAg/mercurial-vault/pull/290)

### Fixed

* Fix overflow issue when initial deposit amount is too big

**mercurial-vault 0.9.2**

Audit fixes and removed endpoints

## Release summary

| Component | Version | PR |
| - | - | - |
| Program | `0.9.2` | [mercurial-vault #289](https://github.com/mercurial-finance/mercurial-vault/pull/289) |

## What We Shipped

* Offsite audit fixes
* Removed `collect_dust` and `withdraw2`

## Program: `mercurial-vault` `0.9.2`

Program ID (mainnet and devnet): `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi`

[Program PR #289](https://github.com/mercurial-finance/mercurial-vault/pull/289)

### Fixed

* Fix some audit reports from Offsite

### Breaking Changes

* Remove collect\_dust endpoint
* Remove withdraw2 endpoint

**@meteora-ag/vault-sdk 2.3.1**

Removed token registry dependency

## Release summary

| Component | Version | PR |
| - | - | - |
| TypeScript SDK | `2.3.1` | [vault-sdk #135](https://github.com/mercurial-finance/vault-sdk/pull/135) |

## What We Shipped

* Removed `@solana/spl-token-registry`

## TypeScript SDK: `@meteora-ag/vault-sdk` `2.3.1`

[SDK PR #135](https://github.com/mercurial-finance/vault-sdk/pull/135)

### Changed

* remove `@solana/spl-token-registry` deps

**@meteora-ag/vault-sdk 2.3.0**

Moved package ownership to Meteora

## Release summary

| Component | Version | PR |
| - | - | - |
| TypeScript SDK | `2.3.0` | [vault-sdk #134](https://github.com/mercurial-finance/vault-sdk/pull/134) |

## What We Shipped

* Package moved to the `meteora-ag` organization

## TypeScript SDK: `@meteora-ag/vault-sdk` `2.3.0`

[SDK PR #134](https://github.com/mercurial-finance/vault-sdk/pull/134)

### Changed

* move to `meteora-ag` org

**@mercurial-finance/vault-sdk 2.2.1**

deserializeMint utility

## Release summary

| Component | Version | PR |
| - | - | - |
| TypeScript SDK | `2.2.1` | [vault-sdk #131](https://github.com/mercurial-finance/vault-sdk/pull/131) |

## What We Shipped

* `deserializeMint`

## TypeScript SDK: `@mercurial-finance/vault-sdk` `2.2.1`

[SDK PR #131](https://github.com/mercurial-finance/vault-sdk/pull/131)

### Added

* new utils `deserializeMint`

**@mercurial-finance/vault-sdk 2.2.0**

Mint field fixes

## Release summary

| Component | Version | PR |
| - | - | - |
| TypeScript SDK | `2.2.0` | [vault-sdk #130](https://github.com/mercurial-finance/vault-sdk/pull/130) |

## What We Shipped

* Fixed `tokenMint` and `tokenLpMint`
* Removed `lpMintPda`

## TypeScript SDK: `@mercurial-finance/vault-sdk` `2.2.0`

[SDK PR #130](https://github.com/mercurial-finance/vault-sdk/pull/130)

### Fixed

* fix `tokenMint` & `tokenLpMint`

### Removed

* remove `lpMintPda` field

**@mercurial-finance/vault-sdk 2.1.1**

Batch vault loading

## Release summary

| Component | Version | PR |
| - | - | - |
| TypeScript SDK | `2.1.1` | [vault-sdk #129](https://github.com/mercurial-finance/vault-sdk/pull/129) |

## What We Shipped

* Fewer RPC calls in `createMultiple` and `createMultiplePda`

## TypeScript SDK: `@mercurial-finance/vault-sdk` `2.1.1`

[SDK PR #129](https://github.com/mercurial-finance/vault-sdk/pull/129)

### Changed

* update `createMultiple` & `createMultiplePda` to optimize rpc call

**@mercurial-finance/vault-sdk 2.1.0**

createMultiple parameters

## Release summary

| Component | Version | PR |
| - | - | - |
| TypeScript SDK | `2.1.0` | [vault-sdk #128](https://github.com/mercurial-finance/vault-sdk/pull/128) |

## What We Shipped

* `createMultiple` takes fewer parameters

## TypeScript SDK: `@mercurial-finance/vault-sdk` `2.1.0`

[SDK PR #128](https://github.com/mercurial-finance/vault-sdk/pull/128)

### Fixed

* fix `createMultiple` to take in less param

**@mercurial-finance/vault-sdk 2.0.1**

refreshVaultState fix

## Release summary

| Component | Version | PR |
| - | - | - |
| TypeScript SDK | `2.0.1` | [vault-sdk #126](https://github.com/mercurial-finance/vault-sdk/pull/126) |

## What We Shipped

* `refreshVaultState` works again

## TypeScript SDK: `@mercurial-finance/vault-sdk` `2.0.1`

[SDK PR #126](https://github.com/mercurial-finance/vault-sdk/pull/126)

### Fixed

* fix `refreshVaultState` not working

**@mercurial-finance/vault-sdk 2.0.0**

spl-token 0.4.6 and withdrawal change

## Release summary

| Component | Version | PR |
| - | - | - |
| TypeScript SDK | `2.0.0` | [vault-sdk #124](https://github.com/mercurial-finance/vault-sdk/pull/124) |

## What We Shipped

* `@solana/spl-token` `0.4.6`
* Removed direct strategy withdrawal logic

## TypeScript SDK: `@mercurial-finance/vault-sdk` `2.0.0`

[SDK PR #124](https://github.com/mercurial-finance/vault-sdk/pull/124)

### Changed

* Pump "@solana/spl-token" to 0.4.6 and various relevant packages

### Removed

* Remove logic to withdraw directly from strategy


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