Kamino Lending decoder

Decode Kamino Lending instructions, accounts and events in Rust with the carbon-kamino-lending-decoder crate.

On this page

carbon-kamino-lending-decoder decodes the instructions, accounts and events of the Kamino Lending program (KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD): 63 instructions, 10 account types, 5 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-kamino-lending-decoder 2.0.0
Installcargo add carbon-kamino-lending-decoder@2.0.0
Program IDKLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD (carbon_kamino_lending_decoder::PROGRAM_ID)
CategoryLending
Decodercarbon_kamino_lending_decoder::KaminoLendingDecoder
Instruction enuminstructions::KaminoLendingInstruction
Account enumaccounts::KaminoLendingAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-kamino-lending-decoder/2.0.0
Sourcedecoders/kamino-lending-decoder

Other lending decoders: Jupiter Lend, Kamino Vault, marginfi v2, Meteora Vault, Sharky. To decode several in one pipeline, see lending decoders.

The serde feature derives Serialize/Deserialize on every type, postgres adds tables and processors for Postgres, and graphql adds a schema for the GraphQL server.

Usage#

This program crawls recent Kamino Lending transactions from the public RPC and prints every decoded RefreshReserve instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-kamino-lending-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
src/main.rs
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_kamino_lending_decoder::{
        instructions::KaminoLendingInstruction, KaminoLendingDecoder, PROGRAM_ID,
    },
    carbon_rpc_transaction_crawler_datasource::{ConnectionConfig, Filters, RpcTransactionCrawler},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Fetches the program's recent transactions over JSON-RPC, newest first.
    let datasource = RpcTransactionCrawler::new(
        "https://api.mainnet-beta.solana.com".to_string(),
        PROGRAM_ID,
        ConnectionConfig::default(),
        Filters::new(None, None, None),
        None,
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .instruction(KaminoLendingDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, KaminoLendingInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, KaminoLendingInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let KaminoLendingInstruction::RefreshReserve { data, accounts, .. } = input.decoded_instruction {
            println!("refresh_reserve {signature}: {data:?} reserve={}", accounts.reserve);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each RefreshReserve instruction prints one line with the transaction signature and the decoded RefreshReserve data. The public endpoint rate-limits requests, so the first lines can take a while; use your own RPC URL for anything beyond a test. See stream with RPC for the crawler options.

Events published with Anchor's emit_cpi! arrive as the CpiEvent instruction. Match them with KaminoLendingInstruction::CpiEvent { data: CpiEvent::BorrowOrderCancelEvent(event), .. } (import instructions::CpiEvent); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_log_events.

Decode accounts#

The transaction crawler emits transactions only. To decode accounts, use a datasource that emits account updates. This program subscribes to the program's accounts with programSubscribe on the public WebSocket endpoint and prints every decoded Reserve account as it changes. Add the datasource and the Solana RPC types it takes:

Terminal
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
src/main.rs
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_kamino_lending_decoder::{
        accounts::KaminoLendingAccount, KaminoLendingDecoder, PROGRAM_ID,
    },
    carbon_rpc_program_subscribe_datasource::{Filters, RpcProgramSubscribe},
    solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig, UiAccountEncoding},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Streams every change to an account owned by the program (programSubscribe).
    let config = RpcProgramAccountsConfig {
        account_config: RpcAccountInfoConfig {
            encoding: Some(UiAccountEncoding::Base64),
            ..Default::default()
        },
        ..Default::default()
    };
    let datasource = RpcProgramSubscribe::new(
        "wss://api.mainnet-beta.solana.com".to_string(),
        Filters::new(PROGRAM_ID, Some(config)),
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .account(KaminoLendingDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

impl Processor<AccountProcessorInputType<'_, KaminoLendingAccount>> for AccountLogger {
    async fn process(
        &mut self,
        input: &AccountProcessorInputType<'_, KaminoLendingAccount>,
    ) -> CarbonResult<()> {
        if let KaminoLendingAccount::Reserve(reserve) = &input.decoded_account.data {
            println!("reserve {}: {reserve:?}", input.metadata.pubkey);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each update to a Reserve account prints its address and decoded fields; the program runs until you stop it. Cargo resolves solana-client to 4.2.2, the exact version the datasource pins, so both use the same RpcProgramAccountsConfig type. To load every existing account once instead of streaming changes, see load account state.

Instructions#

Variants of KaminoLendingInstruction. Each is KaminoLendingInstruction::<Variant> { program_id, data, accounts }, where data and accounts are the types listed under the variant, exported from carbon_kamino_lending_decoder::instructions. Discriminators are the leading bytes of the instruction data, in hex.

How an instruction decodes. The decoder returns a variant only when all of these hold; otherwise the instruction is skipped and no processor is called:

  1. The instruction's program ID is KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD.
  2. The data starts with the variant's discriminator, and the rest deserializes into its data type.
  3. The instruction has at least as many accounts as the variant requires (the "Required accounts" count under each variant).

Accounts. They are matched by position, in the order listed. An account marked optional is None only when the instruction ends before it; Anchor programs pass the program ID as a placeholder for an omitted optional account, so check for Some(PROGRAM_ID) too. Accounts after the listed ones are in accounts.remaining as AccountMetas. The decoder doesn't record whether an account signed or was writable: read that from input.raw_instruction.accounts[i].is_signer and .is_writable, which follow the same order. It doesn't check signer, writable, owner or PDA constraints either; the program enforced those when the transaction executed, so a decoded instruction from a successful transaction already satisfied them.

AbortObligationOwnershipTransfer#

Discriminator 67d95341a405c3e3 · data AbortObligationOwnershipTransfer · accounts AbortObligationOwnershipTransferInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of AbortObligationOwnershipTransferInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2instruction_sysvar_accountPubkey
3…remainingVec<AccountMeta>

AcceptObligationOwnership#

Discriminator f98246b097bbef06 · data AcceptObligationOwnership · accounts AcceptObligationOwnershipInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of AcceptObligationOwnershipInstructionAccounts, in account order:

#FieldType
0pending_ownerPubkey
1obligationPubkey
2instruction_sysvar_accountPubkey
3…remainingVec<AccountMeta>

ApproveObligationOwnershipTransfer#

Discriminator 3de3e72ec47c3ca1 · data ApproveObligationOwnershipTransfer · accounts ApproveObligationOwnershipTransferInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of ApproveObligationOwnershipTransferInstructionAccounts, in account order:

#FieldType
0global_adminPubkey
1global_configPubkey
2obligationPubkey
3pending_ownerPubkey
4…remainingVec<AccountMeta>

BorrowObligationLiquidity#

Discriminator 797f12cc49f5e141 · data BorrowObligationLiquidity · accounts BorrowObligationLiquidityInstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 12; extras go to remaining.

Fields of BorrowObligationLiquidityInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4borrow_reservePubkey
5borrow_reserve_liquidity_mintPubkey
6reserve_source_liquidityPubkey
7borrow_reserve_liquidity_fee_receiverPubkey
8user_destination_liquidityPubkey
9referrer_token_stateOption<Pubkey>
10token_programPubkey
11instruction_sysvar_accountPubkey
12…remainingVec<AccountMeta>

BorrowObligationLiquidityV2#

Discriminator a1808ff5abc7c206 · data BorrowObligationLiquidityV2 · accounts BorrowObligationLiquidityV2InstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 15; extras go to remaining.

Fields of BorrowObligationLiquidityV2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4borrow_reservePubkey
5borrow_reserve_liquidity_mintPubkey
6reserve_source_liquidityPubkey
7borrow_reserve_liquidity_fee_receiverPubkey
8user_destination_liquidityPubkey
9referrer_token_stateOption<Pubkey>
10token_programPubkey
11instruction_sysvar_accountPubkey
12obligation_farm_user_stateOption<Pubkey>
13reserve_farm_stateOption<Pubkey>
14farms_programPubkey
15…remainingVec<AccountMeta>

CancelWithdrawTicket#

Discriminator b4537a2c78d32f16 · data CancelWithdrawTicket · accounts CancelWithdrawTicketInstructionAccounts.

FieldType
ticket_sequence_numberu64
collateral_amount_to_cancelu64

Required accounts: 9; extras go to remaining.

Fields of CancelWithdrawTicketInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1lending_marketPubkey
2lending_market_authorityPubkey
3reservePubkey
4reserve_collateral_mintPubkey
5owner_queued_collateral_vaultPubkey
6user_destination_collateralPubkey
7collateral_token_programPubkey
8withdraw_ticketPubkey
9…remainingVec<AccountMeta>

CloneReserveConfig#

Discriminator f405c671110a4721 · data CloneReserveConfig · accounts CloneReserveConfigInstructionAccounts.

FieldType
customizationsReserveConfigCustomizationArgs

Required accounts: 4; extras go to remaining.

Fields of CloneReserveConfigInstructionAccounts, in account order:

#FieldType
0signerPubkey
1target_lending_marketPubkey
2source_reservePubkey
3target_reservePubkey
4…remainingVec<AccountMeta>

DeleteReferrerStateAndShortUrl#

Discriminator 99b9631ce4b3bb96 · data DeleteReferrerStateAndShortUrl · accounts DeleteReferrerStateAndShortUrlInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of DeleteReferrerStateAndShortUrlInstructionAccounts, in account order:

#FieldType
0referrerPubkey
1referrer_statePubkey
2short_urlPubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

DepositAndWithdraw#

Discriminator 8d99270f403d5854 · data DepositAndWithdraw · accounts DepositAndWithdrawInstructionAccounts.

FieldType
liquidity_amountu64
withdraw_collateral_amountu64

Required accounts: 20; extras go to remaining.

Fields of DepositAndWithdrawInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4reservePubkey
5reserve_liquidity_mintPubkey
6reserve_liquidity_supplyPubkey
7reserve_collateral_mintPubkey
8reserve_destination_deposit_collateralPubkey
9user_source_liquidityPubkey
10placeholder_user_destination_collateralOption<Pubkey>
11collateral_token_programPubkey
12liquidity_token_programPubkey
13instruction_sysvar_accountPubkey
14withdraw_reservePubkey
15reserve_source_collateralPubkey
16user_destination_liquidityPubkey
17obligation_farm_user_stateOption<Pubkey>
18reserve_farm_stateOption<Pubkey>
19farms_programPubkey
20…remainingVec<AccountMeta>

DepositObligationCollateral#

Discriminator 6cd1044815167685 · data DepositObligationCollateral · accounts DepositObligationCollateralInstructionAccounts.

FieldType
collateral_amountu64

Required accounts: 8; extras go to remaining.

Fields of DepositObligationCollateralInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3deposit_reservePubkey
4reserve_destination_collateralPubkey
5user_source_collateralPubkey
6token_programPubkey
7instruction_sysvar_accountPubkey
8…remainingVec<AccountMeta>

DepositObligationCollateralV2#

Discriminator 8991975ea7710491 · data DepositObligationCollateralV2 · accounts DepositObligationCollateralV2InstructionAccounts.

FieldType
collateral_amountu64

Required accounts: 12; extras go to remaining.

Fields of DepositObligationCollateralV2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3deposit_reservePubkey
4reserve_destination_collateralPubkey
5user_source_collateralPubkey
6token_programPubkey
7instruction_sysvar_accountPubkey
8lending_market_authorityPubkey
9obligation_farm_user_stateOption<Pubkey>
10reserve_farm_stateOption<Pubkey>
11farms_programPubkey
12…remainingVec<AccountMeta>

DepositReserveLiquidity#

Discriminator a9c91e7e06cd6644 · data DepositReserveLiquidity · accounts DepositReserveLiquidityInstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 12; extras go to remaining.

Fields of DepositReserveLiquidityInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1reservePubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4reserve_liquidity_mintPubkey
5reserve_liquidity_supplyPubkey
6reserve_collateral_mintPubkey
7user_source_liquidityPubkey
8user_destination_collateralPubkey
9collateral_token_programPubkey
10liquidity_token_programPubkey
11instruction_sysvar_accountPubkey
12…remainingVec<AccountMeta>

DepositReserveLiquidityAndObligationCollateral#

Discriminator 81c70402de271a2e · data DepositReserveLiquidityAndObligationCollateral · accounts DepositReserveLiquidityAndObligationCollateralInstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 14; extras go to remaining.

Fields of DepositReserveLiquidityAndObligationCollateralInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4reservePubkey
5reserve_liquidity_mintPubkey
6reserve_liquidity_supplyPubkey
7reserve_collateral_mintPubkey
8reserve_destination_deposit_collateralPubkey
9user_source_liquidityPubkey
10placeholder_user_destination_collateralOption<Pubkey>
11collateral_token_programPubkey
12liquidity_token_programPubkey
13instruction_sysvar_accountPubkey
14…remainingVec<AccountMeta>

DepositReserveLiquidityAndObligationCollateralV2#

Discriminator d8e0bf1bcc9766af · data DepositReserveLiquidityAndObligationCollateralV2 · accounts DepositReserveLiquidityAndObligationCollateralV2InstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 17; extras go to remaining.

Fields of DepositReserveLiquidityAndObligationCollateralV2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4reservePubkey
5reserve_liquidity_mintPubkey
6reserve_liquidity_supplyPubkey
7reserve_collateral_mintPubkey
8reserve_destination_deposit_collateralPubkey
9user_source_liquidityPubkey
10placeholder_user_destination_collateralOption<Pubkey>
11collateral_token_programPubkey
12liquidity_token_programPubkey
13instruction_sysvar_accountPubkey
14obligation_farm_user_stateOption<Pubkey>
15reserve_farm_stateOption<Pubkey>
16farms_programPubkey
17…remainingVec<AccountMeta>

EnqueueToWithdraw#

Discriminator 8671a0cf5a4bd5db · data EnqueueToWithdraw · accounts EnqueueToWithdrawInstructionAccounts.

FieldType
collateral_amountu64
progress_callback_typeProgressCallbackType

Required accounts: 15; extras go to remaining.

Fields of EnqueueToWithdrawInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1lending_marketPubkey
2lending_market_authorityPubkey
3reservePubkey
4user_source_collateral_taPubkey
5user_destination_liquidity_taPubkey
6reserve_liquidity_mintPubkey
7reserve_collateral_mintPubkey
8collateral_token_programPubkey
9withdraw_ticketPubkey
10owner_queued_collateral_vaultPubkey
11system_programPubkey
12progress_callback_custom_account0Option<Pubkey>
13progress_callback_custom_account1Option<Pubkey>
14instruction_sysvar_accountPubkey
15…remainingVec<AccountMeta>

FillBorrowOrder#

Discriminator 6604a74c83aa5d13 · data FillBorrowOrder · accounts FillBorrowOrderInstructionAccounts.

No data fields.

Required accounts: 17; extras go to remaining.

Fields of FillBorrowOrderInstructionAccounts, in account order:

#FieldType
0payerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4borrow_reservePubkey
5borrow_reserve_liquidity_mintPubkey
6reserve_source_liquidityPubkey
7borrow_reserve_liquidity_fee_receiverPubkey
8user_destination_liquidityPubkey
9referrer_token_stateOption<Pubkey>
10token_programPubkey
11instruction_sysvar_accountPubkey
12obligation_farm_user_stateOption<Pubkey>
13reserve_farm_stateOption<Pubkey>
14farms_programPubkey
15event_authorityPubkey
16programPubkey
17…remainingVec<AccountMeta>

FlashBorrowReserveLiquidity#

Discriminator 87e734a70734d4c1 · data FlashBorrowReserveLiquidity · accounts FlashBorrowReserveLiquidityInstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 12; extras go to remaining.

Fields of FlashBorrowReserveLiquidityInstructionAccounts, in account order:

#FieldType
0user_transfer_authorityPubkey
1lending_market_authorityPubkey
2lending_marketPubkey
3reservePubkey
4reserve_liquidity_mintPubkey
5reserve_source_liquidityPubkey
6user_destination_liquidityPubkey
7reserve_liquidity_fee_receiverPubkey
8referrer_token_stateOption<Pubkey>
9referrer_accountOption<Pubkey>
10sysvar_infoPubkey
11token_programPubkey
12…remainingVec<AccountMeta>

FlashRepayReserveLiquidity#

Discriminator b97500cb60f5b4ba · data FlashRepayReserveLiquidity · accounts FlashRepayReserveLiquidityInstructionAccounts.

FieldType
liquidity_amountu64
borrow_instruction_indexu8

Required accounts: 12; extras go to remaining.

Fields of FlashRepayReserveLiquidityInstructionAccounts, in account order:

#FieldType
0user_transfer_authorityPubkey
1lending_market_authorityPubkey
2lending_marketPubkey
3reservePubkey
4reserve_liquidity_mintPubkey
5reserve_destination_liquidityPubkey
6user_source_liquidityPubkey
7reserve_liquidity_fee_receiverPubkey
8referrer_token_stateOption<Pubkey>
9referrer_accountOption<Pubkey>
10sysvar_infoPubkey
11token_programPubkey
12…remainingVec<AccountMeta>

IdlMissingTypes#

Discriminator 8250269950d4b6fd · data IdlMissingTypes · accounts IdlMissingTypesInstructionAccounts.

FieldType
reserve_farm_kindReserveFarmKind
fee_calculationFeeCalculation
reserve_statusReserveStatus
update_config_modeUpdateConfigMode
update_lending_market_config_valueUpdateLendingMarketConfigValue
update_lending_market_config_modeUpdateLendingMarketMode

Required accounts: 4; extras go to remaining.

Fields of IdlMissingTypesInstructionAccounts, in account order:

#FieldType
0signerPubkey
1global_configPubkey
2lending_marketPubkey
3reservePubkey
4…remainingVec<AccountMeta>

InitFarmsForReserve#

Discriminator da063ee90121e852 · data InitFarmsForReserve · accounts InitFarmsForReserveInstructionAccounts.

FieldType
modeu8

Required accounts: 10; extras go to remaining.

Fields of InitFarmsForReserveInstructionAccounts, in account order:

#FieldType
0lending_market_ownerPubkey
1lending_marketPubkey
2lending_market_authorityPubkey
3reservePubkey
4farms_programPubkey
5farms_global_configPubkey
6farm_statePubkey
7farms_vault_authorityPubkey
8rentPubkey
9system_programPubkey
10…remainingVec<AccountMeta>

InitGlobalConfig#

Discriminator 8c88d630570078ff · data InitGlobalConfig · accounts InitGlobalConfigInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of InitGlobalConfigInstructionAccounts, in account order:

#FieldType
0payerPubkey
1global_configPubkey
2program_dataPubkey
3system_programPubkey
4rentPubkey
5…remainingVec<AccountMeta>

InitiateObligationOwnershipTransfer#

Discriminator 7f2a51da93ab4c99 · data InitiateObligationOwnershipTransfer · accounts InitiateObligationOwnershipTransferInstructionAccounts.

FieldType
new_ownerPubkey

Required accounts: 3; extras go to remaining.

Fields of InitiateObligationOwnershipTransferInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2instruction_sysvar_accountPubkey
3…remainingVec<AccountMeta>

InitLendingMarket#

Discriminator 22a2740e65895eef · data InitLendingMarket · accounts InitLendingMarketInstructionAccounts.

FieldType
quote_currency[u8; 32]

Required accounts: 5; extras go to remaining.

Fields of InitLendingMarketInstructionAccounts, in account order:

#FieldType
0lending_market_ownerPubkey
1lending_marketPubkey
2lending_market_authorityPubkey
3system_programPubkey
4rentPubkey
5…remainingVec<AccountMeta>

InitObligation#

Discriminator fb0ae74c1b0b9f60 · data InitObligation · accounts InitObligationInstructionAccounts.

FieldType
argsInitObligationArgs

Required accounts: 9; extras go to remaining.

Fields of InitObligationInstructionAccounts, in account order:

#FieldType
0obligation_ownerPubkey
1fee_payerPubkey
2obligationPubkey
3lending_marketPubkey
4seed1_accountPubkey
5seed2_accountPubkey
6owner_user_metadataPubkey
7rentPubkey
8system_programPubkey
9…remainingVec<AccountMeta>

InitObligationFarmsForReserve#

Discriminator 883f0fbad398a8a4 · data InitObligationFarmsForReserve · accounts InitObligationFarmsForReserveInstructionAccounts.

FieldType
modeu8

Required accounts: 11; extras go to remaining.

Fields of InitObligationFarmsForReserveInstructionAccounts, in account order:

#FieldType
0payerPubkey
1ownerPubkey
2obligationPubkey
3lending_market_authorityPubkey
4reservePubkey
5reserve_farm_statePubkey
6obligation_farmPubkey
7lending_marketPubkey
8farms_programPubkey
9rentPubkey
10system_programPubkey
11…remainingVec<AccountMeta>

InitReferrerStateAndShortUrl#

Discriminator a513197f64371f5a · data InitReferrerStateAndShortUrl · accounts InitReferrerStateAndShortUrlInstructionAccounts.

FieldType
short_urlString

Required accounts: 6; extras go to remaining.

Fields of InitReferrerStateAndShortUrlInstructionAccounts, in account order:

#FieldType
0referrerPubkey
1referrer_statePubkey
2referrer_short_urlPubkey
3referrer_user_metadataPubkey
4rentPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

InitReferrerTokenState#

Discriminator 742d42943a0dda73 · data InitReferrerTokenState · accounts InitReferrerTokenStateInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of InitReferrerTokenStateInstructionAccounts, in account order:

#FieldType
0payerPubkey
1lending_marketPubkey
2reservePubkey
3referrerPubkey
4referrer_token_statePubkey
5rentPubkey
6system_programPubkey
7…remainingVec<AccountMeta>

InitReserve#

Discriminator 8af547e19904032b · data InitReserve · accounts InitReserveInstructionAccounts.

No data fields.

Required accounts: 14; extras go to remaining.

Fields of InitReserveInstructionAccounts, in account order:

#FieldType
0signerPubkey
1lending_marketPubkey
2lending_market_authorityPubkey
3reservePubkey
4reserve_liquidity_mintPubkey
5reserve_liquidity_supplyPubkey
6fee_receiverPubkey
7reserve_collateral_mintPubkey
8reserve_collateral_supplyPubkey
9initial_liquidity_sourcePubkey
10rentPubkey
11liquidity_token_programPubkey
12collateral_token_programPubkey
13system_programPubkey
14…remainingVec<AccountMeta>

InitUserMetadata#

Discriminator 75a9b045c5170fa2 · data InitUserMetadata · accounts InitUserMetadataInstructionAccounts.

FieldType
user_lookup_tablePubkey

Required accounts: 6; extras go to remaining.

Fields of InitUserMetadataInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1fee_payerPubkey
2user_metadataPubkey
3referrer_user_metadataOption<Pubkey>
4rentPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

LiquidateObligationAndRedeemReserveCollateral#

Discriminator b1479abce2854a37 · data LiquidateObligationAndRedeemReserveCollateral · accounts LiquidateObligationAndRedeemReserveCollateralInstructionAccounts.

FieldType
liquidity_amountu64
min_acceptable_received_liquidity_amountu64
max_allowed_ltv_override_percentu64

Required accounts: 20; extras go to remaining.

Fields of LiquidateObligationAndRedeemReserveCollateralInstructionAccounts, in account order:

#FieldType
0liquidatorPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4repay_reservePubkey
5repay_reserve_liquidity_mintPubkey
6repay_reserve_liquidity_supplyPubkey
7withdraw_reservePubkey
8withdraw_reserve_liquidity_mintPubkey
9withdraw_reserve_collateral_mintPubkey
10withdraw_reserve_collateral_supplyPubkey
11withdraw_reserve_liquidity_supplyPubkey
12withdraw_reserve_liquidity_fee_receiverPubkey
13user_source_liquidityPubkey
14user_destination_collateralPubkey
15user_destination_liquidityPubkey
16collateral_token_programPubkey
17repay_liquidity_token_programPubkey
18withdraw_liquidity_token_programPubkey
19instruction_sysvar_accountPubkey
20…remainingVec<AccountMeta>

LiquidateObligationAndRedeemReserveCollateralV2#

Discriminator a2a1238f1ebbb967 · data LiquidateObligationAndRedeemReserveCollateralV2 · accounts LiquidateObligationAndRedeemReserveCollateralV2InstructionAccounts.

FieldType
liquidity_amountu64
min_acceptable_received_liquidity_amountu64
max_allowed_ltv_override_percentu64

Required accounts: 23; extras go to remaining.

Fields of LiquidateObligationAndRedeemReserveCollateralV2InstructionAccounts, in account order:

#FieldType
0liquidatorPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4repay_reservePubkey
5repay_reserve_liquidity_mintPubkey
6repay_reserve_liquidity_supplyPubkey
7withdraw_reservePubkey
8withdraw_reserve_liquidity_mintPubkey
9withdraw_reserve_collateral_mintPubkey
10withdraw_reserve_collateral_supplyPubkey
11withdraw_reserve_liquidity_supplyPubkey
12withdraw_reserve_liquidity_fee_receiverPubkey
13user_source_liquidityPubkey
14user_destination_collateralPubkey
15user_destination_liquidityPubkey
16collateral_token_programPubkey
17repay_liquidity_token_programPubkey
18withdraw_liquidity_token_programPubkey
19instruction_sysvar_accountPubkey
20obligation_farm_user_stateOption<Pubkey>
21reserve_farm_stateOption<Pubkey>
22farms_programPubkey
23…remainingVec<AccountMeta>

MarkObligationForDeleveraging#

Discriminator a423b6130074f37f · data MarkObligationForDeleveraging · accounts MarkObligationForDeleveragingInstructionAccounts.

FieldType
autodeleverage_target_ltv_pctu8

Required accounts: 3; extras go to remaining.

Fields of MarkObligationForDeleveragingInstructionAccounts, in account order:

#FieldType
0lending_market_ownerPubkey
1obligationPubkey
2lending_marketPubkey
3…remainingVec<AccountMeta>

RecoverInvalidTicketCollateral#

Discriminator 1c30b0669fced2f6 · data RecoverInvalidTicketCollateral · accounts RecoverInvalidTicketCollateralInstructionAccounts.

FieldType
ticket_sequence_numberu64

Required accounts: 11; extras go to remaining.

Fields of RecoverInvalidTicketCollateralInstructionAccounts, in account order:

#FieldType
0payerPubkey
1lending_marketPubkey
2lending_market_authorityPubkey
3reservePubkey
4reserve_collateral_mintPubkey
5owner_queued_collateral_vaultPubkey
6user_source_collateralPubkey
7collateral_token_programPubkey
8withdraw_ticketPubkey
9withdraw_ticket_ownerPubkey
10instruction_sysvar_accountPubkey
11…remainingVec<AccountMeta>

RedeemFees#

Discriminator d727b429ad2ef8dc · data RedeemFees · accounts RedeemFeesInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of RedeemFeesInstructionAccounts, in account order:

#FieldType
0reservePubkey
1reserve_liquidity_mintPubkey
2reserve_liquidity_fee_receiverPubkey
3reserve_supply_liquidityPubkey
4lending_marketPubkey
5lending_market_authorityPubkey
6token_programPubkey
7…remainingVec<AccountMeta>

RedeemReserveCollateral#

Discriminator ea75b57db98edc1d · data RedeemReserveCollateral · accounts RedeemReserveCollateralInstructionAccounts.

FieldType
collateral_amountu64

Required accounts: 12; extras go to remaining.

Fields of RedeemReserveCollateralInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1lending_marketPubkey
2reservePubkey
3lending_market_authorityPubkey
4reserve_liquidity_mintPubkey
5reserve_collateral_mintPubkey
6reserve_liquidity_supplyPubkey
7user_source_collateralPubkey
8user_destination_liquidityPubkey
9collateral_token_programPubkey
10liquidity_token_programPubkey
11instruction_sysvar_accountPubkey
12…remainingVec<AccountMeta>

RefreshObligation#

Discriminator 218493e497c04859 · data RefreshObligation · accounts RefreshObligationInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of RefreshObligationInstructionAccounts, in account order:

#FieldType
0lending_marketPubkey
1obligationPubkey
2…remainingVec<AccountMeta>

RefreshObligationFarmsForReserve#

Discriminator 8c90fd150a4af803 · data RefreshObligationFarmsForReserve · accounts RefreshObligationFarmsForReserveInstructionAccounts.

FieldType
modeu8

Required accounts: 10; extras go to remaining.

Fields of RefreshObligationFarmsForReserveInstructionAccounts, in account order:

#FieldType
0crankPubkey
1obligationPubkey
2lending_market_authorityPubkey
3reservePubkey
4reserve_farm_statePubkey
5obligation_farm_user_statePubkey
6lending_marketPubkey
7farms_programPubkey
8rentPubkey
9system_programPubkey
10…remainingVec<AccountMeta>

RefreshReserve#

Discriminator 02da8aeb4fc91966 · data RefreshReserve · accounts RefreshReserveInstructionAccounts.

No data fields.

Required accounts: 2 (6 listed); extras go to remaining.

Fields of RefreshReserveInstructionAccounts, in account order:

#FieldType
0reservePubkey
1lending_marketPubkey
2pyth_oracleOption<Pubkey>
3switchboard_price_oracleOption<Pubkey>
4switchboard_twap_oracleOption<Pubkey>
5scope_pricesOption<Pubkey>
6…remainingVec<AccountMeta>

RefreshReservesBatch#

Discriminator 906e1a67a2ccfc93 · data RefreshReservesBatch · accounts RefreshReservesBatchInstructionAccounts.

FieldType
skip_price_updatesbool

No named accounts.

RepayAndWithdrawAndRedeem#

Discriminator 0236980394606dda · data RepayAndWithdrawAndRedeem · accounts RepayAndWithdrawAndRedeemInstructionAccounts.

FieldType
repay_amountu64
withdraw_collateral_amountu64

Required accounts: 21; extras go to remaining.

Fields of RepayAndWithdrawAndRedeemInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3repay_reservePubkey
4reserve_liquidity_mintPubkey
5reserve_destination_liquidityPubkey
6user_source_liquidityPubkey
7token_programPubkey
8instruction_sysvar_accountPubkey
9lending_market_authorityPubkey
10withdraw_reservePubkey
11reserve_source_collateralPubkey
12reserve_collateral_mintPubkey
13reserve_liquidity_supplyPubkey
14user_destination_liquidityPubkey
15placeholder_user_destination_collateralOption<Pubkey>
16collateral_token_programPubkey
17liquidity_token_programPubkey
18obligation_farm_user_stateOption<Pubkey>
19reserve_farm_stateOption<Pubkey>
20farms_programPubkey
21…remainingVec<AccountMeta>

RepayObligationLiquidity#

Discriminator 91b20de14cf09348 · data RepayObligationLiquidity · accounts RepayObligationLiquidityInstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 9; extras go to remaining.

Fields of RepayObligationLiquidityInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3repay_reservePubkey
4reserve_liquidity_mintPubkey
5reserve_destination_liquidityPubkey
6user_source_liquidityPubkey
7token_programPubkey
8instruction_sysvar_accountPubkey
9…remainingVec<AccountMeta>

RepayObligationLiquidityV2#

Discriminator 74aed54cb435d290 · data RepayObligationLiquidityV2 · accounts RepayObligationLiquidityV2InstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 13; extras go to remaining.

Fields of RepayObligationLiquidityV2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3repay_reservePubkey
4reserve_liquidity_mintPubkey
5reserve_destination_liquidityPubkey
6user_source_liquidityPubkey
7token_programPubkey
8instruction_sysvar_accountPubkey
9obligation_farm_user_stateOption<Pubkey>
10reserve_farm_stateOption<Pubkey>
11lending_market_authorityPubkey
12farms_programPubkey
13…remainingVec<AccountMeta>

RequestElevationGroup#

Discriminator 2477fb8122f00793 · data RequestElevationGroup · accounts RequestElevationGroupInstructionAccounts.

FieldType
elevation_groupu8

Required accounts: 3; extras go to remaining.

Fields of RequestElevationGroupInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3…remainingVec<AccountMeta>

RolloverFixedTermBorrow#

Discriminator 551e9be1e0ba8d94 · data RolloverFixedTermBorrow · accounts RolloverFixedTermBorrowInstructionAccounts.

No data fields.

Required accounts: 13; extras go to remaining.

Fields of RolloverFixedTermBorrowInstructionAccounts, in account order:

#FieldType
0payerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4source_borrow_reservePubkey
5target_borrow_reservePubkey
6liquidity_mintPubkey
7source_borrow_reserve_liquidityPubkey
8target_borrow_reserve_liquidityPubkey
9token_programPubkey
10obligation_farm_user_stateOption<Pubkey>
11reserve_farm_stateOption<Pubkey>
12farms_programPubkey
13…remainingVec<AccountMeta>

SeedDepositOnInitReserve#

Discriminator fec5e476b7ce3ee2 · data SeedDepositOnInitReserve · accounts SeedDepositOnInitReserveInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of SeedDepositOnInitReserveInstructionAccounts, in account order:

#FieldType
0signerPubkey
1lending_marketPubkey
2reservePubkey
3reserve_liquidity_mintPubkey
4reserve_liquidity_supplyPubkey
5initial_liquidity_sourcePubkey
6liquidity_token_programPubkey
7…remainingVec<AccountMeta>

SetBorrowOrder#

Discriminator b1ba2d3deb5b448b · data SetBorrowOrder · accounts SetBorrowOrderInstructionAccounts.

FieldType
order_configBorrowOrderConfigArgs
min_expected_current_remaining_debt_amountu64

Required accounts: 9; extras go to remaining.

Fields of SetBorrowOrderInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3reservePubkey
4filled_debt_destinationPubkey
5debt_liquidity_mintPubkey
6instruction_sysvar_accountPubkey
7event_authorityPubkey
8programPubkey
9…remainingVec<AccountMeta>

SetObligationOrder#

Discriminator 5101639cd3534e2e · data SetObligationOrder · accounts SetObligationOrderInstructionAccounts.

FieldType
indexu8
orderObligationOrder

Required accounts: 3; extras go to remaining.

Fields of SetObligationOrderInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3…remainingVec<AccountMeta>

SocializeLoss#

Discriminator f54b5b00ec611303 · data SocializeLoss · accounts SocializeLossInstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 5; extras go to remaining.

Fields of SocializeLossInstructionAccounts, in account order:

#FieldType
0lending_market_ownerPubkey
1obligationPubkey
2lending_marketPubkey
3reservePubkey
4instruction_sysvar_accountPubkey
5…remainingVec<AccountMeta>

SocializeLossV2#

Discriminator ee5f62dcbb28cc9a · data SocializeLossV2 · accounts SocializeLossV2InstructionAccounts.

FieldType
liquidity_amountu64

Required accounts: 9; extras go to remaining.

Fields of SocializeLossV2InstructionAccounts, in account order:

#FieldType
0lending_market_ownerPubkey
1obligationPubkey
2lending_marketPubkey
3reservePubkey
4instruction_sysvar_accountPubkey
5obligation_farm_user_stateOption<Pubkey>
6reserve_farm_stateOption<Pubkey>
7lending_market_authorityPubkey
8farms_programPubkey
9…remainingVec<AccountMeta>

TopupReserveRewards#

From the program's IDL:

Sponsor a reserve's rewards distribution by topping up its rewards_amount_available budget.

Discriminator 3fff82d36ed858ad · data TopupReserveRewards · accounts TopupReserveRewardsInstructionAccounts.

FieldType
amountu64

Required accounts: 7; extras go to remaining.

Fields of TopupReserveRewardsInstructionAccounts, in account order:

#FieldType
0signerPubkey
1lending_marketPubkey
2reservePubkey
3reserve_liquidity_mintPubkey
4reserve_liquidity_supplyPubkey
5source_liquidityPubkey
6liquidity_token_programPubkey
7…remainingVec<AccountMeta>

UpdateGlobalConfig#

Discriminator a45482bd6f3afac8 · data UpdateGlobalConfig · accounts UpdateGlobalConfigInstructionAccounts.

FieldType
modeUpdateGlobalConfigMode
valueVec<u8>

Required accounts: 2; extras go to remaining.

Fields of UpdateGlobalConfigInstructionAccounts, in account order:

#FieldType
0global_adminPubkey
1global_configPubkey
2…remainingVec<AccountMeta>

UpdateGlobalConfigAdmin#

Discriminator b85717c19ceeaf77 · data UpdateGlobalConfigAdmin · accounts UpdateGlobalConfigAdminInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of UpdateGlobalConfigAdminInstructionAccounts, in account order:

#FieldType
0pending_adminPubkey
1global_configPubkey
2…remainingVec<AccountMeta>

UpdateLendingMarket#

Discriminator d19d35d261b41f2d · data UpdateLendingMarket · accounts UpdateLendingMarketInstructionAccounts.

FieldType
modeu64
value[u8; 72]

Required accounts: 2; extras go to remaining.

Fields of UpdateLendingMarketInstructionAccounts, in account order:

#FieldType
0signerPubkey
1lending_marketPubkey
2…remainingVec<AccountMeta>

UpdateLendingMarketOwner#

Discriminator 76e00a3ec4e6b859 · data UpdateLendingMarketOwner · accounts UpdateLendingMarketOwnerInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of UpdateLendingMarketOwnerInstructionAccounts, in account order:

#FieldType
0lending_market_owner_cachedPubkey
1lending_marketPubkey
2…remainingVec<AccountMeta>

UpdateObligationConfig#

Discriminator 5298d545fa009dbc · data UpdateObligationConfig · accounts UpdateObligationConfigInstructionAccounts.

FieldType
modeUpdateObligationConfigMode
valueVec<u8>

Required accounts: 5; extras go to remaining.

Fields of UpdateObligationConfigInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2borrow_reserveOption<Pubkey>
3deposit_reserveOption<Pubkey>
4lending_marketPubkey
5…remainingVec<AccountMeta>

UpdateReserveConfig#

Discriminator 3d9464468f6b110d · data UpdateReserveConfig · accounts UpdateReserveConfigInstructionAccounts.

FieldType
modeUpdateConfigMode
valueVec<u8>
skip_config_integrity_validationbool

Required accounts: 4; extras go to remaining.

Fields of UpdateReserveConfigInstructionAccounts, in account order:

#FieldType
0signerPubkey
1global_configPubkey
2lending_marketPubkey
3reservePubkey
4…remainingVec<AccountMeta>

WithdrawObligationCollateral#

Discriminator 2574cd67f3c05cc6 · data WithdrawObligationCollateral · accounts WithdrawObligationCollateralInstructionAccounts.

FieldType
collateral_amountu64

Required accounts: 9; extras go to remaining.

Fields of WithdrawObligationCollateralInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4withdraw_reservePubkey
5reserve_source_collateralPubkey
6user_destination_collateralPubkey
7token_programPubkey
8instruction_sysvar_accountPubkey
9…remainingVec<AccountMeta>

WithdrawObligationCollateralAndRedeemReserveCollateral#

Discriminator 4b5d5ddc2296dac4 · data WithdrawObligationCollateralAndRedeemReserveCollateral · accounts WithdrawObligationCollateralAndRedeemReserveCollateralInstructionAccounts.

FieldType
collateral_amountu64

Required accounts: 14; extras go to remaining.

Fields of WithdrawObligationCollateralAndRedeemReserveCollateralInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4withdraw_reservePubkey
5reserve_liquidity_mintPubkey
6reserve_source_collateralPubkey
7reserve_collateral_mintPubkey
8reserve_liquidity_supplyPubkey
9user_destination_liquidityPubkey
10placeholder_user_destination_collateralOption<Pubkey>
11collateral_token_programPubkey
12liquidity_token_programPubkey
13instruction_sysvar_accountPubkey
14…remainingVec<AccountMeta>

WithdrawObligationCollateralAndRedeemReserveCollateralV2#

Discriminator eb34779895c51407 · data WithdrawObligationCollateralAndRedeemReserveCollateralV2 · accounts WithdrawObligationCollateralAndRedeemReserveCollateralV2InstructionAccounts.

FieldType
collateral_amountu64

Required accounts: 17; extras go to remaining.

Fields of WithdrawObligationCollateralAndRedeemReserveCollateralV2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4withdraw_reservePubkey
5reserve_liquidity_mintPubkey
6reserve_source_collateralPubkey
7reserve_collateral_mintPubkey
8reserve_liquidity_supplyPubkey
9user_destination_liquidityPubkey
10placeholder_user_destination_collateralOption<Pubkey>
11collateral_token_programPubkey
12liquidity_token_programPubkey
13instruction_sysvar_accountPubkey
14obligation_farm_user_stateOption<Pubkey>
15reserve_farm_stateOption<Pubkey>
16farms_programPubkey
17…remainingVec<AccountMeta>

WithdrawObligationCollateralV2#

Discriminator caf97572e7c02f8a · data WithdrawObligationCollateralV2 · accounts WithdrawObligationCollateralV2InstructionAccounts.

FieldType
collateral_amountu64

Required accounts: 12; extras go to remaining.

Fields of WithdrawObligationCollateralV2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1obligationPubkey
2lending_marketPubkey
3lending_market_authorityPubkey
4withdraw_reservePubkey
5reserve_source_collateralPubkey
6user_destination_collateralPubkey
7token_programPubkey
8instruction_sysvar_accountPubkey
9obligation_farm_user_stateOption<Pubkey>
10reserve_farm_stateOption<Pubkey>
11farms_programPubkey
12…remainingVec<AccountMeta>

WithdrawProtocolFee#

Discriminator 9ec99ebd215da267 · data WithdrawProtocolFee · accounts WithdrawProtocolFeeInstructionAccounts.

FieldType
amountu64

Required accounts: 8; extras go to remaining.

Fields of WithdrawProtocolFeeInstructionAccounts, in account order:

#FieldType
0global_configPubkey
1lending_marketPubkey
2reservePubkey
3reserve_liquidity_mintPubkey
4lending_market_authorityPubkey
5fee_vaultPubkey
6fee_collector_ataPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

WithdrawQueuedLiquidity#

Discriminator 4295bbc94abfae78 · data WithdrawQueuedLiquidity · accounts WithdrawQueuedLiquidityInstructionAccounts.

No data fields.

Required accounts: 19; extras go to remaining.

Fields of WithdrawQueuedLiquidityInstructionAccounts, in account order:

#FieldType
0payerPubkey
1lending_marketPubkey
2lending_market_authorityPubkey
3reservePubkey
4reserve_liquidity_mintPubkey
5reserve_collateral_mintPubkey
6reserve_liquidity_supplyPubkey
7owner_queued_collateral_vaultPubkey
8user_destination_liquidityPubkey
9collateral_token_programPubkey
10liquidity_token_programPubkey
11withdraw_ticketPubkey
12withdraw_ticket_ownerPubkey
13associated_token_programPubkey
14system_programPubkey
15progress_callback_programOption<Pubkey>
16progress_callback_custom_account0Option<Pubkey>
17progress_callback_custom_account1Option<Pubkey>
18instruction_sysvar_accountPubkey
19…remainingVec<AccountMeta>

WithdrawReferrerFees#

Discriminator ab7679c9e98c17e4 · data WithdrawReferrerFees · accounts WithdrawReferrerFeesInstructionAccounts.

No data fields.

Required accounts: 9; extras go to remaining.

Fields of WithdrawReferrerFeesInstructionAccounts, in account order:

#FieldType
0referrerPubkey
1referrer_token_statePubkey
2reservePubkey
3reserve_liquidity_mintPubkey
4reserve_supply_liquidityPubkey
5referrer_token_accountPubkey
6lending_marketPubkey
7lending_market_authorityPubkey
8token_programPubkey
9…remainingVec<AccountMeta>

CpiEvent#

Anchor self-CPI that carries one of the program's events. data is the CpiEvent enum.

Discriminator e445a52e51cb9a1d · data CpiEvent · accounts CpiEventInstructionAccounts.

Required accounts: 2; extras go to remaining.

Fields of CpiEventInstructionAccounts, in account order:

#FieldType
0programPubkey
1event_authorityPubkey
2…remainingVec<AccountMeta>

Accounts#

Variants of KaminoLendingAccount. Each wraps a boxed struct from carbon_kamino_lending_decoder::accounts::<module>. decode_account only considers accounts owned by PROGRAM_ID and returns the first variant that matches.

GlobalConfig#

Discriminator 95089ccaa0fcb0d9 · accounts::global_config::GlobalConfig.

FieldTypeDescription
global_adminPubkeyGlobal admin of the program
pending_adminPubkeyPending admin must sign a specific transaction to become the global admin
fee_collectorPubkeyFee collector is the only allowed owner of token accounts receiving protocol fees
padding[u8; 928]Padding to make the struct size 1024 bytes

LendingMarket#

Discriminator f6723262489d1c78 · accounts::lending_market::LendingMarket.

FieldTypeDescription
versionu64Version of lending market
bump_seedu64Bump seed for derived authority address
lending_market_ownerPubkeyOwner authority which can add new reserves
lending_market_owner_cachedPubkeyTemporary cache of the lending market owner, used in update_lending_market_owner
quote_currency[u8; 32]Currency market prices are quoted in e.g. "USD" null padded (*b"USD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0") or a SPL token mint pubkey
referral_fee_bpsu16Referral fee for the lending market, as bps out of the total protocol fee
emergency_modeu8
autodeleverage_enabledu8Whether the obligations on this market should be subject to auto-deleveraging after deposit or borrow limit is crossed. Besides this flag, the particular reserve's flag also needs to be enabled (logical AND). NOTE: this also affects the individual "target LTV" deleveraging.
borrow_disabledu8
price_refresh_trigger_to_max_age_pctu8Refresh price from oracle only if it's older than this percentage of the price max age. e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s. Price is always refreshed if this set to 0.
liquidation_max_debt_close_factor_pctu8Percentage of the total borrowed value in an obligation available for liquidation
insolvency_risk_unhealthy_ltv_pctu8Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100%
min_full_liquidation_value_thresholdu64Minimum liquidation value threshold triggering full liquidation for an obligation, in full units of the quote currency (e.g. 2 means "$2", not "2 lamports of USDC").
max_liquidatable_debt_market_value_at_onceu64Max allowed liquidation value in one ix call
reserved0[u8; 8][DEPRECATED] Global maximum unhealthy borrow value allowed for any obligation
global_allowed_borrow_valueu64Global maximum allowed borrow value allowed for any obligation
emergency_councilPubkeyThe address of the emergency council, in charge of taking emergency actions on the market (e.g., enabling emergency mode)
reserved1[u8; 8][DEPRECATED] Reward points multiplier per obligation type
elevation_groups[ElevationGroup; 32]Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold
elevation_group_padding[u64; 90]
min_net_value_in_obligation_sfu128Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals)
min_value_skip_liquidation_ltv_checksu64Minimum value to enforce smallest ltv priority checks on the collateral reserves on liquidation
name[u8; 32]Market name, zero-padded.
min_value_skip_liquidation_bf_checksu64Minimum value to enforce highest borrow factor priority checks on the debt reserves on liquidation
individual_autodeleverage_margin_call_period_secsu64Time (in seconds) that must pass before liquidation is allowed on an obligation that has been individually marked for auto-deleveraging.
min_initial_deposit_amountu64Minimum amount of deposit at creation of a reserve to prevent artificial inflation Note: this amount cannot be recovered, the ctoken associated are never minted
obligation_order_execution_enabledu8Whether the obligation orders should be evaluated during liquidations.
immutableu8Whether the lending market is set as immutable.
obligation_order_creation_enabledu8Whether new obligation orders can be created. Note: updating or cancelling existing orders is not affected by this flag.
price_triggered_liquidation_disabledu8Whether the liquidation operations that are triggered by price changes should be disabled. This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some obligation orders' execution. Caution: this flag is disabling the liquidations when 1 - contrary to all the other liquidation-driving flags (see e.g. [Self::autodeleverage_enabled]).
mature_reserve_debt_liquidation_enabledu8Whether the debts that reached their reserve's [ReserveConfig::debt_maturity_timestamp] can be liquidated.
obligation_borrow_debt_term_liquidation_enabledu8Whether the [Obligation::borrows] that reached their [ReserveConfig::debt_term_seconds] can be liquidated.
borrow_order_creation_enabledu8Whether new borrow orders can be created. Note: updating or cancelling existing orders is not affected by this flag.
borrow_order_execution_enabledu8Whether the existing borrow orders can be filled.
proposer_authorityPubkeyAuthority that can propose creating of new reserves but cannot enable them.
min_borrow_order_fill_valueu64Minimum value that can be filled in a single fill_borrow_order() call, in full units of the quote currency (e.g. 2 means "$2", not "2 lamports of USDC").
withdraw_ticket_issuance_enabledu8Whether any new withdraw tickets can be issued (i.e. whether new requests can enter the withdraw queue).
withdraw_ticket_redemption_enabledu8Whether the existing withdraw tickets can be redeemed (i.e. whether the tickets can be used to transfer accumulated pending liquidity to destination accounts).
obligation_borrow_rollover_configuration_enabledu8Whether the owners can enable the borrow rollover/migration on their obligations. Note 1: the actual execution of (different kinds of) rollovers are enabled/disabled by: - [Self::fixed_term_rollover_window_duration_seconds], - [Self::open_term_rollover_window_duration_seconds], - [Self::obligation_borrow_migration_to_fixed_execution_enabled]. Note 2: when this configuration is disabled, the obligation owners can still disable their rollover (i.e. set the obligation's flags to zeroes).
obligation_borrow_migration_to_fixed_execution_enabledu8Whether the actual execution of a "migration to fixed" rollover flavor is allowed. See [FixedTermBorrowRolloverConfig::migration_to_fixed_enabled].
withdraw_ticket_cancellation_enabledu8Whether the ticket owners can cancel their withdraw tickets (i.e. recover ctokens from the queued collateral vault back to their wallet).
padding2[u8; 1]
reserve_rewards_max_apr_bpsu16Maximum APR (in basis points; FULL_BPS = 10_000 = 100%) at which reserves on this market may distribute their rewards_amount_per_slot. 0 disables rewards on this market entirely (topup_reserve_rewards is rejected). Bounded by FULL_BPS (100% APR) when set. See [ReserveConfig::rewards_amount_per_slot] for the depositor-cap interaction.
min_withdraw_queued_liquidity_valueu64Minimum value that can be withdrawn in a single withdraw_queued_liquidity() call, in full units of the quote currency (e.g. 2 means "$2", not "2 lamports of USDC").
fixed_term_rollover_window_duration_secondsu64A configurable time window (right before the end of a fixed debt term) during which an auto-rollover into another fixed rate/term can happen. When zeroed, this rollover mode is effectively disabled. Can only be enabled when [Self::min_partial_rollover_value] is configured. See [FixedTermBorrowRolloverConfig].
open_term_rollover_window_duration_secondsu64A configurable time window (right before the end of a fixed debt term) during which an auto-rollover into a variable (indefinite) rate/term can happen. When zeroed, this rollover mode is effectively disabled. Can only be enabled when [Self::min_partial_rollover_value] is configured. This will typically be shorter than [Self::fixed_term_rollover_window_duration_seconds], acting as a fallback if a fixed reserve liquidity remains unavailable for considerable time.
min_partial_rollover_valueu64Minimum dollar value for a partial rollover into a different reserve. When the achievable rollover amount is below this threshold (and it's not a full rollover), the rollover is rejected. In full units of the quote currency (e.g. 2 means "$2").
term_based_full_liquidation_duration_secsu64The time that must pass before an entire expired debt becomes liquidatable. For example: Let's assume this duration is configured as 100 seconds; then: - right after fixed-term debt expiration, effectively no debt can be liquidated. - 30 seconds after expiration, we allow to 30% of the expired debt to be liquidated - to be specific: at this point in time, we "protect" from liquidation 70% of the [ObligationLiquidity::borrowed_amount_at_expiration] (regardless of how much interest was accrued or how much debt was repaid while expired). - 100 seconds after expiration we allow the entire debt to be liquidated. Only effective when [Self::obligation_borrow_debt_term_liquidation_enabled]. Motivation note: this throttling feature gives an opportunity to execute a configured auto-rollover (after a partial liquidation brings the debt size down so that there is enough available liquidity in some compatible reserve). When zeroed, an entire expired debt can be liquidated right after expiration (i.e. no throttling).
permissioning_authorityPubkeyIf not NULL, operations encoded in permissioned_ops require a signature from this authority
permissioned_opsu64Bitmap of operations that require permissioning authority signature
padding1[u64; 153]

Obligation#

From the program's IDL:

Lending market obligation state

Discriminator a8ce8d6a584caca7 · accounts::obligation::Obligation.

FieldTypeDescription
tagu64Version of the struct
last_updateLastUpdateLast update to collateral, liquidity, or their market values
lending_marketPubkeyLending market address
ownerPubkeyOwner authority which can borrow liquidity
deposits[ObligationCollateral; 8]Deposited collateral for the obligation, unique by deposit reserve address
lowest_reserve_deposit_liquidation_ltvu64Worst LTV for the collaterals backing the loan, represented as a percentage
deposited_value_sfu128Market value of deposits (scaled fraction)
borrows[ObligationLiquidity; 5]Borrowed liquidity for the obligation, unique by borrow reserve address
borrow_factor_adjusted_debt_value_sfu128Risk adjusted market value of borrows/debt (sum of price * borrowed_amount * borrow_factor) (scaled fraction)
borrowed_assets_market_value_sfu128Market value of borrows - used for max_liquidatable_borrowed_amount (scaled fraction)
allowed_borrow_value_sfu128The maximum borrow value at the weighted average loan to value ratio (scaled fraction)
unhealthy_borrow_value_sfu128The dangerous borrow value at the weighted average liquidation threshold (scaled fraction)
padding_deprecated_asset_tiers[u8; 13]The asset tier of the deposits
elevation_groupu8The elevation group id the obligation opted into.
num_of_obsolete_deposit_reservesu8The number of obsolete reserves the obligation has a deposit in
has_debtu8Marked = 1 if borrows array is not empty, 0 = borrows empty
referrerPubkeyWallet address of the referrer
borrowing_disabledu8Marked = 1 if borrowing disabled, 0 = borrowing enabled
autodeleverage_target_ltv_pctu8A target LTV set by the market owner when marking this obligation for deleveraging. Only effective when deleveraging_margin_call_started_slot != 0.
lowest_reserve_deposit_max_ltv_pctu8The lowest max LTV found amongst the collateral deposits
num_of_obsolete_borrow_reservesu8The number of obsolete reserves the obligation has a borrow in
ownership_transfer_stateu8State of ownership transfer, see [OwnershipTransferState]
reserved[u8; 3]
highest_borrow_factor_pctu64
autodeleverage_margin_call_started_timestampu64A timestamp at which the market owner most-recently marked this obligation for deleveraging. Zero if not currently subject to deleveraging.
obligation_orders[ObligationOrder; 2]Owner-defined, permissionlessly-executed repay orders. Typical use-cases would be a stop-loss and a take-profit (possibly co-existing).
borrow_orderBorrowOrderOwner-defined, permissionlessly-executed borrow order applicable to this obligation. Non-zeroed only on a newly-initialized fixed-rate, fixed-term obligation.
pending_ownerPubkeyPending owner during ownership transfer process. Pubkey::default() means no pending owner (similar to Option::None)
padding3[u64; 69]

ReferrerState#

Discriminator c251d9670c130c42 · accounts::referrer_state::ReferrerState.

FieldType
short_urlPubkey
ownerPubkey

ReferrerTokenState#

From the program's IDL:

Referrer account -> each owner can have multiple accounts for specific reserves

Discriminator 270fd04d20c36938 · accounts::referrer_token_state::ReferrerTokenState.

FieldTypeDescription
referrerPubkeyPubkey of the referrer/owner
mintPubkeyToken mint for the account
amount_unclaimed_sfu128Amount that has been accumulated and not claimed yet -> available to claim (scaled fraction)
amount_cumulative_sfu128Amount that has been accumulated in total -> both already claimed and unclaimed (scaled fraction)
bumpu64Referrer token state bump, used for address validation
padding[u64; 31]

Reserve#

Discriminator 2bf2ccca1af73b7f · accounts::reserve::Reserve.

FieldTypeDescription
versionu64Version of the reserve
last_updateLastUpdateLast slot when supply and rates updated
lending_marketPubkeyLending market address
farm_collateralPubkey
farm_debtPubkey
liquidityReserveLiquidityReserve liquidity
reserve_liquidity_padding[u64; 150]
collateralReserveCollateralReserve collateral
reserve_collateral_padding[u64; 150]
configReserveConfigReserve configuration values
config_padding[u64; 113]
borrowed_amount_outside_elevation_groupu64
borrowed_amounts_against_this_reserve_in_elevation_groups[u64; 32]Amount of token borrowed in lamport of debt asset in the given elevation group when this reserve is part of the collaterals.
withdraw_queueWithdrawQueueThe tracker of ticket-based withdrawals.
padding[u64; 204]

ShortUrl#

Discriminator 1c59ae19e27c7ed4 · accounts::short_url::ShortUrl.

FieldType
referrerPubkey
short_urlString

UserMetadata#

From the program's IDL:

Referrer account -> each owner can have multiple accounts for specific reserves

Discriminator 9dd6dceb6287ab1c · accounts::user_metadata::UserMetadata.

FieldTypeDescription
referrerPubkeyPubkey of the referrer/owner - pubkey::default if no referrer
bumpu64Bump used for validation of account address
user_lookup_tablePubkeyUser lookup table - used to store all user accounts - atas for each reserve mint, each obligation PDA, UserMetadata itself and all referrer_token_states if there is a referrer
ownerPubkeyUser metadata account owner
padding1[u64; 51]
padding2[u64; 64]

UserState#

Discriminator 48b155f94ca7ba7e · accounts::user_state::UserState.

FieldType
user_idu64
farm_statePubkey
ownerPubkey
is_farm_delegatedu8
padding0[u8; 7]
rewards_tally_scaled[u128; 10]
rewards_issued_unclaimed[u64; 10]
last_claim_ts[u64; 10]
active_stake_scaledu128
pending_deposit_stake_scaledu128
pending_deposit_stake_tsu64
pending_withdrawal_unstake_scaledu128
pending_withdrawal_unstake_tsu64
bumpu64
delegateePubkey
last_stake_tsu64
padding1[u64; 50]

WithdrawTicket#

From the program's IDL:

A finite-lifecycle account representing a specific depositor's place in the withdraw queue of a specific reserve.
The lifecycle:

  1. The depositor holding ctokens wants to withdraw funds from the reserve, and finds out that

the required amount is not available (due to high utilization). 2. The depositor calls the enqueue_to_withdraw handler. 3. The handler transfers the depositor's ctokens to the reserve's internal "pending" vault. 4. The handler initializes a new [WithdrawTicket] account, with the next available sequence

number. 5. The depositor waits until his ticket is the next expected one for actual withdraw, and until

the reserve has enough liquidity. 6. Anyone (the depositor or a bot) calls the permissionless withdraw_queued_liquidity

handler. If the ticket became invalid (e.g. destination account no longer exists), then the depositor can call the recover_invalid_ticket_collateral handler instead. 7. The handler transfers the liquidity amount according to the current exchange rate. 8. The handler closes the ticket account.

Discriminator ed17a43a35f8f05e · accounts::withdraw_ticket::WithdrawTicket.

FieldTypeDescription
sequence_numberu64This ticket's place in the queue; the same as used for PDA derivation.
ownerPubkeyThe funds' owner (the user who called the enqueue_to_withdraw handler).
reservePubkeyThe reserve to withdraw from.
user_destination_liquidity_taPubkeyThe token account to which the finally-available liquidity should be transferred (by the withdraw_queued_liquidity handler).
queued_collateral_amountu64The amount of collateral still waiting to be withdrawn using this ticket.
created_at_timestampu64The timestamp at which the queue was entered. This is currently only a piece of metadata, not used by the logic.
invalidu8Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity] has been repurposed) by the withdraw_queued_liquidity handler. To be specific: valid = 0, invalid = 1. An invalid ticket cannot be made valid again, and can only be passed to the recover_invalid_ticket_collateral handler.
progress_callback_typeu8One of the valid [ProgressCallbackType] representations.
alignment_padding[u8; 6]Inner padding, for alignment.
progress_callback_custom_accounts[Pubkey; 2]The (optional) accounts to be used by [Self::progress_callback_type]s.
end_padding[u64; 40]Trailing padding, for future developments.

Events#

Variants of instructions::CpiEvent, decoded from the CpiEvent instruction. Each wraps a struct from carbon_kamino_lending_decoder::events::<module>. The discriminator is the 8-byte event discriminator that follows the e445a52e51cb9a1d CPI-event tag.

BorrowOrderCancelEvent#

Discriminator 58e4e7e6eaf84590 · events::borrow_order_cancel_event::BorrowOrderCancelEventEvent.

FieldType
beforeBorrowOrder

BorrowOrderFullFillEvent#

Discriminator b1f1edfa8f140eb7 · events::borrow_order_full_fill_event::BorrowOrderFullFillEventEvent.

FieldType
beforeBorrowOrder

BorrowOrderPartialFillEvent#

Discriminator 7151fcc198186354 · events::borrow_order_partial_fill_event::BorrowOrderPartialFillEventEvent.

FieldType
beforeBorrowOrder
afterBorrowOrder

BorrowOrderPlaceEvent#

Discriminator 2bd3d0ba5ee3dac6 · events::borrow_order_place_event::BorrowOrderPlaceEventEvent.

FieldType
afterBorrowOrder

BorrowOrderUpdateEvent#

Discriminator 1521438330b85a40 · events::borrow_order_update_event::BorrowOrderUpdateEventEvent.

FieldType
beforeBorrowOrder
afterBorrowOrder

Types#

Types used by the instructions, accounts and events above, exported from carbon_kamino_lending_decoder::types.

BigFractionBytes#

Struct types::BigFractionBytes.

FieldType
value[u64; 4]
padding[u64; 2]

BorrowOrder#

From the program's IDL:

A borrow order.
When the [Obligation::borrow_order] is populated (i.e. non-zeroed) on an
Obligation, then the permissionless "fill" operations may borrow liquidity to the owner according to this specification.

Struct types::BorrowOrder.

FieldTypeDescription
debt_liquidity_mintPubkeyThe asset to be borrowed. The reserves used for [Obligation::borrows] must all provide exactly this asset.
remaining_debt_amountu64The amount of debt that still needs to be filled, in lamports.
filled_debt_destinationPubkeyThe token account owned by the [Obligation::owner] and holding [Self::debt_liquidity_mint], where the filled funds should be transferred to.
min_debt_term_secondsu64The minimum allowed debt term that the obligation owner agrees to. The reserves used to fill this order cannot define their debt term lower than this. If zeroed, then only open-term reserves may be used.
fillable_until_timestampu64The time until which the borrow order can still be filled.
placed_at_timestampu64The time at which this order was placed. Currently, this is only a piece of metadata.
last_updated_at_timestampu64The time at which this order was most-recently updated (including: created). Currently, this is only a piece of metadata.
requested_debt_amountu64The amount of debt that was originally requested when this order was most-recently updated. In other words: this field holds a value of [Self::remaining_debt_amount] captured at [Self::last_updated_at_timestamp]. Currently, this is only a piece of metadata.
max_borrow_rate_bpsu32The maximum borrow rate that the obligation owner agrees to. The reserves used for [Obligation::borrows] cannot define their maximum borrow rate higher than this.
activeu8Whether the [Self::remaining_debt_amount] is non-zero. This field is not used by smart contract logic (which prefers to treat the above [Self::remaining_debt_amount]-based definition as the single source of truth). However, it is useful for off-chain bots (order-searchers) to efficiently list (i.e. memcmp filter) just the obligations that have active borrow orders.
enable_auto_rollover_on_filled_borrowsu8When 1, all [Obligation::borrows] that get filled by this order will have their [FixedTermBorrowRolloverConfig::auto_rollover_enabled] flag set. Additionally, their rollover customizations: - will exactly match this order's constraints regarding [Self::min_debt_term_seconds] and [Self::max_borrow_rate_bps]; - will use the [FixedTermBorrowRolloverConfig::open_term_allowed] fallback. See [BorrowOrder::get_rollover_config_for_filled_borrow()]. Clarification note: when 0, this setting has no effect on any borrow (i.e. if an existing borrow was independently marked for auto-rollover, it will not be unmarked when filled by this order). Feature flag note: when [LendingMarket::obligation_borrow_rollover_configuration_enabled] is disabled, this setting has no effect on any borrow (i.e. the fill will be successful, but the borrow will not be marked for auto-rollover.
padding1[u8; 2]Alignment padding.
end_padding[u64; 5]End padding.

BorrowOrderCancelEvent#

Struct types::BorrowOrderCancelEvent. Same fields as the BorrowOrderCancelEvent event.

BorrowOrderConfigArgs#

From the program's IDL:

A subset of [BorrowOrderConfig] excluding the accounts passed via
[SetBorrowOrder].

Struct types::BorrowOrderConfigArgs.

FieldType
remaining_debt_amountu64
max_borrow_rate_bpsu32
min_debt_term_secondsu64
fillable_until_timestampu64
enable_auto_rollover_on_filled_borrowsbool

BorrowOrderFullFillEvent#

Struct types::BorrowOrderFullFillEvent. Same fields as the BorrowOrderFullFillEvent event.

BorrowOrderPartialFillEvent#

Struct types::BorrowOrderPartialFillEvent. Same fields as the BorrowOrderPartialFillEvent event.

BorrowOrderPlaceEvent#

Struct types::BorrowOrderPlaceEvent. Same fields as the BorrowOrderPlaceEvent event.

BorrowOrderUpdateEvent#

Struct types::BorrowOrderUpdateEvent. Same fields as the BorrowOrderUpdateEvent event.

BorrowRateCurve#

Struct types::BorrowRateCurve.

FieldType
points[CurvePoint; 11]

CurvePoint#

Struct types::CurvePoint.

FieldType
utilization_rate_bpsu32
borrow_rate_bpsu32

ElevationGroup#

Struct types::ElevationGroup.

FieldTypeDescription
max_liquidation_bonus_bpsu16
idu8
ltv_pctu8
liquidation_threshold_pctu8
allow_new_loansu8
max_reserves_as_collateralu8
padding0u8
debt_reservePubkeyMandatory debt reserve for this elevation group
padding1[u64; 4]

FeeCalculation#

From the program's IDL:

Calculate fees exlusive or inclusive of an amount

Enum types::FeeCalculation.

Variant
Exclusive
Inclusive

FixedTermBorrowRolloverConfig#

From the program's IDL:

Settings driving the auto-rollover (or migration) of an
[ObligationLiquidity]'s borrow. This covers three flavors:

  • fixed-to-fixed: a fixed-term borrow rolling into another fixed-term reserve,
  • fixed-to-open: a fixed-term borrow rolling into an open-term reserve,
  • open-to-fixed: an open-term borrow migrating into a fixed-term reserve.

By its nature (not a special case), the zeroed struct means "no auto-rollover/migration".

Struct types::FixedTermBorrowRolloverConfig.

FieldTypeDescription
auto_rollover_enabledu8Whether this fixed-term borrow can be permissionlessly prolonged. The funds used to roll over can come: - either from a fixed-term reserve (same or a different one): - This can only happen within [LendingMarket::fixed_term_rollover_window_duration_seconds]. - The target reserve must meet all the criteria defined in this config (see [Self::max_borrow_rate_bps] and [Self::min_debt_term_seconds]). - Note: not possible when [Self::min_debt_term_seconds] is 0 (open-term only). - or from an open-term reserve: - This can only happen within [LendingMarket::open_term_rollover_window_duration_seconds]. - The user must explicitly set [Self::open_term_allowed] here. This setting is not effective when the borrow is currently using an open-term reserve.
open_term_allowedu8When 1, then [Self::auto_rollover_enabled] is allowed to roll this borrow over into any open-term reserve. Please note that if such rollover actually happens, then [Self::max_borrow_rate_bps] condition does not apply - technically, it could be evaluated, but open-term reserves typically use float-rate (utilization-driven borrow rate curve) which has very high maximum (when at 100% utilization) that would not meet any practical criteria here.
migration_to_fixed_enabledu8Whether this open-term borrow can be permissionlessly migrated into a fixed-term reserve: - This can happen at any moment (as soon as liquidity becomes available). - The target fixed-term reserve must meet all the criteria defined in this config (see [Self::max_borrow_rate_bps] and [Self::min_debt_term_seconds]). This setting is not effective when the borrow is currently using a fixed-term reserve. Cannot be enabled when [Self::min_debt_term_seconds] is 0 (open-term only), because migrating into a fixed-term reserve contradicts the open-term-only intent.
alignment_padding[u8; 1]Internal alignment padding (free to reuse).
max_borrow_rate_bpsu32A maximum allowed borrow rate of a reserve that can be used for a rollover/migration. Note: this must be set (i.e. non-zero) when enabling any rollover/migration flavor, but is of course not effective when rollover/migration is not enabled.
min_debt_term_secondsu64A minimum debt term (in seconds) of a fixed-term reserve that can be used for a rollover/migration. When 0, the owner only accepts open-term reserves as rollover targets — i.e. rolling over (or migrating) into a fixed-term reserve is not allowed. This is consistent with the semantics of [BorrowOrder::min_debt_term_seconds]. This means that 0 is incompatible with [Self::migration_to_fixed_enabled] (which requires a fixed-term target) — this combination is rejected at configuration time.

InitObligationArgs#

Struct types::InitObligationArgs.

FieldType
tagu8
idu8

LastUpdate#

From the program's IDL:

Last update state

Struct types::LastUpdate.

FieldTypeDescription
slotu64Last slot when updated
staleu8True when marked stale, false when slot updated
price_statusu8Status of the prices used to calculate the last update
placeholder[u8; 6]

ObligationCollateral#

From the program's IDL:

Obligation collateral state

Struct types::ObligationCollateral.

FieldTypeDescription
deposit_reservePubkeyReserve collateral is deposited to
deposited_amountu64Amount of collateral deposited
market_value_sfu128Collateral market value in quote currency (scaled fraction)
borrowed_amount_against_this_collateral_in_elevation_groupu64Debt amount (lamport) taken against this collateral. (only meaningful if this obligation is part of an elevation group, otherwise 0) This is only indicative of the debt computed on the last refresh obligation. If the obligation have multiple collateral this value is the same for all of them.
padding[u64; 9]

ObligationLiquidity#

From the program's IDL:

Obligation liquidity state

Struct types::ObligationLiquidity.

FieldTypeDescription
borrow_reservePubkeyReserve liquidity is borrowed from
cumulative_borrow_rate_bsfBigFractionBytesBorrow rate used for calculating interest (big scaled fraction)
last_borrowed_at_timestampu64The timestamp at which this debt was taken. Conceptually, every borrow can be interpreted as "closing the previous loan and starting a new one" (which would make a plain borrowed_at an even better name). But in terms of implementation, this fields records when the last borrow operation from this reserve happened (i.e. adding debt of the same reserve does move this timestamp). Note: this field is not only metadata: it is used in the logic, e.g. for enforcing the fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
borrowed_amount_sfu128Amount of liquidity borrowed plus interest (scaled fraction)
market_value_sfu128Liquidity market value in quote currency (scaled fraction)
borrow_factor_adjusted_market_value_sfu128Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead
borrowed_amount_outside_elevation_groupsu64Amount of liquidity borrowed outside of an elevation group
fixed_term_borrow_rollover_configFixedTermBorrowRolloverConfigThe user's auto-rollover/migration opt-ins. Some settings are effective only for fixed-term borrows, while others only for open-term borrows - see individual field docs.
borrowed_amount_at_expirationu64An amount of liquidity that was borrowed when this fixed-term borrow expired (i.e. zeroed if this borrow is not fixed-term, or if it did not yet expire). Needed to honor the [LendingMarket::term_based_full_liquidation_duration_secs]. This value is captured by [Self::capture_borrowed_amount_at_expiration] during obligation's refresh - please see the method's docs for gotchas. Note on precision: we use a u64 field, since the remaining space within this struct is rather scarce, and we do not need sub-lamport precision for the liquidation throttling rate.
padding2[u64; 4]

ObligationOrder#

From the program's IDL:

A single obligation order.
See [Obligation::obligation_orders].

Struct types::ObligationOrder.

FieldTypeDescription
condition_threshold_sfu128A threshold value used by the condition (scaled [Fraction]). The exact meaning depends on the specific [Self::condition_type]. Examples: - when condition_type == 2 (UserLtvBelow): then a value of 0.455 here means that the order is active only when the obligation's user LTV is less than 0.455 (i.e. < 45.5%). - when condition_type == 3 (DebtCollPriceRatioAbove): assuming the obligation uses BTC collateral for SOL debt, then a value of 491.3 here means that the order is active only when the BTC-SOL price is greater than 491.3 (i.e. > 491.3 SOL per BTC).
opportunity_parameter_sfu128A configuration parameter used by the opportunity (scaled [Fraction]). The exact meaning depends on the specific [Self::opportunity_type]. Examples: - when opportunity_type == 0 (DeleverageSingleDebtAmount): Assuming the obligation uses BTC collateral for SOL debt, then a value of 1_234_000_000 here means that a liquidator may repay up to 1234000000 lamports (i.e. 1.234 SOL) on this obligation. Note: the special value of [Fraction::MAX] is not allowed in this case. - when opportunity_type == 1 (DeleverageAllDebtAmount): The only allowed value in this case is [Fraction::MAX] (to emphasize that all debt should be repaid).
min_execution_bonus_bpsu16A minimum additional fraction of collateral transferred to the liquidator, in bps. The minimum bonus is applied exactly when the [Self::condition_threshold_sf] is met, and grows linearly towards the [Self::max_execution_bonus_bps]. Example: a value of 50 here means 50bps == 0.5% bonus for an "LTV > 65%" order, when executed precisely at the moment LTV exceeds 65%.
max_execution_bonus_bpsu16A maximum additional fraction of collateral transferred to the liquidator, in bps. The maximum bonus is applied at the relevant "extreme" state of the obligation, i.e.: - for a stop-loss condition, it is a point at which the obligation becomes liquidatable; - for a take-profit condition, it is a point at which obligation has 0% LTV. In non-extreme states, the actual bonus value is interpolated linearly, starting from [Self::min_execution_bonus_bps] (at the point specified by the order's condition). Example: a value of 300 here means 300bps == 3.0% bonus for a "debt/coll price > 140" order, when executed at a higher price = 200, at which the obligation's LTV happens to be equal to its liquidation LTV.
condition_typeu8Serialized [ConditionType]. The entire order is void when this is zeroed (i.e. representing [ConditionType::Never]). Example: a value of 2 here denotes UserLtvBelow condition type. Of course, to interpret this condition, we also need to take the [Self::condition_threshold_sf] into account.
opportunity_typeu8Serialized [OpportunityType]. Example: a value of 0 here denotes DeleverageSingleDebtAmount opportunity. Of course, to interpret this opportunity, we also need to take the [Self::opportunity_parameter_sf] into account.
padding1[u8; 10]Alignment padding. The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to align with u128s.
padding2[u128; 5]End padding. The total size of a single instance is 8*u128 = 128 bytes.

PriceHeuristic#

Struct types::PriceHeuristic.

FieldTypeDescription
loweru64Lower value of acceptable price
upperu64Upper value of acceptable price
expu64Number of decimals of the previously defined values

ProgressCallbackType#

From the program's IDL:

A callback to be notified when the ticket is being processed.

Why an enum?

Only reliable programs may be used for callbacks (since any error or panic returned from a CPI aborts an entire transaction, which would stall the queue progress). Hence, we need a whitelist, and the simplest initial implementation is a hardcoded enum. If we want to be able to add new whitelist items without SC updates, we can implement such support using a special enum value (e.g. SPECIFIED_BY_PDA = 255).

Enum types::ProgressCallbackType.

Variant
None
KlendQueueAccountingHandlerOnKvault

PythConfiguration#

Struct types::PythConfiguration.

FieldTypeDescription
pricePubkeyPubkey of the base price feed (disabled if null or default)

ReserveCollateral#

From the program's IDL:

Reserve collateral

Struct types::ReserveCollateral.

FieldTypeDescription
mint_pubkeyPubkeyReserve collateral mint address
mint_total_supplyu64Reserve collateral mint supply, used for exchange rate
supply_vaultPubkeyReserve collateral supply address
padding1[u128; 32]
padding2[u128; 32]

ReserveConfig#

From the program's IDL:

Reserve configuration values

Struct types::ReserveConfig.

FieldTypeDescription
statusu8Status of the reserve Active/Obsolete/Hidden
padding_deprecated_asset_tieru8Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt
host_fixed_interest_rate_bpsu16Flat rate that goes to the host
min_deleveraging_bonus_bpsu16Starting bonus for deleveraging-related liquidations, in bps.
block_ctoken_usageu8Boolean flag to block minting/redeeming of ctokens Blocks usage of ctokens (minting or withdrawing from obligation) Effectively blocks deposit_reserve_liquidity and withdraw_obligation_collateral
early_repay_remaining_interest_pctu8The percentage of remaining interest over the debt term that is charged as early repay penalty. Only meaningful when debt_term_seconds > 0.
emergency_modeu8Whether the reserve is in emergency mode. Blocks most user operations involving this reserve, similar to [LendingMarket::emergency_mode] but scoped to a single reserve. Also cascades to obligations using this reserve as collateral or debt, blocking borrows and withdrawals on other reserves but still allowing repays and deposits.
reserved1[u8; 4]Past reserved space - feel free to reuse.
protocol_order_execution_fee_pctu8Cut of the order execution bonus that the protocol receives, as a percentage
protocol_take_rate_pctu8Protocol take rate is the amount borrowed interest protocol receives, as a percentage
protocol_liquidation_fee_pctu8Cut of the liquidation bonus that the protocol receives, as a percentage
loan_to_value_pctu8Target ratio of the value of borrows to deposits, as a percentage 0 if use as collateral is disabled
liquidation_threshold_pctu8Loan to value ratio at which an obligation can be liquidated, as percentage
min_liquidation_bonus_bpsu16Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps
max_liquidation_bonus_bpsu16Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps
bad_debt_liquidation_bonus_bpsu16Bad debt liquidation bonus for an undercollateralized obligation, as bps
deleveraging_margin_call_period_secsu64Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed. Only relevant when autodeleverage_enabled == 1, and must not be 0 in such case.
deleveraging_threshold_decrease_bps_per_dayu64The rate at which the deleveraging threshold decreases, in bps per day. Only relevant when autodeleverage_enabled == 1, and must not be 0 in such case.
feesReserveFeesProgram owner fees assessed, separate from gains due to interest accrual
borrow_rate_curveBorrowRateCurveBorrow rate curve based on utilization
borrow_factor_pctu64Borrow factor in percentage - used for risk adjustment
deposit_limitu64Maximum deposit limit of liquidity in native units, u64::MAX for inf
borrow_limitu64Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits)
token_infoTokenInfoToken id from TokenInfos struct
deposit_withdrawal_capWithdrawalCapsDeposit withdrawal caps - deposit & redeem
debt_withdrawal_capWithdrawalCapsDebt withdrawal caps - borrow & repay
elevation_groups[u8; 20]
disable_usage_as_coll_outside_emodeu8
utilization_limit_block_borrowing_above_pctu8Utilization (in percentage) above which borrowing is blocked. 0 to disable.
autodeleverage_enabledu8Whether this reserve should be subject to auto-deleveraging after deposit or borrow limit is crossed. Besides this flag, the lending market's flag also needs to be enabled (logical AND). NOTE: the manual "target LTV" deleveraging is NOT affected by this flag.
proposer_authority_lockedu8Boolean flag indicating whether the reserve is locked for the proposer authority. Once the proposer have finished preparing the reserve, it must be locked to prevent further changes to the reserve configuration allowing review and voting on the proposal without alteration during the voting period.
borrow_limit_outside_elevation_groupu64Maximum amount liquidity of this reserve borrowed outside all elevation groups - u64::MAX for inf - 0 to disable borrows outside elevation groups
borrow_limit_against_this_collateral_in_elevation_group[u64; 32]Defines the maximum amount (in lamports of elevation group debt asset) that can be borrowed when this reserve is used as collateral. - u64::MAX for inf - 0 to disable borrows in this elevation group (expected value for the debt asset)
deleveraging_bonus_increase_bps_per_dayu64The rate at which the deleveraging-related liquidation bonus increases, in bps per day. Only relevant when autodeleverage_enabled == 1, and must not be 0 in such case.
debt_maturity_timestampu64The timestamp at which all [Obligation::borrows] using this reserve become liquidatable (on the same terms as reserve-wide deleveraging). Inactive when zeroed (i.e. debt never matures). Note: this feature is independent of [Self::debt_term_seconds] - the liquidation mechanism is based directly on the timestamp defined here, on Reserve's level.
debt_term_secondsu64The duration after which any debt coming from this Reserve must be repaid. Inactive when zeroed (i.e. funds can be borrowed indefinitely). Note: this feature is independent of [Self::debt_maturity_timestamp] - the liquidation mechanism is based on the [ObligationLiquidity::last_borrowed_at_timestamp].
rewards_amount_per_slotu64Rewards distributed per slot to depositors. Drained from [ReserveLiquidity::rewards_amount_available] into [ReserveLiquidity::total_available_amount] at each refresh, capped by the market-level [LendingMarket::reserve_rewards_max_apr_bps]. 0 disables. Note: because rewards inflate total_available_amount, a non-zero RPS on a reserve with [Self::autodeleverage_enabled] and a finite [Self::deposit_limit] will eventually cross the cap and arm the autodeleverage countdown. Size deposit_limit and RPS together.

ReserveConfigCustomizationArgs#

From the program's IDL:

A definition of optional customizations that should be applied after cloning the config.

Struct types::ReserveConfigCustomizationArgs.

FieldTypeDescription
override_fixed_rate_bpsu8A gate for [Self::fixed_borrow_rate_bps].
fixed_borrow_rate_bpsu32If [Self::override_fixed_rate_bps] is non-zero, this borrow rate will be used to override the [ReserveConfig::borrow_rate_curve] with a fixed one.
override_debt_term_secondsu8A gate for [Self::debt_term_seconds].
debt_term_secondsu64If [Self::override_debt_term_seconds] is non-zero, this value will be used to override the [ReserveConfig::debt_term_seconds].
clear_elevation_groupsu8Whether the target reserve should have zeroed [ReserveConfig::elevation_groups] (i.e. not cloned from source). This customization is mandatory when cloning a reserve (with some elevation groups) into a different market (where those elevation group indices would have different meaning).

ReserveFarmKind#

Enum types::ReserveFarmKind.

Variant
Collateral
Debt

ReserveFees#

From the program's IDL:

Additional fee information on a reserve
These exist separately from interest accrual fees, and are specifically for the program owner and referral fee. The fees are paid out as a percentage of liquidity token amounts during repayments and liquidations.

Struct types::ReserveFees.

FieldTypeDescription
origination_fee_sfu64Fee assessed on BorrowObligationLiquidity, as scaled fraction (60 bits fractional part) Must be between 0 and 2^60, such that 2^60 = 1. A few examples for clarity: 1% = (1 << 60) / 100 = 11529215046068470 0.01% (1 basis point) = 115292150460685 0.00001% (Aave origination fee) = 115292150461
flash_loan_fee_sfu64Fee for flash loan, expressed as scaled fraction. 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
padding[u8; 8]Used for allignment

ReserveLiquidity#

From the program's IDL:

Reserve liquidity

Struct types::ReserveLiquidity.

FieldTypeDescription
mint_pubkeyPubkeyReserve liquidity mint address
supply_vaultPubkeyReserve liquidity supply address
fee_vaultPubkeyReserve liquidity fee collection address
total_available_amountu64Total reserve liquidity available. Note: not all of this liquidity can be freely used for any purpose. Production code should use the specialized getters - see e.g. [Reserve::total_available_liquidity_amount()], [Reserve::freely_available_liquidity_amount()].
borrowed_amount_sfu128Reserve liquidity borrowed (scaled fraction)
market_price_sfu128Reserve liquidity market price in quote currency (scaled fraction)
market_price_last_updated_tsu64Unix timestamp of the market price (from the oracle)
mint_decimalsu64Reserve liquidity mint decimals
deposit_limit_crossed_timestampu64Timestamp when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled. If the threshold is not crossed, then the timestamp is set to 0
borrow_limit_crossed_timestampu64Timestamp when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled. If the threshold is not crossed, then the timestamp is set to 0
cumulative_borrow_rate_bsfBigFractionBytesReserve liquidity cumulative borrow rate (scaled fraction)
accumulated_protocol_fees_sfu128Reserve cumulative protocol fees (scaled fraction)
accumulated_referrer_fees_sfu128Reserve cumulative referrer fees (scaled fraction)
pending_referrer_fees_sfu128Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction)
absolute_referral_rate_sfu128Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction)
token_programPubkeyToken program of the liquidity mint
rewards_amount_availableu64Reserve rewards budget remaining for distribution. Tokens are deposited via topup_reserve_rewards and increase this counter (without touching [Self::total_available_amount]). On every refresh_reserve, up to rewards_amount_per_slot * slots_elapsed tokens are moved from this counter into [Self::total_available_amount], inflating the cToken exchange rate, capped by the market-level reserve_rewards_max_apr_bps cap.
padding2[u64; 50]
padding3[u128; 32]

ReserveStatus#

Enum types::ReserveStatus.

Variant
Active
Obsolete
Hidden

ScopeConfiguration#

Struct types::ScopeConfiguration.

FieldTypeDescription
price_feedPubkeyPubkey of the scope price feed (disabled if null or default)
price_chain[u16; 4]This is the scope_id price chain that results in a price for the token
twap_chain[u16; 4]This is the scope_id price chain for the twap

SwitchboardConfiguration#

Struct types::SwitchboardConfiguration.

FieldTypeDescription
price_aggregatorPubkeyPubkey of the base price feed (disabled if null or default)
twap_aggregatorPubkey

TokenInfo#

Struct types::TokenInfo.

FieldTypeDescription
name[u8; 32]UTF-8 encoded name of the token (null-terminated)
heuristicPriceHeuristicHeuristics limits of acceptable price
max_twap_divergence_bpsu64Max divergence between twap and price in bps
max_age_price_secondsu64
max_age_twap_secondsu64
scope_configurationScopeConfigurationScope price configuration
switchboard_configurationSwitchboardConfigurationSwitchboard configuration
pyth_configurationPythConfigurationPyth configuration
block_price_usageu8
reserved[u8; 7]
padding[u64; 19]

UpdateConfigMode#

Enum types::UpdateConfigMode.

Variant
UpdateLoanToValuePct
UpdateMaxLiquidationBonusBps
UpdateLiquidationThresholdPct
UpdateProtocolLiquidationFee
UpdateProtocolTakeRate
UpdateFeesOriginationFee
UpdateFeesFlashLoanFee
DeprecatedUpdateFeesReferralFeeBps
UpdateDepositLimit
UpdateBorrowLimit
UpdateTokenInfoLowerHeuristic
UpdateTokenInfoUpperHeuristic
UpdateTokenInfoExpHeuristic
UpdateTokenInfoTwapDivergence
UpdateTokenInfoScopeTwap
UpdateTokenInfoScopeChain
UpdateTokenInfoName
UpdateTokenInfoPriceMaxAge
UpdateTokenInfoTwapMaxAge
UpdateScopePriceFeed
UpdatePythPrice
UpdateSwitchboardFeed
UpdateSwitchboardTwapFeed
UpdateBorrowRateCurve
DeprecatedUpdateEntireReserveConfig
UpdateDebtWithdrawalCap
UpdateDepositWithdrawalCap
DeprecatedUpdateDebtWithdrawalCapCurrentTotal
DeprecatedUpdateDepositWithdrawalCapCurrentTotal
UpdateBadDebtLiquidationBonusBps
UpdateMinLiquidationBonusBps
UpdateDeleveragingMarginCallPeriod
UpdateBorrowFactor
DeprecatedUpdateAssetTier
UpdateElevationGroup
UpdateDeleveragingThresholdDecreaseBpsPerDay
DeprecatedUpdateMultiplierSideBoost
DeprecatedUpdateMultiplierTagBoost
UpdateReserveStatus
UpdateFarmCollateral
UpdateFarmDebt
UpdateDisableUsageAsCollateralOutsideEmode
UpdateBlockBorrowingAboveUtilizationPct
UpdateBlockPriceUsage
UpdateBorrowLimitOutsideElevationGroup
UpdateBorrowLimitsInElevationGroupAgainstThisReserve
UpdateHostFixedInterestRateBps
UpdateAutodeleverageEnabled
UpdateDeleveragingBonusIncreaseBpsPerDay
UpdateProtocolOrderExecutionFee
UpdateProposerAuthorityLock
UpdateMinDeleveragingBonusBps
UpdateBlockCTokenUsage
UpdateDebtMaturityTimestamp
UpdateDebtTermSeconds
UpdateEarlyRepayRemainingInterestPct
UpdateReserveEmergencyMode
UpdateRewardsAmountPerSlot

UpdateGlobalConfigMode#

Enum types::UpdateGlobalConfigMode.

Variant
PendingAdmin
FeeCollector

UpdateLendingMarketConfigValue#

Enum types::UpdateLendingMarketConfigValue.

VariantFields
Boolbool
U8u8
U8Array[u8; 8]
U16u16
U64u64
U128u128
PubkeyPubkey
ElevationGroupElevationGroup
Name[u8; 32]

UpdateLendingMarketMode#

Enum types::UpdateLendingMarketMode.

Variant
UpdateOwner
UpdateEmergencyMode
UpdateLiquidationCloseFactor
UpdateLiquidationMaxValue
DeprecatedUpdateGlobalUnhealthyBorrow
UpdateGlobalAllowedBorrow
UpdateEmergencyCouncil
UpdateMinFullLiquidationThreshold
UpdateInsolvencyRiskLtv
UpdateElevationGroup
UpdateReferralFeeBps
DeprecatedUpdateMultiplierPoints
UpdatePriceRefreshTriggerToMaxAgePct
UpdateAutodeleverageEnabled
UpdateBorrowingDisabled
UpdateMinNetValueObligationPostAction
UpdateMinValueLtvSkipPriorityLiqCheck
UpdateMinValueBfSkipPriorityLiqCheck
UpdatePaddingFields
UpdateName
UpdateIndividualAutodeleverageMarginCallPeriodSecs
UpdateInitialDepositAmount
UpdateObligationOrderExecutionEnabled
UpdateImmutableFlag
UpdateObligationOrderCreationEnabled
UpdateProposerAuthority
UpdatePriceTriggeredLiquidationDisabled
UpdateMatureReserveDebtLiquidationEnabled
UpdateObligationBorrowDebtTermLiquidationEnabled
UpdateBorrowOrderCreationEnabled
UpdateBorrowOrderExecutionEnabled
UpdateMinBorrowOrderFillValue
UpdateWithdrawTicketIssuanceEnabled
UpdateWithdrawTicketRedemptionEnabled
UpdateMinWithdrawQueuedLiquidityValue
UpdateFixedTermRolloverWindowDurationSeconds
UpdateOpenTermRolloverWindowDurationSeconds
UpdateObligationBorrowRolloverConfigurationEnabled
UpdateTermBasedFullLiquidationDurationSecs
UpdateObligationBorrowMigrationToFixedExecutionEnabled
UpdateMinPartialRolloverValue
UpdateWithdrawTicketCancellationEnabled
UpdatePermissioningAuthority
UpdatePermissionedOps
DeprecatedUpdateReserveRewardsMaxAprPct
UpdateReserveRewardsMaxAprBps

UpdateObligationConfigMode#

From the program's IDL:

A discriminator of a user-configurable piece of [Obligation].
Implementation note: due to TS-side codegen quirks (and a "convention" currently seen e.g. within reserve and market update operations), this is not a true Rust enum. The new value of a config item is provided in a separate handler argument (borsh-serialized), and its expected type is defined by each discriminator here. Additionally, each update mode acts on a specific [ObligationConfigUpdateSubject] (e.g. the auto-rollover of fixed-term borrows is configured on a per-borrow basis), which is also specified by separate handler arguments.

Enum types::UpdateObligationConfigMode.

Variant
FixedTermRolloverEnabled
FixedTermRolloverMaxBorrowRateBps
FixedTermRolloverMinDebtTermSeconds
FixedTermRolloverOpenTermAllowed
MigrationToFixedEnabled

WithdrawalCaps#

From the program's IDL:

Reserve Withdrawal Caps State

Struct types::WithdrawalCaps.

FieldType
config_capacityi64
current_totali64
last_interval_start_timestampu64
config_interval_length_secondsu64

WithdrawQueue#

From the program's IDL:

A tracker of ticket-based withdrawals.

Struct types::WithdrawQueue.

FieldTypeDescription
queued_collateral_amountu64The part of [ReserveLiquidity::total_available_amount] locked for ticketed withdrawals.
next_issued_ticket_sequence_numberu64The sequence number of the next ticket to be issued when enqueueing to withdraw. Note: it is also a number of tickets issued so far.
next_withdrawable_ticket_sequence_numberu64The sequence number of the next ticket to be used for actually transferring the withdrawn liquidity (assuming it is available in the reserve). Note: it is also a number of fully-consumed tickets so far.

Generated from the crate’s source at Carbon v2.0.0, so it always matches the published code. Spotted a problem? Report it; edits to this page itself are overwritten on the next release.

Your endpoints

Code samples use these instead of the placeholders, so you can copy and run them as they are. They’re stored only in this browser and never sent anywhere.