redeem_reserve_collateral
Redeem collateral tokens (cTokens) for underlying liquidity tokens from a reserve.Signature
Parameters
The amount of collateral tokens to redeem.
Accounts
The owner of the collateral tokens.
The lending market.
The reserve.
- Must be mutable
PDA authority for the lending market.
The reserve’s liquidity token mint.
The reserve’s collateral token mint.
- Must be mutable
The reserve’s liquidity supply vault.
- Must be mutable
The user’s source collateral token account.
- Must be mutable
The user’s destination liquidity token account.
- Must be mutable
- Must have owner as authority
The SPL Token program.
The token program for liquidity.
The Solana instructions sysvar.
Returns
ReturnsOk(()) on success.
Errors
GlobalEmergencyMode: Emergency mode is enabled (via access control)WithdrawTooSmall: Withdrawal amount is too smallInsufficientLiquidity: Reserve doesn’t have enough liquidity
deposit_obligation_collateral
Deposit collateral tokens from a user’s wallet into an obligation.Signature
Use the v2 variant which includes farming support. The v1 variant is deprecated.
Parameters
The amount of collateral tokens to deposit.
Accounts
The owner of the obligation.
The obligation.
- Must be mutable
- Must have the specified owner
The lending market.
The reserve for the collateral being deposited.
- Must be mutable
The reserve’s collateral supply vault.
- Must be mutable
The user’s source collateral token account.
- Must be mutable
The SPL Token program.
The Solana instructions sysvar.
PDA authority (v2 only).
Optional farming accounts (v2 only).
The Kamino Farms program (v2 only).
Returns
ReturnsOk(()) on success.
Errors
GlobalEmergencyMode: Emergency mode is enabledObligationReserveLimit: Obligation has too many different collateral typesIsolatedAssetTierViolation: Collateral violates isolated asset rulesInconsistentElevationGroup: Reserve elevation group doesn’t match obligation
withdraw_obligation_collateral
Withdraw collateral tokens from an obligation to a user’s wallet.Signature
Use the v2 variant which includes farming support. The v1 variant is deprecated.
Parameters
The amount of collateral tokens to withdraw.
Accounts
The owner of the obligation.
- Must be mutable (may receive rent if obligation is closed)
The obligation.
- Must be mutable
- Must have the specified owner
The lending market.
PDA authority for the lending market.
The reserve for the collateral being withdrawn.
- Must be mutable
The reserve’s collateral supply vault.
- Must be mutable
The user’s destination collateral token account.
- Must be mutable
- Must have owner as authority
The SPL Token program.
The Solana instructions sysvar.
Optional farming accounts (v2 only).
The Kamino Farms program (v2 only).
Returns
ReturnsOk(()) on success. The obligation account is automatically closed if it has no remaining deposits or borrows.
Errors
GlobalEmergencyMode: Emergency mode is enabledWithdrawTooLarge: Withdrawal would make obligation unhealthyObligationCollateralLtvZero: Obligation has collateral with LTV=0 that must be withdrawn firstWorseLtvBlocked: Withdrawal would worsen the obligation’s LTV
withdraw_obligation_collateral_and_redeem_reserve_collateral
Withdraw collateral from an obligation and immediately redeem it for underlying liquidity in a single transaction.Signature
Use the v2 variant which includes farming support. The v1 variant is deprecated.
Parameters
The amount of collateral tokens to withdraw and redeem.
Accounts
The owner of the obligation.
- Must be mutable
The obligation.
- Must be mutable
- Must have the specified owner
The lending market.
PDA authority for the lending market.
The reserve.
- Must be mutable
The reserve’s liquidity token mint.
The reserve’s collateral supply vault.
- Must be mutable
The reserve’s collateral token mint.
- Must be mutable
The reserve’s liquidity supply vault.
- Must be mutable
The user’s destination liquidity token account.
- Must be mutable
- Must have owner as authority
The SPL Token program.
The token program for liquidity.
The Solana instructions sysvar.
Optional farming accounts (v2 only).
The Kamino Farms program (v2 only).
Returns
ReturnsOk(()) on success. The obligation account is automatically closed if it has no remaining deposits or borrows.
Errors
GlobalEmergencyMode: Emergency mode is enabledWithdrawTooLarge: Withdrawal would make obligation unhealthyInsufficientLiquidity: Reserve doesn’t have enough liquidity for redemptionWorseLtvBlocked: Withdrawal would worsen the obligation’s LTV