Skip to main content
Deposit assets into Kamino Earn vaults to start earning yield. The SDK handles transaction building, instruction creation, and vault interaction.

Complete Flow

Implement the full deposit flow either in an off-chain TypeScript client or via on-chain Rust CPI within your Anchor program.
1

Import Dependencies

Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building.
@solana/kit provides modern utilities for RPC, transaction building, and signing. @kamino-finance/klend-sdk contains vault operation methods.
2

Load Keypair and Initialize Vault

Load the keypair from file, initialize RPC connections, and create the vault instance.
parseKeypairFile loads an existing keypair from a JSON file.
3

Build Deposit Instructions

Generate deposit instructions for the specified amount.
The depositIxs method returns the necessary instructions to deposit assets into the vault.
4

Build and Send Transaction

Fetch the latest blockhash and construct the transaction message.
Kit’s pipe function enables functional composition of transaction building steps for cleaner, more maintainable code.
Sign and send the transaction with built-in confirmation.
The deposit is complete. Your assets are now deposited in the vault and earning yield.

Full Code Example