rust-client
provides a convenient way to interact with the Dynamic Vault program.
Before you begin, here are some important resources:
Dependencies
Addmercurial-vault
to dependencies:
Functions
Fetch Vault State
1
Find the vault pubkey based on the token_mint (USDC, USDT, or SOL)
2
Get the vault_state using the vault pubkey
Total unlocked amount in vault
Get the total amount of tokens that are available for withdrawal. The vault will lock the yield claimed initially and release them over a pre-defined period of time.Total reserve in the vault
We currently keep 10% of the total deposits in the vault to support swaps and immediate withdrawals.Total LP supply for the vault
Retrieve the total LP token amount in the vault.Vault virtual price calculation
Get the current virtual price for the vault.Deposit Liquidity into the Dynamic Vault
1
Retrieve the vault, token_vault, lp_mint, user_token and user_lp values
2
Execute the instruction to deposit liquidity into the pool
Withdraw Liquidity from Dynamic Vault
1
Retrieve the vault, token_vault, lp_mint, user_token and user_lp values
2
Execute the instruction to withdraw liquidity from pool
Withdraw Directly from Lending Platforms
If you are integrating the vaults directly onto your platform, you can use this function to withdraw funds directly from a selected lending platform.1
Retrieve the list of pubkeys of the lending platform pools integrated with the vault
2
Call the function to withdraw funds from the selected strategy pool