Deposit to Earn Vault
Deposit assets to start earning yield.1
Import Dependencies
Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building.2
Load Signer and Initialize Vault
Load your keypair from a file and initialize RPC connections and the vault instance.Replace
/path/to/your/keypair.json with the actual path to your keypair file. The rpcSubscriptions enables real-time transaction confirmation.3
Build Deposit Instructions
Generate deposit instructions for the vault.The
depositIxs method returns deposit instructions to add your assets to the vault and mint vault shares.4
Build and Sign Transaction
Use Kit’s functional pipe pattern to build and sign the transaction with a fresh blockhash.5
Send and Confirm Transaction
Send the deposit transaction and wait for confirmation.Once the deposit transaction is confirmed, your assets are deposited into the vault and you start earning yield. Vault shares are minted to represent your position.
Withdraw from Earn Vault
Withdraw your vault shares to receive the underlying tokens plus accrued interest.1
Import Dependencies
Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building.2
Load Signer and Initialize Vault
Load your keypair from a file and initialize RPC connections and the vault instance.Replace
/path/to/your/keypair.json with the actual path to your keypair file. The rpcSubscriptions enables real-time transaction confirmation.3
Build Withdraw Instructions
Generate withdraw instructions including optional unstaking instructions.The
withdrawIxs method returns both unstaking and withdraw instructions. The amount represents vault shares to redeem, not the underlying token amount.4
Build and Sign Transaction
Use Kit’s functional pipe pattern to build and sign the transaction with a fresh blockhash.5
Send and Confirm Transaction
Send the withdraw transaction and wait for confirmation.Once the withdraw transaction is confirmed, your vault shares are burned and you receive the underlying tokens plus any accrued interest.
What Happens When You Deposit?
What Happens When You Deposit?
- You deposit USDC (or another token) into the vault
- You receive vault share tokens (like kVUSDC or similar) in your wallet
- These shares represent your proportional ownership of the vault
- The shares appreciate in value as the vault earns yield
What Happens When You Withdraw?
What Happens When You Withdraw?
- You burn the vault share tokens from your wallet
- You receive back the underlying tokens (USDC) based on the current exchange rate