Repay Debt
Repay borrowed assets to improve your position health.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
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
Repaying reduces your debt and improves your loan-to-value (LTV) ratio, making your position healthier and reducing liquidation risk.
The repay is complete. Your debt has been reduced.
Withdraw
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
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
Use
helpers::withdraw::redeem() if you hold cTokens without an obligation — see the Withdraw for Lending tab.Build and Send Transaction
The withdrawal is complete. Your collateral has been returned to your wallet.