init_lending_market
Initialize a new lending market. This creates the base lending market account that will contain all reserves.Signature
Parameters
The quote currency identifier (typically USD). Used for price normalization across reserves.
Accounts
The owner of the lending market. This account will have administrative privileges.
- Must be mutable (pays for initialization)
The lending market account to initialize.
- Must be a zero-initialized account
PDA authority for the lending market.
- Seeds:
["lending_market_auth", lending_market.key()]
The Solana system program.
The Solana rent sysvar.
Returns
ReturnsOk(()) on success.
Errors
- Standard Anchor errors if account validation fails
update_lending_market
Update configuration parameters of a lending market. Only the market owner or emergency council can call this.Signature
Parameters
The update mode specifying which field to update. Valid modes:
UpdateOwner: Update the ownerUpdateEmergencyMode: Enable/disable emergency mode (u8 bool)UpdateLiquidationCloseFactor: Set liquidation close factor (5-100)UpdateLiquidationMaxValue: Set max liquidatable debt valueUpdateGlobalAllowedBorrow: Set global borrow limitUpdateMinFullLiquidationThreshold: Set minimum full liquidation thresholdUpdateEmergencyCouncil: Set emergency council addressUpdateInsolvencyRiskLtv: Set insolvency risk LTV (5-100)UpdateElevationGroup: Configure elevation groupUpdateReferralFeeBps: Set referral fee in basis pointsUpdatePriceRefreshTriggerToMaxAgePct: Set price refresh trigger percentageUpdateAutodeleverageEnabled: Enable/disable auto-deleveragingUpdateBorrowingDisabled: Disable/enable borrowing globallyUpdateMinNetValueObligationPostAction: Set minimum net value threshold- And many more configuration options
The new value for the specified field, encoded as bytes.
Accounts
Must be either:
- The lending market owner (for all updates)
- The emergency council (only for enabling emergency mode)
The lending market to update.
- Must be mutable
Returns
ReturnsOk(()) on success.
Errors
InvalidSigner: Signer is not authorized to perform this updateOperationNotPermittedMarketImmutable: Market is marked as immutableInvalidConfig: Configuration value is invalid for the specified modeInvalidElevationGroupConfig: Elevation group configuration is invalid
update_lending_market_owner
Transfer ownership of a lending market to the cached owner. This is a two-step process: first cache the new owner withupdate_lending_market, then confirm with this instruction.
Signature
Parameters
None.Accounts
The cached new owner who is accepting ownership.
The lending market whose ownership is being transferred.
- Must be mutable
- Must have
lending_market_owner_cachedmatching the signer
Returns
ReturnsOk(()) on success.
Errors
OperationNotPermittedMarketImmutable: Market is marked as immutable- Anchor constraint errors if the cached owner doesn’t match