Deposit Collateral
Deposit assets as collateral to enable borrowing.Add Dependencies
klend-interface is a lightweight Rust instruction builder that creates Vec<Instruction> with required refresh instructions prepended automatically.Set Up RPC Client
Build Obligation Context
Derive the obligation PDA, fetch its account data along with all associated reserves, and build anObligationContext.ObligationContext is the recommended approach for obligation-based operations. It fetches the obligation and its associated reserves, then provides convenient .deposit(), .borrow(), .repay(), and .withdraw() methods.Derive Token Accounts
Build Instructions
Build and Send Transaction
The deposit is complete. Your collateral has been supplied and your borrow position is open.