init_reserve
Initialize a new reserve for a specific token in a lending market.Signature
Parameters
None (all configuration done through accounts).Accounts
Must be authorized to initialize reserves (market owner or admin).
- Must be mutable (pays for initialization)
The lending market this reserve belongs to.
PDA authority for the lending market.
- Seeds:
["lending_market_auth", lending_market.key()]
The reserve account to initialize.
- Must be a zero-initialized account
The SPL token mint for the reserve’s liquidity.
PDA token account that will hold the reserve’s liquidity.
- Seeds:
["reserve_liq_supply", reserve.key()] - Initialized by this instruction
PDA token account that will hold protocol fees.
- Seeds:
["fee_receiver", reserve.key()] - Initialized by this instruction
The collateral token mint (cToken) for this reserve.
- Seeds:
["reserve_coll_mint", reserve.key()] - Initialized by this instruction with 6 decimals
The vault holding collateral tokens.
- Seeds:
["reserve_coll_supply", reserve.key()] - Initialized by this instruction
Source account for the initial deposit.
- Must contain at least the minimum initial deposit amount
Returns
ReturnsOk(()) on success.
Errors
InvalidSigner: Signer is not authorized to initialize reservesUnsupportedTokenExtension: Token has unsupported Token-2022 extensions
init_farms_for_reserve
Initialize farming rewards for a reserve (collateral or debt farming).Signature
Parameters
The farm type:
0: Collateral farming1: Debt farming
Accounts
The owner of the lending market.
- Must be mutable
The lending market.
- Must have
lending_market_ownermatching signer
PDA authority for the lending market.
The reserve to add farming to.
- Must be mutable
The Kamino Farms program.
The farm state account (initialized via CPI).
- Must be mutable
Returns
ReturnsOk(()) on success.
update_reserve_config
Update configuration parameters for a reserve.Signature
Parameters
The configuration field to update (e.g., fees, LTV, liquidation threshold, borrow limits, etc.).
The new value encoded as bytes.
If true, skip validation checks. Only allowed if reserve is unused and blocked.
Accounts
Must be authorized to update reserve config (market owner, proposer, or global admin depending on mode).
The global configuration account.
The lending market.
The reserve to update.
- Must be mutable
- Must belong to the lending market
Returns
ReturnsOk(()) on success.
Errors
InvalidSigner: Signer is not authorizedOperationNotPermittedMarketImmutable: Market is immutable and update not allowed by global adminReserveHasNotReceivedInitialDeposit: Cannot update config before initial depositInvalidConfig: Configuration value is invalid
refresh_reserve
Refresh a reserve’s state including interest rates and prices.Signature
Parameters
None.Accounts
The reserve to refresh.
- Must be mutable
The lending market.
Pyth price oracle account (if configured).
Switchboard price feed (if configured).
Switchboard TWAP feed (if configured).
Scope price feed (if configured).
Returns
ReturnsOk(()) on success.
Errors
GlobalEmergencyMode: Emergency mode is enabled (via access control)ReserveDeprecated: Reserve version is outdated- Price-related errors if oracles are misconfigured
refresh_reserves_batch
Refresh multiple reserves in a single transaction.Signature
Parameters
If true, skip fetching new prices from oracles. Only refresh interest rates.
Remaining Accounts
For each reserve to refresh, provide accounts in this order:- Reserve account (mutable)
- Lending market account
- If
skip_price_updatesis false, provide oracle accounts:- Pyth oracle (or program ID as placeholder)
- Switchboard price oracle (or program ID as placeholder)
- Switchboard TWAP oracle (or program ID as placeholder)
- Scope prices (or program ID as placeholder)
Returns
ReturnsOk(()) on success.
Errors
InvalidAccountInput: Missing or invalid accountsGlobalEmergencyMode: Emergency mode is enabledReserveDeprecated: One of the reserves is deprecated
redeem_fees
Redeem accumulated protocol fees from a reserve, converting them from the supply vault to the fee receiver vault.Signature
Parameters
None.Accounts
The reserve to redeem fees from.
- Must be mutable
The liquidity token mint.
The fee receiver token account.
- Must be mutable
The reserve’s liquidity supply vault.
- Must be mutable
The lending market.
PDA authority for signing the transfer.
Returns
ReturnsOk(()) on success.
withdraw_protocol_fee
Withdraw protocol fees from the fee receiver to the global fee collector.Signature
Parameters
The amount of fees to withdraw. Actual withdrawal is capped at available balance.
Accounts
The global configuration account.
The lending market.
The reserve.
The fee receiver vault.
- Must be mutable
The global fee collector’s associated token account.
- Must be mutable
Returns
ReturnsOk(()) on success.
socialize_loss (deprecated)
This instruction is deprecated. Use
socialize_loss_v2 instead.Signature
socialize_loss_v2
Socialize bad debt from an unhealthy obligation across all cToken holders. Only callable by market owner.Signature
Parameters
The amount of bad debt to socialize.
Accounts
The owner of the lending market.
The obligation with bad debt.
- Must be mutable
The lending market.
The reserve to socialize loss in.
- Must be mutable
Optional farming accounts if debt farming is enabled.
PDA authority.
Remaining Accounts
All deposit reserves for the obligation (to verify no collateral remains).Returns
ReturnsOk(()) on success.
Errors
CannotSocializeObligationWithCollateral: Obligation still has collateralObligationEmpty: Obligation has no borrows or deposits