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.
| Crate | carbon-kamino-lending-decoder 2.0.0 |
| Install | cargo add carbon-kamino-lending-decoder@2. |
| Program ID | KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD (carbon_) |
| Category | Lending |
| Decoder | carbon_ |
| Instruction enum | instructions:: |
| Account enum | accounts:: |
| Event enum | instructions:: |
| Features | serde, postgres, graphql (none enabled by default) |
| API docs | docs.rs/carbon-kamino-lending-decoder/2.0.0 |
| Source | decoders/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:
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/fulluse {
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(())
}
}RUST_LOG=info cargo runEach 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:: (import instructions::); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_.
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:
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2use {
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(())
}
}RUST_LOG=info cargo runEach 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::, where data and accounts are the types listed under the variant, exported from carbon_. 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:
- The instruction's program ID is
KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD. - The data starts with the variant's discriminator, and the rest deserializes into its data type.
- 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_ too. Accounts after the listed ones are in accounts. as AccountMetas. The decoder doesn't record whether an account signed or was writable: read that from input. and ., 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:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | instruction_ | Pubkey |
| 3… | remaining | Vec< |
AcceptObligationOwnership#
Discriminator f98246b097bbef06 · data AcceptObligationOwnership · accounts AcceptObligationOwnershipInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of AcceptObligationOwnershipInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pending_ | Pubkey |
| 1 | obligation | Pubkey |
| 2 | instruction_ | Pubkey |
| 3… | remaining | Vec< |
ApproveObligationOwnershipTransfer#
Discriminator 3de3e72ec47c3ca1 · data ApproveObligationOwnershipTransfer · accounts ApproveObligationOwnershipTransferInstructionAccounts.
No data fields.
Required accounts: 4; extras go to remaining.
Fields of ApproveObligationOwnershipTransferInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | global_ | Pubkey |
| 1 | global_ | Pubkey |
| 2 | obligation | Pubkey |
| 3 | pending_ | Pubkey |
| 4… | remaining | Vec< |
BorrowObligationLiquidity#
Discriminator 797f12cc49f5e141 · data BorrowObligationLiquidity · accounts BorrowObligationLiquidityInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 12; extras go to remaining.
Fields of BorrowObligationLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | borrow_ | Pubkey |
| 5 | borrow_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | borrow_ | Pubkey |
| 8 | user_ | Pubkey |
| 9 | referrer_ | Option< |
| 10 | token_ | Pubkey |
| 11 | instruction_ | Pubkey |
| 12… | remaining | Vec< |
BorrowObligationLiquidityV2#
Discriminator a1808ff5abc7c206 · data BorrowObligationLiquidityV2 · accounts BorrowObligationLiquidityV2InstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 15; extras go to remaining.
Fields of BorrowObligationLiquidityV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | borrow_ | Pubkey |
| 5 | borrow_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | borrow_ | Pubkey |
| 8 | user_ | Pubkey |
| 9 | referrer_ | Option< |
| 10 | token_ | Pubkey |
| 11 | instruction_ | Pubkey |
| 12 | obligation_ | Option< |
| 13 | reserve_ | Option< |
| 14 | farms_ | Pubkey |
| 15… | remaining | Vec< |
CancelWithdrawTicket#
Discriminator b4537a2c78d32f16 · data CancelWithdrawTicket · accounts CancelWithdrawTicketInstructionAccounts.
| Field | Type |
|---|---|
ticket_ | u64 |
collateral_ | u64 |
Required accounts: 9; extras go to remaining.
Fields of CancelWithdrawTicketInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | owner_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | collateral_ | Pubkey |
| 8 | withdraw_ | Pubkey |
| 9… | remaining | Vec< |
CloneReserveConfig#
Discriminator f405c671110a4721 · data CloneReserveConfig · accounts CloneReserveConfigInstructionAccounts.
| Field | Type |
|---|---|
customizations | ReserveConfigCustomizationArgs |
Required accounts: 4; extras go to remaining.
Fields of CloneReserveConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | target_ | Pubkey |
| 2 | source_ | Pubkey |
| 3 | target_ | Pubkey |
| 4… | remaining | Vec< |
DeleteReferrerStateAndShortUrl#
Discriminator 99b9631ce4b3bb96 · data DeleteReferrerStateAndShortUrl · accounts DeleteReferrerStateAndShortUrlInstructionAccounts.
No data fields.
Required accounts: 5; extras go to remaining.
Fields of DeleteReferrerStateAndShortUrlInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | referrer | Pubkey |
| 1 | referrer_ | Pubkey |
| 2 | short_url | Pubkey |
| 3 | rent | Pubkey |
| 4 | system_ | Pubkey |
| 5… | remaining | Vec< |
DepositAndWithdraw#
Discriminator 8d99270f403d5854 · data DepositAndWithdraw · accounts DepositAndWithdrawInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
withdraw_ | u64 |
Required accounts: 20; extras go to remaining.
Fields of DepositAndWithdrawInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | reserve | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | reserve_ | Pubkey |
| 9 | user_ | Pubkey |
| 10 | placeholder_ | Option< |
| 11 | collateral_ | Pubkey |
| 12 | liquidity_ | Pubkey |
| 13 | instruction_ | Pubkey |
| 14 | withdraw_ | Pubkey |
| 15 | reserve_ | Pubkey |
| 16 | user_ | Pubkey |
| 17 | obligation_ | Option< |
| 18 | reserve_ | Option< |
| 19 | farms_ | Pubkey |
| 20… | remaining | Vec< |
DepositObligationCollateral#
Discriminator 6cd1044815167685 · data DepositObligationCollateral · accounts DepositObligationCollateralInstructionAccounts.
| Field | Type |
|---|---|
collateral_ | u64 |
Required accounts: 8; extras go to remaining.
Fields of DepositObligationCollateralInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | deposit_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | user_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | instruction_ | Pubkey |
| 8… | remaining | Vec< |
DepositObligationCollateralV2#
Discriminator 8991975ea7710491 · data DepositObligationCollateralV2 · accounts DepositObligationCollateralV2InstructionAccounts.
| Field | Type |
|---|---|
collateral_ | u64 |
Required accounts: 12; extras go to remaining.
Fields of DepositObligationCollateralV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | deposit_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | user_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | instruction_ | Pubkey |
| 8 | lending_ | Pubkey |
| 9 | obligation_ | Option< |
| 10 | reserve_ | Option< |
| 11 | farms_ | Pubkey |
| 12… | remaining | Vec< |
DepositReserveLiquidity#
Discriminator a9c91e7e06cd6644 · data DepositReserveLiquidity · accounts DepositReserveLiquidityInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 12; extras go to remaining.
Fields of DepositReserveLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | reserve | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | user_ | Pubkey |
| 8 | user_ | Pubkey |
| 9 | collateral_ | Pubkey |
| 10 | liquidity_ | Pubkey |
| 11 | instruction_ | Pubkey |
| 12… | remaining | Vec< |
DepositReserveLiquidityAndObligationCollateral#
Discriminator 81c70402de271a2e · data DepositReserveLiquidityAndObligationCollateral · accounts DepositReserveLiquidityAndObligationCollateralInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 14; extras go to remaining.
Fields of DepositReserveLiquidityAndObligationCollateralInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | reserve | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | reserve_ | Pubkey |
| 9 | user_ | Pubkey |
| 10 | placeholder_ | Option< |
| 11 | collateral_ | Pubkey |
| 12 | liquidity_ | Pubkey |
| 13 | instruction_ | Pubkey |
| 14… | remaining | Vec< |
DepositReserveLiquidityAndObligationCollateralV2#
Discriminator d8e0bf1bcc9766af · data DepositReserveLiquidityAndObligationCollateralV2 · accounts DepositReserveLiquidityAndObligationCollateralV2InstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 17; extras go to remaining.
Fields of DepositReserveLiquidityAndObligationCollateralV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | reserve | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | reserve_ | Pubkey |
| 9 | user_ | Pubkey |
| 10 | placeholder_ | Option< |
| 11 | collateral_ | Pubkey |
| 12 | liquidity_ | Pubkey |
| 13 | instruction_ | Pubkey |
| 14 | obligation_ | Option< |
| 15 | reserve_ | Option< |
| 16 | farms_ | Pubkey |
| 17… | remaining | Vec< |
EnqueueToWithdraw#
Discriminator 8671a0cf5a4bd5db · data EnqueueToWithdraw · accounts EnqueueToWithdrawInstructionAccounts.
| Field | Type |
|---|---|
collateral_ | u64 |
progress_ | ProgressCallbackType |
Required accounts: 15; extras go to remaining.
Fields of EnqueueToWithdrawInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | user_ | Pubkey |
| 5 | user_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | collateral_ | Pubkey |
| 9 | withdraw_ | Pubkey |
| 10 | owner_ | Pubkey |
| 11 | system_ | Pubkey |
| 12 | progress_ | Option< |
| 13 | progress_ | Option< |
| 14 | instruction_ | Pubkey |
| 15… | remaining | Vec< |
FillBorrowOrder#
Discriminator 6604a74c83aa5d13 · data FillBorrowOrder · accounts FillBorrowOrderInstructionAccounts.
No data fields.
Required accounts: 17; extras go to remaining.
Fields of FillBorrowOrderInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | borrow_ | Pubkey |
| 5 | borrow_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | borrow_ | Pubkey |
| 8 | user_ | Pubkey |
| 9 | referrer_ | Option< |
| 10 | token_ | Pubkey |
| 11 | instruction_ | Pubkey |
| 12 | obligation_ | Option< |
| 13 | reserve_ | Option< |
| 14 | farms_ | Pubkey |
| 15 | event_ | Pubkey |
| 16 | program | Pubkey |
| 17… | remaining | Vec< |
FlashBorrowReserveLiquidity#
Discriminator 87e734a70734d4c1 · data FlashBorrowReserveLiquidity · accounts FlashBorrowReserveLiquidityInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 12; extras go to remaining.
Fields of FlashBorrowReserveLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user_ | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | referrer_ | Option< |
| 9 | referrer_ | Option< |
| 10 | sysvar_info | Pubkey |
| 11 | token_ | Pubkey |
| 12… | remaining | Vec< |
FlashRepayReserveLiquidity#
Discriminator b97500cb60f5b4ba · data FlashRepayReserveLiquidity · accounts FlashRepayReserveLiquidityInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
borrow_ | u8 |
Required accounts: 12; extras go to remaining.
Fields of FlashRepayReserveLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user_ | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | referrer_ | Option< |
| 9 | referrer_ | Option< |
| 10 | sysvar_info | Pubkey |
| 11 | token_ | Pubkey |
| 12… | remaining | Vec< |
IdlMissingTypes#
Discriminator 8250269950d4b6fd · data IdlMissingTypes · accounts IdlMissingTypesInstructionAccounts.
| Field | Type |
|---|---|
reserve_ | ReserveFarmKind |
fee_ | FeeCalculation |
reserve_ | ReserveStatus |
update_ | UpdateConfigMode |
update_ | UpdateLendingMarketConfigValue |
update_ | UpdateLendingMarketMode |
Required accounts: 4; extras go to remaining.
Fields of IdlMissingTypesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | global_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4… | remaining | Vec< |
InitFarmsForReserve#
Discriminator da063ee90121e852 · data InitFarmsForReserve · accounts InitFarmsForReserveInstructionAccounts.
| Field | Type |
|---|---|
mode | u8 |
Required accounts: 10; extras go to remaining.
Fields of InitFarmsForReserveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | lending_ | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | farms_ | Pubkey |
| 5 | farms_ | Pubkey |
| 6 | farm_state | Pubkey |
| 7 | farms_ | Pubkey |
| 8 | rent | Pubkey |
| 9 | system_ | Pubkey |
| 10… | remaining | Vec< |
InitGlobalConfig#
Discriminator 8c88d630570078ff · data InitGlobalConfig · accounts InitGlobalConfigInstructionAccounts.
No data fields.
Required accounts: 5; extras go to remaining.
Fields of InitGlobalConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | global_ | Pubkey |
| 2 | program_ | Pubkey |
| 3 | system_ | Pubkey |
| 4 | rent | Pubkey |
| 5… | remaining | Vec< |
InitiateObligationOwnershipTransfer#
Discriminator 7f2a51da93ab4c99 · data InitiateObligationOwnershipTransfer · accounts InitiateObligationOwnershipTransferInstructionAccounts.
| Field | Type |
|---|---|
new_owner | Pubkey |
Required accounts: 3; extras go to remaining.
Fields of InitiateObligationOwnershipTransferInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | instruction_ | Pubkey |
| 3… | remaining | Vec< |
InitLendingMarket#
Discriminator 22a2740e65895eef · data InitLendingMarket · accounts InitLendingMarketInstructionAccounts.
| Field | Type |
|---|---|
quote_ | [u8; 32] |
Required accounts: 5; extras go to remaining.
Fields of InitLendingMarketInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | lending_ | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | system_ | Pubkey |
| 4 | rent | Pubkey |
| 5… | remaining | Vec< |
InitObligation#
Discriminator fb0ae74c1b0b9f60 · data InitObligation · accounts InitObligationInstructionAccounts.
| Field | Type |
|---|---|
args | InitObligationArgs |
Required accounts: 9; extras go to remaining.
Fields of InitObligationInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | obligation_ | Pubkey |
| 1 | fee_payer | Pubkey |
| 2 | obligation | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | seed1_ | Pubkey |
| 5 | seed2_ | Pubkey |
| 6 | owner_ | Pubkey |
| 7 | rent | Pubkey |
| 8 | system_ | Pubkey |
| 9… | remaining | Vec< |
InitObligationFarmsForReserve#
Discriminator 883f0fbad398a8a4 · data InitObligationFarmsForReserve · accounts InitObligationFarmsForReserveInstructionAccounts.
| Field | Type |
|---|---|
mode | u8 |
Required accounts: 11; extras go to remaining.
Fields of InitObligationFarmsForReserveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | owner | Pubkey |
| 2 | obligation | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | reserve | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | obligation_ | Pubkey |
| 7 | lending_ | Pubkey |
| 8 | farms_ | Pubkey |
| 9 | rent | Pubkey |
| 10 | system_ | Pubkey |
| 11… | remaining | Vec< |
InitReferrerStateAndShortUrl#
Discriminator a513197f64371f5a · data InitReferrerStateAndShortUrl · accounts InitReferrerStateAndShortUrlInstructionAccounts.
| Field | Type |
|---|---|
short_url | String |
Required accounts: 6; extras go to remaining.
Fields of InitReferrerStateAndShortUrlInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | referrer | Pubkey |
| 1 | referrer_ | Pubkey |
| 2 | referrer_ | Pubkey |
| 3 | referrer_ | Pubkey |
| 4 | rent | Pubkey |
| 5 | system_ | Pubkey |
| 6… | remaining | Vec< |
InitReferrerTokenState#
Discriminator 742d42943a0dda73 · data InitReferrerTokenState · accounts InitReferrerTokenStateInstructionAccounts.
No data fields.
Required accounts: 7; extras go to remaining.
Fields of InitReferrerTokenStateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | reserve | Pubkey |
| 3 | referrer | Pubkey |
| 4 | referrer_ | Pubkey |
| 5 | rent | Pubkey |
| 6 | system_ | Pubkey |
| 7… | remaining | Vec< |
InitReserve#
Discriminator 8af547e19904032b · data InitReserve · accounts InitReserveInstructionAccounts.
No data fields.
Required accounts: 14; extras go to remaining.
Fields of InitReserveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | fee_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | reserve_ | Pubkey |
| 9 | initial_ | Pubkey |
| 10 | rent | Pubkey |
| 11 | liquidity_ | Pubkey |
| 12 | collateral_ | Pubkey |
| 13 | system_ | Pubkey |
| 14… | remaining | Vec< |
InitUserMetadata#
Discriminator 75a9b045c5170fa2 · data InitUserMetadata · accounts InitUserMetadataInstructionAccounts.
| Field | Type |
|---|---|
user_ | Pubkey |
Required accounts: 6; extras go to remaining.
Fields of InitUserMetadataInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | fee_payer | Pubkey |
| 2 | user_ | Pubkey |
| 3 | referrer_ | Option< |
| 4 | rent | Pubkey |
| 5 | system_ | Pubkey |
| 6… | remaining | Vec< |
LiquidateObligationAndRedeemReserveCollateral#
Discriminator b1479abce2854a37 · data LiquidateObligationAndRedeemReserveCollateral · accounts LiquidateObligationAndRedeemReserveCollateralInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
min_ | u64 |
max_ | u64 |
Required accounts: 20; extras go to remaining.
Fields of LiquidateObligationAndRedeemReserveCollateralInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | liquidator | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | repay_ | Pubkey |
| 5 | repay_ | Pubkey |
| 6 | repay_ | Pubkey |
| 7 | withdraw_ | Pubkey |
| 8 | withdraw_ | Pubkey |
| 9 | withdraw_ | Pubkey |
| 10 | withdraw_ | Pubkey |
| 11 | withdraw_ | Pubkey |
| 12 | withdraw_ | Pubkey |
| 13 | user_ | Pubkey |
| 14 | user_ | Pubkey |
| 15 | user_ | Pubkey |
| 16 | collateral_ | Pubkey |
| 17 | repay_ | Pubkey |
| 18 | withdraw_ | Pubkey |
| 19 | instruction_ | Pubkey |
| 20… | remaining | Vec< |
LiquidateObligationAndRedeemReserveCollateralV2#
Discriminator a2a1238f1ebbb967 · data LiquidateObligationAndRedeemReserveCollateralV2 · accounts LiquidateObligationAndRedeemReserveCollateralV2InstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
min_ | u64 |
max_ | u64 |
Required accounts: 23; extras go to remaining.
Fields of LiquidateObligationAndRedeemReserveCollateralV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | liquidator | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | repay_ | Pubkey |
| 5 | repay_ | Pubkey |
| 6 | repay_ | Pubkey |
| 7 | withdraw_ | Pubkey |
| 8 | withdraw_ | Pubkey |
| 9 | withdraw_ | Pubkey |
| 10 | withdraw_ | Pubkey |
| 11 | withdraw_ | Pubkey |
| 12 | withdraw_ | Pubkey |
| 13 | user_ | Pubkey |
| 14 | user_ | Pubkey |
| 15 | user_ | Pubkey |
| 16 | collateral_ | Pubkey |
| 17 | repay_ | Pubkey |
| 18 | withdraw_ | Pubkey |
| 19 | instruction_ | Pubkey |
| 20 | obligation_ | Option< |
| 21 | reserve_ | Option< |
| 22 | farms_ | Pubkey |
| 23… | remaining | Vec< |
MarkObligationForDeleveraging#
Discriminator a423b6130074f37f · data MarkObligationForDeleveraging · accounts MarkObligationForDeleveragingInstructionAccounts.
| Field | Type |
|---|---|
autodeleverage_ | u8 |
Required accounts: 3; extras go to remaining.
Fields of MarkObligationForDeleveragingInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | lending_ | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3… | remaining | Vec< |
RecoverInvalidTicketCollateral#
Discriminator 1c30b0669fced2f6 · data RecoverInvalidTicketCollateral · accounts RecoverInvalidTicketCollateralInstructionAccounts.
| Field | Type |
|---|---|
ticket_ | u64 |
Required accounts: 11; extras go to remaining.
Fields of RecoverInvalidTicketCollateralInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | owner_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | collateral_ | Pubkey |
| 8 | withdraw_ | Pubkey |
| 9 | withdraw_ | Pubkey |
| 10 | instruction_ | Pubkey |
| 11… | remaining | Vec< |
RedeemFees#
Discriminator d727b429ad2ef8dc · data RedeemFees · accounts RedeemFeesInstructionAccounts.
No data fields.
Required accounts: 7; extras go to remaining.
Fields of RedeemFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | reserve | Pubkey |
| 1 | reserve_ | Pubkey |
| 2 | reserve_ | Pubkey |
| 3 | reserve_ | Pubkey |
| 4 | lending_ | Pubkey |
| 5 | lending_ | Pubkey |
| 6 | token_ | Pubkey |
| 7… | remaining | Vec< |
RedeemReserveCollateral#
Discriminator ea75b57db98edc1d · data RedeemReserveCollateral · accounts RedeemReserveCollateralInstructionAccounts.
| Field | Type |
|---|---|
collateral_ | u64 |
Required accounts: 12; extras go to remaining.
Fields of RedeemReserveCollateralInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | reserve | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | user_ | Pubkey |
| 8 | user_ | Pubkey |
| 9 | collateral_ | Pubkey |
| 10 | liquidity_ | Pubkey |
| 11 | instruction_ | Pubkey |
| 12… | remaining | Vec< |
RefreshObligation#
Discriminator 218493e497c04859 · data RefreshObligation · accounts RefreshObligationInstructionAccounts.
No data fields.
Required accounts: 2; extras go to remaining.
Fields of RefreshObligationInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | lending_ | Pubkey |
| 1 | obligation | Pubkey |
| 2… | remaining | Vec< |
RefreshObligationFarmsForReserve#
Discriminator 8c90fd150a4af803 · data RefreshObligationFarmsForReserve · accounts RefreshObligationFarmsForReserveInstructionAccounts.
| Field | Type |
|---|---|
mode | u8 |
Required accounts: 10; extras go to remaining.
Fields of RefreshObligationFarmsForReserveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | crank | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | obligation_ | Pubkey |
| 6 | lending_ | Pubkey |
| 7 | farms_ | Pubkey |
| 8 | rent | Pubkey |
| 9 | system_ | Pubkey |
| 10… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | reserve | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | pyth_oracle | Option< |
| 3 | switchboard_ | Option< |
| 4 | switchboard_ | Option< |
| 5 | scope_ | Option< |
| 6… | remaining | Vec< |
RefreshReservesBatch#
Discriminator 906e1a67a2ccfc93 · data RefreshReservesBatch · accounts RefreshReservesBatchInstructionAccounts.
| Field | Type |
|---|---|
skip_ | bool |
No named accounts.
RepayAndWithdrawAndRedeem#
Discriminator 0236980394606dda · data RepayAndWithdrawAndRedeem · accounts RepayAndWithdrawAndRedeemInstructionAccounts.
| Field | Type |
|---|---|
repay_ | u64 |
withdraw_ | u64 |
Required accounts: 21; extras go to remaining.
Fields of RepayAndWithdrawAndRedeemInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | repay_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | instruction_ | Pubkey |
| 9 | lending_ | Pubkey |
| 10 | withdraw_ | Pubkey |
| 11 | reserve_ | Pubkey |
| 12 | reserve_ | Pubkey |
| 13 | reserve_ | Pubkey |
| 14 | user_ | Pubkey |
| 15 | placeholder_ | Option< |
| 16 | collateral_ | Pubkey |
| 17 | liquidity_ | Pubkey |
| 18 | obligation_ | Option< |
| 19 | reserve_ | Option< |
| 20 | farms_ | Pubkey |
| 21… | remaining | Vec< |
RepayObligationLiquidity#
Discriminator 91b20de14cf09348 · data RepayObligationLiquidity · accounts RepayObligationLiquidityInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 9; extras go to remaining.
Fields of RepayObligationLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | repay_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | instruction_ | Pubkey |
| 9… | remaining | Vec< |
RepayObligationLiquidityV2#
Discriminator 74aed54cb435d290 · data RepayObligationLiquidityV2 · accounts RepayObligationLiquidityV2InstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 13; extras go to remaining.
Fields of RepayObligationLiquidityV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | repay_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | instruction_ | Pubkey |
| 9 | obligation_ | Option< |
| 10 | reserve_ | Option< |
| 11 | lending_ | Pubkey |
| 12 | farms_ | Pubkey |
| 13… | remaining | Vec< |
RequestElevationGroup#
Discriminator 2477fb8122f00793 · data RequestElevationGroup · accounts RequestElevationGroupInstructionAccounts.
| Field | Type |
|---|---|
elevation_ | u8 |
Required accounts: 3; extras go to remaining.
Fields of RequestElevationGroupInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3… | remaining | Vec< |
RolloverFixedTermBorrow#
Discriminator 551e9be1e0ba8d94 · data RolloverFixedTermBorrow · accounts RolloverFixedTermBorrowInstructionAccounts.
No data fields.
Required accounts: 13; extras go to remaining.
Fields of RolloverFixedTermBorrowInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | source_ | Pubkey |
| 5 | target_ | Pubkey |
| 6 | liquidity_ | Pubkey |
| 7 | source_ | Pubkey |
| 8 | target_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | obligation_ | Option< |
| 11 | reserve_ | Option< |
| 12 | farms_ | Pubkey |
| 13… | remaining | Vec< |
SeedDepositOnInitReserve#
Discriminator fec5e476b7ce3ee2 · data SeedDepositOnInitReserve · accounts SeedDepositOnInitReserveInstructionAccounts.
No data fields.
Required accounts: 7; extras go to remaining.
Fields of SeedDepositOnInitReserveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | reserve | Pubkey |
| 3 | reserve_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | initial_ | Pubkey |
| 6 | liquidity_ | Pubkey |
| 7… | remaining | Vec< |
SetBorrowOrder#
Discriminator b1ba2d3deb5b448b · data SetBorrowOrder · accounts SetBorrowOrderInstructionAccounts.
| Field | Type |
|---|---|
order_ | BorrowOrderConfigArgs |
min_ | u64 |
Required accounts: 9; extras go to remaining.
Fields of SetBorrowOrderInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | filled_ | Pubkey |
| 5 | debt_ | Pubkey |
| 6 | instruction_ | Pubkey |
| 7 | event_ | Pubkey |
| 8 | program | Pubkey |
| 9… | remaining | Vec< |
SetObligationOrder#
Discriminator 5101639cd3534e2e · data SetObligationOrder · accounts SetObligationOrderInstructionAccounts.
| Field | Type |
|---|---|
index | u8 |
order | ObligationOrder |
Required accounts: 3; extras go to remaining.
Fields of SetObligationOrderInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3… | remaining | Vec< |
SocializeLoss#
Discriminator f54b5b00ec611303 · data SocializeLoss · accounts SocializeLossInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 5; extras go to remaining.
Fields of SocializeLossInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | lending_ | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | instruction_ | Pubkey |
| 5… | remaining | Vec< |
SocializeLossV2#
Discriminator ee5f62dcbb28cc9a · data SocializeLossV2 · accounts SocializeLossV2InstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u64 |
Required accounts: 9; extras go to remaining.
Fields of SocializeLossV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | lending_ | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | instruction_ | Pubkey |
| 5 | obligation_ | Option< |
| 6 | reserve_ | Option< |
| 7 | lending_ | Pubkey |
| 8 | farms_ | Pubkey |
| 9… | remaining | Vec< |
TopupReserveRewards#
From the program's IDL:
Sponsor a reserve's rewards distribution by topping up its
rewards_budget.amount_ available
Discriminator 3fff82d36ed858ad · data TopupReserveRewards · accounts TopupReserveRewardsInstructionAccounts.
| Field | Type |
|---|---|
amount | u64 |
Required accounts: 7; extras go to remaining.
Fields of TopupReserveRewardsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | reserve | Pubkey |
| 3 | reserve_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | source_ | Pubkey |
| 6 | liquidity_ | Pubkey |
| 7… | remaining | Vec< |
UpdateGlobalConfig#
Discriminator a45482bd6f3afac8 · data UpdateGlobalConfig · accounts UpdateGlobalConfigInstructionAccounts.
| Field | Type |
|---|---|
mode | UpdateGlobalConfigMode |
value | Vec<u8> |
Required accounts: 2; extras go to remaining.
Fields of UpdateGlobalConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | global_ | Pubkey |
| 1 | global_ | Pubkey |
| 2… | remaining | Vec< |
UpdateGlobalConfigAdmin#
Discriminator b85717c19ceeaf77 · data UpdateGlobalConfigAdmin · accounts UpdateGlobalConfigAdminInstructionAccounts.
No data fields.
Required accounts: 2; extras go to remaining.
Fields of UpdateGlobalConfigAdminInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pending_ | Pubkey |
| 1 | global_ | Pubkey |
| 2… | remaining | Vec< |
UpdateLendingMarket#
Discriminator d19d35d261b41f2d · data UpdateLendingMarket · accounts UpdateLendingMarketInstructionAccounts.
| Field | Type |
|---|---|
mode | u64 |
value | [u8; 72] |
Required accounts: 2; extras go to remaining.
Fields of UpdateLendingMarketInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | lending_ | Pubkey |
| 2… | remaining | Vec< |
UpdateLendingMarketOwner#
Discriminator 76e00a3ec4e6b859 · data UpdateLendingMarketOwner · accounts UpdateLendingMarketOwnerInstructionAccounts.
No data fields.
Required accounts: 2; extras go to remaining.
Fields of UpdateLendingMarketOwnerInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | lending_ | Pubkey |
| 1 | lending_ | Pubkey |
| 2… | remaining | Vec< |
UpdateObligationConfig#
Discriminator 5298d545fa009dbc · data UpdateObligationConfig · accounts UpdateObligationConfigInstructionAccounts.
| Field | Type |
|---|---|
mode | UpdateObligationConfigMode |
value | Vec<u8> |
Required accounts: 5; extras go to remaining.
Fields of UpdateObligationConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | borrow_ | Option< |
| 3 | deposit_ | Option< |
| 4 | lending_ | Pubkey |
| 5… | remaining | Vec< |
UpdateReserveConfig#
Discriminator 3d9464468f6b110d · data UpdateReserveConfig · accounts UpdateReserveConfigInstructionAccounts.
| Field | Type |
|---|---|
mode | UpdateConfigMode |
value | Vec<u8> |
skip_ | bool |
Required accounts: 4; extras go to remaining.
Fields of UpdateReserveConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | global_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4… | remaining | Vec< |
WithdrawObligationCollateral#
Discriminator 2574cd67f3c05cc6 · data WithdrawObligationCollateral · accounts WithdrawObligationCollateralInstructionAccounts.
| Field | Type |
|---|---|
collateral_ | u64 |
Required accounts: 9; extras go to remaining.
Fields of WithdrawObligationCollateralInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | withdraw_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | instruction_ | Pubkey |
| 9… | remaining | Vec< |
WithdrawObligationCollateralAndRedeemReserveCollateral#
Discriminator 4b5d5ddc2296dac4 · data WithdrawObligationCollateralAndRedeemReserveCollateral · accounts WithdrawObligationCollateralAndRedeemReserveCollateralInstructionAccounts.
| Field | Type |
|---|---|
collateral_ | u64 |
Required accounts: 14; extras go to remaining.
Fields of WithdrawObligationCollateralAndRedeemReserveCollateralInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | withdraw_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | reserve_ | Pubkey |
| 9 | user_ | Pubkey |
| 10 | placeholder_ | Option< |
| 11 | collateral_ | Pubkey |
| 12 | liquidity_ | Pubkey |
| 13 | instruction_ | Pubkey |
| 14… | remaining | Vec< |
WithdrawObligationCollateralAndRedeemReserveCollateralV2#
Discriminator eb34779895c51407 · data WithdrawObligationCollateralAndRedeemReserveCollateralV2 · accounts WithdrawObligationCollateralAndRedeemReserveCollateralV2InstructionAccounts.
| Field | Type |
|---|---|
collateral_ | u64 |
Required accounts: 17; extras go to remaining.
Fields of WithdrawObligationCollateralAndRedeemReserveCollateralV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | withdraw_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | reserve_ | Pubkey |
| 8 | reserve_ | Pubkey |
| 9 | user_ | Pubkey |
| 10 | placeholder_ | Option< |
| 11 | collateral_ | Pubkey |
| 12 | liquidity_ | Pubkey |
| 13 | instruction_ | Pubkey |
| 14 | obligation_ | Option< |
| 15 | reserve_ | Option< |
| 16 | farms_ | Pubkey |
| 17… | remaining | Vec< |
WithdrawObligationCollateralV2#
Discriminator caf97572e7c02f8a · data WithdrawObligationCollateralV2 · accounts WithdrawObligationCollateralV2InstructionAccounts.
| Field | Type |
|---|---|
collateral_ | u64 |
Required accounts: 12; extras go to remaining.
Fields of WithdrawObligationCollateralV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | obligation | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | lending_ | Pubkey |
| 4 | withdraw_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | user_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | instruction_ | Pubkey |
| 9 | obligation_ | Option< |
| 10 | reserve_ | Option< |
| 11 | farms_ | Pubkey |
| 12… | remaining | Vec< |
WithdrawProtocolFee#
Discriminator 9ec99ebd215da267 · data WithdrawProtocolFee · accounts WithdrawProtocolFeeInstructionAccounts.
| Field | Type |
|---|---|
amount | u64 |
Required accounts: 8; extras go to remaining.
Fields of WithdrawProtocolFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | global_ | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | reserve | Pubkey |
| 3 | reserve_ | Pubkey |
| 4 | lending_ | Pubkey |
| 5 | fee_vault | Pubkey |
| 6 | fee_ | Pubkey |
| 7 | token_ | Pubkey |
| 8… | remaining | Vec< |
WithdrawQueuedLiquidity#
Discriminator 4295bbc94abfae78 · data WithdrawQueuedLiquidity · accounts WithdrawQueuedLiquidityInstructionAccounts.
No data fields.
Required accounts: 19; extras go to remaining.
Fields of WithdrawQueuedLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | lending_ | Pubkey |
| 2 | lending_ | Pubkey |
| 3 | reserve | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | reserve_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | owner_ | Pubkey |
| 8 | user_ | Pubkey |
| 9 | collateral_ | Pubkey |
| 10 | liquidity_ | Pubkey |
| 11 | withdraw_ | Pubkey |
| 12 | withdraw_ | Pubkey |
| 13 | associated_ | Pubkey |
| 14 | system_ | Pubkey |
| 15 | progress_ | Option< |
| 16 | progress_ | Option< |
| 17 | progress_ | Option< |
| 18 | instruction_ | Pubkey |
| 19… | remaining | Vec< |
WithdrawReferrerFees#
Discriminator ab7679c9e98c17e4 · data WithdrawReferrerFees · accounts WithdrawReferrerFeesInstructionAccounts.
No data fields.
Required accounts: 9; extras go to remaining.
Fields of WithdrawReferrerFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | referrer | Pubkey |
| 1 | referrer_ | Pubkey |
| 2 | reserve | Pubkey |
| 3 | reserve_ | Pubkey |
| 4 | reserve_ | Pubkey |
| 5 | referrer_ | Pubkey |
| 6 | lending_ | Pubkey |
| 7 | lending_ | Pubkey |
| 8 | token_ | Pubkey |
| 9… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | program | Pubkey |
| 1 | event_ | Pubkey |
| 2… | remaining | Vec< |
Accounts#
Variants of KaminoLendingAccount. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
GlobalConfig#
Discriminator 95089ccaa0fcb0d9 · accounts::.
| Field | Type | Description |
|---|---|---|
global_ | Pubkey | Global admin of the program |
pending_ | Pubkey | Pending admin must sign a specific transaction to become the global admin |
fee_ | Pubkey | Fee 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::.
| Field | Type | Description |
|---|---|---|
version | u64 | Version of lending market |
bump_seed | u64 | Bump seed for derived authority address |
lending_ | Pubkey | Owner authority which can add new reserves |
lending_ | Pubkey | Temporary cache of the lending market owner, used in update_lending_market_owner |
quote_ | [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_ | u16 | Referral fee for the lending market, as bps out of the total protocol fee |
emergency_ | u8 | |
autodeleverage_ | u8 | Whether 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_ | u8 | |
price_ | u8 | Refresh 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_ | u8 | Percentage of the total borrowed value in an obligation available for liquidation |
insolvency_ | u8 | Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% |
min_ | u64 | Minimum 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_ | u64 | Max allowed liquidation value in one ix call |
reserved0 | [u8; 8] | [DEPRECATED] Global maximum unhealthy borrow value allowed for any obligation |
global_ | u64 | Global maximum allowed borrow value allowed for any obligation |
emergency_ | Pubkey | The 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_ | [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_ | [u64; 90] | |
min_ | u128 | Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) |
min_ | u64 | Minimum value to enforce smallest ltv priority checks on the collateral reserves on liquidation |
name | [u8; 32] | Market name, zero-padded. |
min_ | u64 | Minimum value to enforce highest borrow factor priority checks on the debt reserves on liquidation |
individual_ | u64 | Time (in seconds) that must pass before liquidation is allowed on an obligation that has been individually marked for auto-deleveraging. |
min_ | u64 | Minimum 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_ | u8 | Whether the obligation orders should be evaluated during liquidations. |
immutable | u8 | Whether the lending market is set as immutable. |
obligation_ | u8 | Whether new obligation orders can be created. Note: updating or cancelling existing orders is not affected by this flag. |
price_ | u8 | Whether 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_ | u8 | Whether the debts that reached their reserve's [ReserveConfig::debt_maturity_timestamp] can be liquidated. |
obligation_ | u8 | Whether the [Obligation::borrows] that reached their [ReserveConfig::debt_term_seconds] can be liquidated. |
borrow_ | u8 | Whether new borrow orders can be created. Note: updating or cancelling existing orders is not affected by this flag. |
borrow_ | u8 | Whether the existing borrow orders can be filled. |
proposer_ | Pubkey | Authority that can propose creating of new reserves but cannot enable them. |
min_ | u64 | Minimum value that can be filled in a single fill_ call, in full units of the quote currency (e.g. 2 means "$2", not "2 lamports of USDC"). |
withdraw_ | u8 | Whether any new withdraw tickets can be issued (i.e. whether new requests can enter the withdraw queue). |
withdraw_ | u8 | Whether the existing withdraw tickets can be redeemed (i.e. whether the tickets can be used to transfer accumulated pending liquidity to destination accounts). |
obligation_ | u8 | Whether 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_ | u8 | Whether the actual execution of a "migration to fixed" rollover flavor is allowed. See [FixedTermBorrowRolloverConfig::migration_to_fixed_enabled]. |
withdraw_ | u8 | Whether 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_ | u16 | Maximum APR (in basis points; FULL_ = 100%) at which reserves on this market may distribute their rewards_. 0 disables rewards on this market entirely (topup_ is rejected). Bounded by FULL_BPS (100% APR) when set. See [ReserveConfig::rewards_amount_per_slot] for the depositor-cap interaction. |
min_ | u64 | Minimum value that can be withdrawn in a single withdraw_ call, in full units of the quote currency (e.g. 2 means "$2", not "2 lamports of USDC"). |
fixed_ | u64 | A 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_ | u64 | A 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_ | u64 | Minimum 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_ | u64 | The 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_ | Pubkey | If not NULL, operations encoded in permissioned_ops require a signature from this authority |
permissioned_ | u64 | Bitmap of operations that require permissioning authority signature |
padding1 | [u64; 153] |
Obligation#
From the program's IDL:
Lending market obligation state
Discriminator a8ce8d6a584caca7 · accounts::.
| Field | Type | Description |
|---|---|---|
tag | u64 | Version of the struct |
last_update | LastUpdate | Last update to collateral, liquidity, or their market values |
lending_ | Pubkey | Lending market address |
owner | Pubkey | Owner authority which can borrow liquidity |
deposits | [ObligationCollateral; 8] | Deposited collateral for the obligation, unique by deposit reserve address |
lowest_ | u64 | Worst LTV for the collaterals backing the loan, represented as a percentage |
deposited_ | u128 | Market value of deposits (scaled fraction) |
borrows | [ObligationLiquidity; 5] | Borrowed liquidity for the obligation, unique by borrow reserve address |
borrow_ | u128 | Risk adjusted market value of borrows/debt (sum of price * borrowed_amount * borrow_factor) (scaled fraction) |
borrowed_ | u128 | Market value of borrows - used for max_liquidatable_borrowed_amount (scaled fraction) |
allowed_ | u128 | The maximum borrow value at the weighted average loan to value ratio (scaled fraction) |
unhealthy_ | u128 | The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) |
padding_ | [u8; 13] | The asset tier of the deposits |
elevation_ | u8 | The elevation group id the obligation opted into. |
num_ | u8 | The number of obsolete reserves the obligation has a deposit in |
has_debt | u8 | Marked = 1 if borrows array is not empty, 0 = borrows empty |
referrer | Pubkey | Wallet address of the referrer |
borrowing_ | u8 | Marked = 1 if borrowing disabled, 0 = borrowing enabled |
autodeleverage_ | u8 | A target LTV set by the market owner when marking this obligation for deleveraging. Only effective when deleveraging_. |
lowest_ | u8 | The lowest max LTV found amongst the collateral deposits |
num_ | u8 | The number of obsolete reserves the obligation has a borrow in |
ownership_ | u8 | State of ownership transfer, see [OwnershipTransferState] |
reserved | [u8; 3] | |
highest_ | u64 | |
autodeleverage_ | u64 | A timestamp at which the market owner most-recently marked this obligation for deleveraging. Zero if not currently subject to deleveraging. |
obligation_ | [ObligationOrder; 2] | Owner-defined, permissionlessly-executed repay orders. Typical use-cases would be a stop-loss and a take-profit (possibly co-existing). |
borrow_ | BorrowOrder | Owner-defined, permissionlessly-executed borrow order applicable to this obligation. Non-zeroed only on a newly-initialized fixed-rate, fixed-term obligation. |
pending_ | Pubkey | Pending owner during ownership transfer process. Pubkey::default() means no pending owner (similar to Option::None) |
padding3 | [u64; 69] |
ReferrerState#
Discriminator c251d9670c130c42 · accounts::.
| Field | Type |
|---|---|
short_url | Pubkey |
owner | Pubkey |
ReferrerTokenState#
From the program's IDL:
Referrer account -> each owner can have multiple accounts for specific reserves
Discriminator 270fd04d20c36938 · accounts::.
| Field | Type | Description |
|---|---|---|
referrer | Pubkey | Pubkey of the referrer/owner |
mint | Pubkey | Token mint for the account |
amount_ | u128 | Amount that has been accumulated and not claimed yet -> available to claim (scaled fraction) |
amount_ | u128 | Amount that has been accumulated in total -> both already claimed and unclaimed (scaled fraction) |
bump | u64 | Referrer token state bump, used for address validation |
padding | [u64; 31] |
Reserve#
Discriminator 2bf2ccca1af73b7f · accounts::.
| Field | Type | Description |
|---|---|---|
version | u64 | Version of the reserve |
last_update | LastUpdate | Last slot when supply and rates updated |
lending_ | Pubkey | Lending market address |
farm_ | Pubkey | |
farm_debt | Pubkey | |
liquidity | ReserveLiquidity | Reserve liquidity |
reserve_ | [u64; 150] | |
collateral | ReserveCollateral | Reserve collateral |
reserve_ | [u64; 150] | |
config | ReserveConfig | Reserve configuration values |
config_ | [u64; 113] | |
borrowed_ | u64 | |
borrowed_ | [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_ | WithdrawQueue | The tracker of ticket-based withdrawals. |
padding | [u64; 204] |
ShortUrl#
Discriminator 1c59ae19e27c7ed4 · accounts::.
| Field | Type |
|---|---|
referrer | Pubkey |
short_url | String |
UserMetadata#
From the program's IDL:
Referrer account -> each owner can have multiple accounts for specific reserves
Discriminator 9dd6dceb6287ab1c · accounts::.
| Field | Type | Description |
|---|---|---|
referrer | Pubkey | Pubkey of the referrer/owner - pubkey::default if no referrer |
bump | u64 | Bump used for validation of account address |
user_ | Pubkey | User 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 |
owner | Pubkey | User metadata account owner |
padding1 | [u64; 51] | |
padding2 | [u64; 64] |
UserState#
Discriminator 48b155f94ca7ba7e · accounts::.
| Field | Type |
|---|---|
user_id | u64 |
farm_state | Pubkey |
owner | Pubkey |
is_ | u8 |
padding0 | [u8; 7] |
rewards_ | [u128; 10] |
rewards_ | [u64; 10] |
last_ | [u64; 10] |
active_ | u128 |
pending_ | u128 |
pending_ | u64 |
pending_ | u128 |
pending_ | u64 |
bump | u64 |
delegatee | Pubkey |
last_ | u64 |
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:
- 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_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 sequenceto_ withdraw 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_handler instead. 7. The handler transfers the liquidity amount according to the current exchange rate. 8. The handler closes the ticket account.invalid_ ticket_ collateral
Discriminator ed17a43a35f8f05e · accounts::.
| Field | Type | Description |
|---|---|---|
sequence_ | u64 | This ticket's place in the queue; the same as used for PDA derivation. |
owner | Pubkey | The funds' owner (the user who called the enqueue_ handler). |
reserve | Pubkey | The reserve to withdraw from. |
user_ | Pubkey | The token account to which the finally-available liquidity should be transferred (by the withdraw_ handler). |
queued_ | u64 | The amount of collateral still waiting to be withdrawn using this ticket. |
created_ | u64 | The timestamp at which the queue was entered. This is currently only a piece of metadata, not used by the logic. |
invalid | u8 | Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity] has been repurposed) by the withdraw_ handler. To be specific: valid = 0, invalid = 1. An invalid ticket cannot be made valid again, and can only be passed to the recover_ handler. |
progress_ | u8 | One of the valid [ProgressCallbackType] representations. |
alignment_ | [u8; 6] | Inner padding, for alignment. |
progress_ | [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::, decoded from the CpiEvent instruction. Each wraps a struct from carbon_. The discriminator is the 8-byte event discriminator that follows the e445a52e51cb9a1d CPI-event tag.
BorrowOrderCancelEvent#
Discriminator 58e4e7e6eaf84590 · events::.
| Field | Type |
|---|---|
before | BorrowOrder |
BorrowOrderFullFillEvent#
Discriminator b1f1edfa8f140eb7 · events::.
| Field | Type |
|---|---|
before | BorrowOrder |
BorrowOrderPartialFillEvent#
Discriminator 7151fcc198186354 · events::.
| Field | Type |
|---|---|
before | BorrowOrder |
after | BorrowOrder |
BorrowOrderPlaceEvent#
Discriminator 2bd3d0ba5ee3dac6 · events::.
| Field | Type |
|---|---|
after | BorrowOrder |
BorrowOrderUpdateEvent#
Discriminator 1521438330b85a40 · events::.
| Field | Type |
|---|---|
before | BorrowOrder |
after | BorrowOrder |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
BigFractionBytes#
Struct types::.
| Field | Type |
|---|---|
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::.
| Field | Type | Description |
|---|---|---|
debt_ | Pubkey | The asset to be borrowed. The reserves used for [Obligation::borrows] must all provide exactly this asset. |
remaining_ | u64 | The amount of debt that still needs to be filled, in lamports. |
filled_ | Pubkey | The token account owned by the [Obligation::owner] and holding [Self::debt_liquidity_mint], where the filled funds should be transferred to. |
min_ | u64 | The 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_ | u64 | The time until which the borrow order can still be filled. |
placed_ | u64 | The time at which this order was placed. Currently, this is only a piece of metadata. |
last_ | u64 | The time at which this order was most-recently updated (including: created). Currently, this is only a piece of metadata. |
requested_ | u64 | The 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_ | u32 | The maximum borrow rate that the obligation owner agrees to. The reserves used for [Obligation::borrows] cannot define their maximum borrow rate higher than this. |
active | u8 | Whether 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_ | u8 | When 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::. Same fields as the BorrowOrderCancelEvent event.
BorrowOrderConfigArgs#
From the program's IDL:
A subset of [BorrowOrderConfig] excluding the accounts passed via
[SetBorrowOrder].
Struct types::.
| Field | Type |
|---|---|
remaining_ | u64 |
max_ | u32 |
min_ | u64 |
fillable_ | u64 |
enable_ | bool |
BorrowOrderFullFillEvent#
Struct types::. Same fields as the BorrowOrderFullFillEvent event.
BorrowOrderPartialFillEvent#
Struct types::. Same fields as the BorrowOrderPartialFillEvent event.
BorrowOrderPlaceEvent#
Struct types::. Same fields as the BorrowOrderPlaceEvent event.
BorrowOrderUpdateEvent#
Struct types::. Same fields as the BorrowOrderUpdateEvent event.
BorrowRateCurve#
Struct types::.
| Field | Type |
|---|---|
points | [CurvePoint; 11] |
CurvePoint#
Struct types::.
| Field | Type |
|---|---|
utilization_ | u32 |
borrow_ | u32 |
ElevationGroup#
Struct types::.
| Field | Type | Description |
|---|---|---|
max_ | u16 | |
id | u8 | |
ltv_pct | u8 | |
liquidation_ | u8 | |
allow_ | u8 | |
max_ | u8 | |
padding0 | u8 | |
debt_ | Pubkey | Mandatory 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::.
| 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::.
| Field | Type | Description |
|---|---|---|
auto_ | u8 | Whether 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_ | u8 | When 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_ | u8 | Whether 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_ | [u8; 1] | Internal alignment padding (free to reuse). |
max_ | u32 | A 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_ | u64 | A 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::.
| Field | Type |
|---|---|
tag | u8 |
id | u8 |
LastUpdate#
From the program's IDL:
Last update state
Struct types::.
| Field | Type | Description |
|---|---|---|
slot | u64 | Last slot when updated |
stale | u8 | True when marked stale, false when slot updated |
price_ | u8 | Status of the prices used to calculate the last update |
placeholder | [u8; 6] |
ObligationCollateral#
From the program's IDL:
Obligation collateral state
Struct types::.
| Field | Type | Description |
|---|---|---|
deposit_ | Pubkey | Reserve collateral is deposited to |
deposited_ | u64 | Amount of collateral deposited |
market_ | u128 | Collateral market value in quote currency (scaled fraction) |
borrowed_ | u64 | Debt 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::.
| Field | Type | Description |
|---|---|---|
borrow_ | Pubkey | Reserve liquidity is borrowed from |
cumulative_ | BigFractionBytes | Borrow rate used for calculating interest (big scaled fraction) |
last_ | u64 | The 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_ | u128 | Amount of liquidity borrowed plus interest (scaled fraction) |
market_ | u128 | Liquidity market value in quote currency (scaled fraction) |
borrow_ | u128 | Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead |
borrowed_ | u64 | Amount of liquidity borrowed outside of an elevation group |
fixed_ | FixedTermBorrowRolloverConfig | The 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_ | u64 | An 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::.
| Field | Type | Description |
|---|---|---|
condition_ | u128 | A threshold value used by the condition (scaled [Fraction]). The exact meaning depends on the specific [Self::condition_type]. Examples: - when condition_: 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_: 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_ | u128 | A configuration parameter used by the opportunity (scaled [Fraction]). The exact meaning depends on the specific [Self::opportunity_type]. Examples: - when opportunity_: Assuming the obligation uses BTC collateral for SOL debt, then a value of 1_ 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_: The only allowed value in this case is [Fraction::MAX] (to emphasize that all debt should be repaid). |
min_ | u16 | A 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_ | u16 | A 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_ | u8 | Serialized [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_ | u8 | Serialized [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::.
| Field | Type | Description |
|---|---|---|
lower | u64 | Lower value of acceptable price |
upper | u64 | Upper value of acceptable price |
exp | u64 | Number 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::.
| Variant |
|---|
None |
KlendQueueAccountingHandlerOnKvault |
PythConfiguration#
Struct types::.
| Field | Type | Description |
|---|---|---|
price | Pubkey | Pubkey of the base price feed (disabled if null or default) |
ReserveCollateral#
From the program's IDL:
Reserve collateral
Struct types::.
| Field | Type | Description |
|---|---|---|
mint_pubkey | Pubkey | Reserve collateral mint address |
mint_ | u64 | Reserve collateral mint supply, used for exchange rate |
supply_ | Pubkey | Reserve collateral supply address |
padding1 | [u128; 32] | |
padding2 | [u128; 32] |
ReserveConfig#
From the program's IDL:
Reserve configuration values
Struct types::.
| Field | Type | Description |
|---|---|---|
status | u8 | Status of the reserve Active/Obsolete/Hidden |
padding_ | u8 | Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt |
host_ | u16 | Flat rate that goes to the host |
min_ | u16 | Starting bonus for deleveraging-related liquidations, in bps. |
block_ | u8 | Boolean 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_ | u8 | The percentage of remaining interest over the debt term that is charged as early repay penalty. Only meaningful when debt_. |
emergency_ | u8 | Whether 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_ | u8 | Cut of the order execution bonus that the protocol receives, as a percentage |
protocol_ | u8 | Protocol take rate is the amount borrowed interest protocol receives, as a percentage |
protocol_ | u8 | Cut of the liquidation bonus that the protocol receives, as a percentage |
loan_ | u8 | Target ratio of the value of borrows to deposits, as a percentage 0 if use as collateral is disabled |
liquidation_ | u8 | Loan to value ratio at which an obligation can be liquidated, as percentage |
min_ | u16 | Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps |
max_ | u16 | Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps |
bad_ | u16 | Bad debt liquidation bonus for an undercollateralized obligation, as bps |
deleveraging_ | u64 | Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed. Only relevant when autodeleverage_, and must not be 0 in such case. |
deleveraging_ | u64 | The rate at which the deleveraging threshold decreases, in bps per day. Only relevant when autodeleverage_, and must not be 0 in such case. |
fees | ReserveFees | Program owner fees assessed, separate from gains due to interest accrual |
borrow_ | BorrowRateCurve | Borrow rate curve based on utilization |
borrow_ | u64 | Borrow factor in percentage - used for risk adjustment |
deposit_ | u64 | Maximum deposit limit of liquidity in native units, u64::MAX for inf |
borrow_ | u64 | Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) |
token_info | TokenInfo | Token id from TokenInfos struct |
deposit_ | WithdrawalCaps | Deposit withdrawal caps - deposit & redeem |
debt_ | WithdrawalCaps | Debt withdrawal caps - borrow & repay |
elevation_ | [u8; 20] | |
disable_ | u8 | |
utilization_ | u8 | Utilization (in percentage) above which borrowing is blocked. 0 to disable. |
autodeleverage_ | u8 | Whether 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_ | u8 | Boolean 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_ | u64 | Maximum amount liquidity of this reserve borrowed outside all elevation groups - u64::MAX for inf - 0 to disable borrows outside elevation groups |
borrow_ | [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_ | u64 | The rate at which the deleveraging-related liquidation bonus increases, in bps per day. Only relevant when autodeleverage_, and must not be 0 in such case. |
debt_ | u64 | The 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_ | u64 | The 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_ | u64 | Rewards 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_, 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_ and RPS together. |
ReserveConfigCustomizationArgs#
From the program's IDL:
A definition of optional customizations that should be applied after cloning the config.
Struct types::.
| Field | Type | Description |
|---|---|---|
override_ | u8 | A gate for [Self::fixed_borrow_rate_bps]. |
fixed_ | u32 | If [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_ | u8 | A gate for [Self::debt_term_seconds]. |
debt_ | u64 | If [Self::override_debt_term_seconds] is non-zero, this value will be used to override the [ReserveConfig::debt_term_seconds]. |
clear_ | u8 | Whether 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::.
| 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::.
| Field | Type | Description |
|---|---|---|
origination_ | u64 | Fee 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_ | u64 | Fee 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::.
| Field | Type | Description |
|---|---|---|
mint_pubkey | Pubkey | Reserve liquidity mint address |
supply_ | Pubkey | Reserve liquidity supply address |
fee_vault | Pubkey | Reserve liquidity fee collection address |
total_ | u64 | Total 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_ | u128 | Reserve liquidity borrowed (scaled fraction) |
market_ | u128 | Reserve liquidity market price in quote currency (scaled fraction) |
market_ | u64 | Unix timestamp of the market price (from the oracle) |
mint_ | u64 | Reserve liquidity mint decimals |
deposit_ | u64 | Timestamp 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_ | u64 | Timestamp 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_ | BigFractionBytes | Reserve liquidity cumulative borrow rate (scaled fraction) |
accumulated_ | u128 | Reserve cumulative protocol fees (scaled fraction) |
accumulated_ | u128 | Reserve cumulative referrer fees (scaled fraction) |
pending_ | u128 | Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) |
absolute_ | u128 | Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) |
token_ | Pubkey | Token program of the liquidity mint |
rewards_ | u64 | Reserve rewards budget remaining for distribution. Tokens are deposited via topup_ and increase this counter (without touching [Self::total_available_amount]). On every refresh_, up to rewards_ tokens are moved from this counter into [Self::total_available_amount], inflating the cToken exchange rate, capped by the market-level reserve_ cap. |
padding2 | [u64; 50] | |
padding3 | [u128; 32] |
ReserveStatus#
Enum types::.
| Variant |
|---|
Active |
Obsolete |
Hidden |
ScopeConfiguration#
Struct types::.
| Field | Type | Description |
|---|---|---|
price_feed | Pubkey | Pubkey 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::.
| Field | Type | Description |
|---|---|---|
price_ | Pubkey | Pubkey of the base price feed (disabled if null or default) |
twap_ | Pubkey |
TokenInfo#
Struct types::.
| Field | Type | Description |
|---|---|---|
name | [u8; 32] | UTF-8 encoded name of the token (null-terminated) |
heuristic | PriceHeuristic | Heuristics limits of acceptable price |
max_ | u64 | Max divergence between twap and price in bps |
max_ | u64 | |
max_ | u64 | |
scope_ | ScopeConfiguration | Scope price configuration |
switchboard_ | SwitchboardConfiguration | Switchboard configuration |
pyth_ | PythConfiguration | Pyth configuration |
block_ | u8 | |
reserved | [u8; 7] | |
padding | [u64; 19] |
UpdateConfigMode#
Enum types::.
| 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::.
| Variant |
|---|
PendingAdmin |
FeeCollector |
UpdateLendingMarketConfigValue#
Enum types::.
| Variant | Fields |
|---|---|
Bool | bool |
U8 | u8 |
U8Array | [u8; 8] |
U16 | u16 |
U64 | u64 |
U128 | u128 |
Pubkey | Pubkey |
ElevationGroup | ElevationGroup |
Name | [u8; 32] |
UpdateLendingMarketMode#
Enum types::.
| 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::.
| Variant |
|---|
FixedTermRolloverEnabled |
FixedTermRolloverMaxBorrowRateBps |
FixedTermRolloverMinDebtTermSeconds |
FixedTermRolloverOpenTermAllowed |
MigrationToFixedEnabled |
WithdrawalCaps#
From the program's IDL:
Reserve Withdrawal Caps State
Struct types::.
| Field | Type |
|---|---|
config_ | i64 |
current_ | i64 |
last_ | u64 |
config_ | u64 |
WithdrawQueue#
From the program's IDL:
A tracker of ticket-based withdrawals.
Struct types::.
| Field | Type | Description |
|---|---|---|
queued_ | u64 | The part of [ReserveLiquidity::total_available_amount] locked for ticketed withdrawals. |
next_ | u64 | The 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_ | u64 | The 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. |