Skip to main content

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.