Deposit flow
1
1. Import dependencies, configure Privy, and initialize clients
Import the required packages for Privy client, Solana RPC communication, and Kamino SDK operations. Set up your Privy credentials and initialize the Privy client and RPC connection.
2
2. Create a Privy user and Solana wallet
Create a Privy user, generate a Solana wallet linked to the user, and set your authorization key as the wallet owner. We recommend funding the wallet with SOL and the tokens you will lend (likely USDC) so that your wallet can submit transactions successfully.
3
3. Build Kamino Earn deposit instructions and transaction message
Initialize the vault and generate deposit instructions using a noop signer. A noop signer is used to build instructions without requiring the actual private key. Privy will handle signing later. Additionally fetch the latest blockhash and construct the transaction message.
4
4. Sign the transaction with Privy
Compile the transaction, serialize it, and sign using Privy’s wallet API. Privy handles the signing securely using the embedded wallet. The private key never leaves Privy’s infrastructure.
5
5. Send the transaction
Submit the signed transaction to the Solana network.
Your deposit is complete! The user’s funds are now deposited in the Kamino Earn vault using their
Privy embedded wallet.

