Tracked vault LP supply
Program
0.9.5 is live on mainnet. Use @meteora-ag/vault-sdk@2.4.0 or later.Release summary
What We Shipped
- Version 1 vaults price LP shares with
vault.total_lp_supply - Permissionless
migrate_vaultmoves a version 0 vault to version 1 withdrawandwithdraw_directly_from_strategyrequire the LP account owner to sign
What To Do
| Integrators | What Changed | What To Do |
|---|---|---|
| Deposit and withdraw apps |
|
|
| Quote and virtual price |
|
|
| Account decoders |
|
|
Program: mercurial-vault 0.9.5
Program ID (mainnet and devnet): 24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTiFixed
- Fixed
withdrawandwithdraw_directly_from_strategyletting 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 requiresuser_lp.owner == userbefore 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.supplyand 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 startstotal_lp_supplyat the currentlp_mint.supply. It can only run once per vault. - New
Vaultfieldsversion,total_lp_supplyand_padding0. - New event
VaultMigrated. - New errors
InvalidLpOwner,InvalidLpSupplyAccountingandVaultAlreadyMigrated.
Changed
MAX_STRATEGYreduced from 30 to 29. The 32 bytes of the former 30th strategy slot, unused by every vault, now holdversion,total_lp_supplyand_padding0. The account size and the offsets of all other fields are unchanged.- Version 1 vaults use
total_lp_supplyindeposit,withdraw,withdraw_directly_from_strategyand the performance fee calculation, and update it whenever LP is minted or burned. Version 0 vaults keep usinglp_mint.supply. - New vaults are created as version 1.
Breaking Changes
withdrawandwithdraw_directly_from_strategyno longer accept an LP account thatuseronly controls as a delegate; the LP account owner must sign asuser.Vault.strategiesnow 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 beforemigrate_vaultruns.- Integrations that compute the underlying amount of vault LP must use
total_lp_supplywhenversion == 1, andlp_mint.supplyotherwise.
TypeScript SDK: @meteora-ag/vault-sdk 2.4.0
Added
getVaultLpSupplyto get the LP supply a vault prices shares withinitializeIdleVaultandmigrateVaultin the IDL
Changed
- Sync IDL with vault program 0.9.5:
Vaulthas 29 strategies followed byversion,totalLpSupplyandpadding0, newVaultMigratedevent and errors up toVaultAlreadyMigrated(6024) getVaultSupplyrefetches the vault and returnstotalLpSupplyfor version 1 vaults- Version 1 vaults price shares with
totalLpSupply, not the LP mint supply. ReadinglpMint.supplydirectly gives wrong share and amount calculations, usegetVaultLpSupply/getVaultSupplyin TS orVault::get_lp_supplyin Rust depositno longer refetches the vault, it only uses the vault’s LP mint and token mintrefreshVaultStatealso refreshestokenLpMint- Rust
Vaultstate uses the 0.9.5 layout and addsget_lp_supply,VaultErrormatches the program
Removed
collectDustandwithdraw2from the IDL, the program no longer has them
Fixed
- Strategies of type
KaminoandJupLenddecode, the IDLStrategyTypewas missing both and the RustStrategyTypewas missingJupLend StrategyTypetype matches the strategy names Anchor decodes: addskaminoandjupLend, renamesapricotWithoutLMtoapricotWithoutLm, removescypherandpsylend
Anchor 0.31.1 and Jupiter Lend
Release summary
What We Shipped
- Anchor 0.31.1
- Jupiter Lend
Program: mercurial-vault 0.9.4
Program ID (mainnet and devnet): 24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTiProgram PR #297Changed
- Upgrade to anchor 0.31.1
Added
- Jupiter lend
Removed
- Removed marginfi
- Removed kamino
- Removed solend
Fixed
- Use of
+1as rounding forfrom_liquidity_to_collateral
Initial deposit overflow fix
Release summary
What We Shipped
- Overflow fix for a large initial deposit
Program: mercurial-vault 0.9.3
Program ID (mainnet and devnet): 24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTiProgram PR #290Fixed
- Fix overflow issue when initial deposit amount is too big
Audit fixes and removed endpoints
Release summary
What We Shipped
- Offsite audit fixes
- Removed
collect_dustandwithdraw2
Program: mercurial-vault 0.9.2
Program ID (mainnet and devnet): 24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTiProgram PR #289Fixed
- Fix some audit reports from Offsite
Breaking Changes
- Remove collect_dust endpoint
- Remove withdraw2 endpoint
Removed token registry dependency
Release summary
What We Shipped
- Removed
@solana/spl-token-registry
TypeScript SDK: @meteora-ag/vault-sdk 2.3.1
SDK PR #135Changed
- remove
@solana/spl-token-registrydeps
Moved package ownership to Meteora
Release summary
What We Shipped
- Package moved to the
meteora-agorganization
TypeScript SDK: @meteora-ag/vault-sdk 2.3.0
SDK PR #134Changed
- move to
meteora-agorg
deserializeMint utility
Release summary
What We Shipped
deserializeMint
TypeScript SDK: @mercurial-finance/vault-sdk 2.2.1
SDK PR #131Added
- new utils
deserializeMint
Mint field fixes
Batch vault loading
Release summary
What We Shipped
- Fewer RPC calls in
createMultipleandcreateMultiplePda
TypeScript SDK: @mercurial-finance/vault-sdk 2.1.1
SDK PR #129Changed
- update
createMultiple&createMultiplePdato optimize rpc call
createMultiple parameters
Release summary
What We Shipped
createMultipletakes fewer parameters
TypeScript SDK: @mercurial-finance/vault-sdk 2.1.0
SDK PR #128Fixed
- fix
createMultipleto take in less param
refreshVaultState fix
Release summary
What We Shipped
refreshVaultStateworks again
TypeScript SDK: @mercurial-finance/vault-sdk 2.0.1
SDK PR #126Fixed
- fix
refreshVaultStatenot working
spl-token 0.4.6 and withdrawal change

