Jupiter Lend decoder

Decode Jupiter Lend instructions, accounts and events in Rust with carbon-jupiter-lend-decoder 2.0.0. Program ID jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC.

On this page

carbon-jupiter-lend-decoder decodes the instructions, accounts and events of the Jupiter Lend program (jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC): 24 instructions, 7 account types, 19 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-jupiter-lend-decoder 2.0.0
Installcargo add carbon-jupiter-lend-decoder@2.0.0
Program IDjupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC (carbon_jupiter_lend_decoder::PROGRAM_ID)
CategoryLending
Decodercarbon_jupiter_lend_decoder::JupiterLendDecoder
Instruction enuminstructions::JupiterLendInstruction
Account enumaccounts::JupiterLendAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-jupiter-lend-decoder/2.0.0
Sourcedecoders/jupiter-lend-decoder

Other lending decoders: Kamino Lending, 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 Jupiter Lend transactions from the public RPC and prints every decoded ChangeStatus instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-jupiter-lend-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
src/main.rs
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_jupiter_lend_decoder::{
        instructions::JupiterLendInstruction, JupiterLendDecoder, 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(JupiterLendDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

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

Each ChangeStatus instruction prints one line with the transaction signature and the decoded ChangeStatus 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 JupiterLendInstruction::CpiEvent { data: CpiEvent::LogBorrowRateCap(event), .. } (import instructions::CpiEvent); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_log_events.

Decode accounts#

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

Terminal
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
src/main.rs
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_jupiter_lend_decoder::{accounts::JupiterLendAccount, JupiterLendDecoder, 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(JupiterLendDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

Each update to a AuthorizationList 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 JupiterLendInstruction. Each is JupiterLendInstruction::<Variant> { program_id, data, accounts }, where data and accounts are the types listed under the variant, exported from carbon_jupiter_lend_decoder::instructions. Discriminators are the leading bytes of the instruction data, in hex.

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

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

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

ChangeStatus#

Discriminator ec9183e4e311c0ff · data ChangeStatus · accounts ChangeStatusInstructionAccounts.

FieldType
statusbool

Required accounts: 3; extras go to remaining.

Fields of ChangeStatusInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1liquidityPubkey
2auth_listPubkey
3…remainingVec<AccountMeta>

Claim#

Discriminator 3ec6d6c1d59f6cd2 · data Claim · accounts ClaimInstructionAccounts.

FieldType
recipientPubkey

Required accounts: 9; extras go to remaining.

Fields of ClaimInstructionAccounts, in account order:

#FieldType
0userPubkey
1liquidityPubkey
2token_reservePubkey
3mintPubkey
4recipient_token_accountPubkey
5vaultPubkey
6claim_accountPubkey
7token_programPubkey
8associated_token_programPubkey
9…remainingVec<AccountMeta>

CloseClaimAccount#

Discriminator f192cbd83ade5b76 · data CloseClaimAccount · accounts CloseClaimAccountInstructionAccounts.

FieldType
mintPubkey

Required accounts: 3; extras go to remaining.

Fields of CloseClaimAccountInstructionAccounts, in account order:

#FieldType
0userPubkey
1claim_accountPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

CollectRevenue#

Discriminator 5760d324f02bf657 · data CollectRevenue · accounts CollectRevenueInstructionAccounts.

No data fields.

Required accounts: 11; extras go to remaining.

Fields of CollectRevenueInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1liquidityPubkey
2auth_listPubkey
3mintPubkey
4revenue_collector_accountPubkey
5revenue_collectorPubkey
6token_reservePubkey
7vaultPubkey
8token_programPubkey
9associated_token_programPubkey
10system_programPubkey
11…remainingVec<AccountMeta>

InitClaimAccount#

Discriminator 708d2faa2a639091 · data InitClaimAccount · accounts InitClaimAccountInstructionAccounts.

FieldType
mintPubkey
userPubkey

Required accounts: 3; extras go to remaining.

Fields of InitClaimAccountInstructionAccounts, in account order:

#FieldType
0signerPubkey
1claim_accountPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

InitLiquidity#

Discriminator 5fbdd8b7bc3ef46c · data InitLiquidity · accounts InitLiquidityInstructionAccounts.

FieldType
authorityPubkey
revenue_collectorPubkey

Required accounts: 4; extras go to remaining.

Fields of InitLiquidityInstructionAccounts, in account order:

#FieldType
0signerPubkey
1liquidityPubkey
2auth_listPubkey
3system_programPubkey
4…remainingVec<AccountMeta>

InitNewProtocol#

Discriminator c19305208a87d59e · data InitNewProtocol · accounts InitNewProtocolInstructionAccounts.

FieldType
supply_mintPubkey
borrow_mintPubkey
protocolPubkey

Required accounts: 5; extras go to remaining.

Fields of InitNewProtocolInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1auth_listPubkey
2user_supply_positionPubkey
3user_borrow_positionPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitTokenReserve#

Discriminator e4eb41819f0f0654 · data InitTokenReserve · accounts InitTokenReserveInstructionAccounts.

No data fields.

Required accounts: 10; extras go to remaining.

Fields of InitTokenReserveInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1liquidityPubkey
2auth_listPubkey
3mintPubkey
4vaultPubkey
5rate_modelPubkey
6token_reservePubkey
7token_programPubkey
8associated_token_programPubkey
9system_programPubkey
10…remainingVec<AccountMeta>

Operate#

Discriminator d96ad06374972a87 · data Operate · accounts OperateInstructionAccounts.

FieldType
supply_amounti128
borrow_amounti128
withdraw_toPubkey
borrow_toPubkey
transfer_typeTransferType

Required accounts: 14; extras go to remaining.

Fields of OperateInstructionAccounts, in account order:

#FieldType
0protocolPubkey
1liquidityPubkey
2token_reservePubkey
3mintPubkey
4vaultPubkey
5user_supply_positionOption<Pubkey>
6user_borrow_positionOption<Pubkey>
7rate_modelPubkey
8withdraw_to_accountOption<Pubkey>
9borrow_to_accountOption<Pubkey>
10borrow_claim_accountOption<Pubkey>
11withdraw_claim_accountOption<Pubkey>
12token_programPubkey
13associated_token_programPubkey
14…remainingVec<AccountMeta>

PauseUser#

Discriminator 123f2b5eef35650e · data PauseUser · accounts PauseUserInstructionAccounts.

FieldType
protocolPubkey
supply_mintPubkey
borrow_mintPubkey
supply_statusOption<u8>
borrow_statusOption<u8>

Required accounts: 4; extras go to remaining.

Fields of PauseUserInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1auth_listPubkey
2user_supply_positionPubkey
3user_borrow_positionPubkey
4…remainingVec<AccountMeta>

PreOperate#

Discriminator 81cd9e9bc69b4885 · data PreOperate · accounts PreOperateInstructionAccounts.

FieldType
mintPubkey

Required accounts: 8; extras go to remaining.

Fields of PreOperateInstructionAccounts, in account order:

#FieldType
0protocolPubkey
1liquidityPubkey
2user_supply_positionOption<Pubkey>
3user_borrow_positionOption<Pubkey>
4vaultPubkey
5token_reservePubkey
6associated_token_programPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

UnpauseUser#

Discriminator 477380fcb67eea3e · data UnpauseUser · accounts UnpauseUserInstructionAccounts.

FieldType
protocolPubkey
supply_mintPubkey
borrow_mintPubkey
supply_statusOption<u8>
borrow_statusOption<u8>

Required accounts: 4; extras go to remaining.

Fields of UnpauseUserInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1auth_listPubkey
2user_supply_positionPubkey
3user_borrow_positionPubkey
4…remainingVec<AccountMeta>

UpdateAuthority#

Discriminator 202e401c954bf358 · data UpdateAuthority · accounts UpdateAuthorityInstructionAccounts.

FieldType
new_authorityPubkey

Required accounts: 3; extras go to remaining.

Fields of UpdateAuthorityInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1liquidityPubkey
2auth_listPubkey
3…remainingVec<AccountMeta>

UpdateAuths#

Discriminator 5d60b29c3975fdd1 · data UpdateAuths · accounts UpdateAuthsInstructionAccounts.

FieldType
auth_statusVec<AddressBool>

Required accounts: 3; extras go to remaining.

Fields of UpdateAuthsInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1liquidityPubkey
2auth_listPubkey
3…remainingVec<AccountMeta>

UpdateExchangePrice#

Discriminator eff40af874193596 · data UpdateExchangePrice · accounts UpdateExchangePriceInstructionAccounts.

FieldType
mintPubkey

Required accounts: 2; extras go to remaining.

Fields of UpdateExchangePriceInstructionAccounts, in account order:

#FieldType
0token_reservePubkey
1rate_modelPubkey
2…remainingVec<AccountMeta>

UpdateGuardians#

Discriminator 2b3efa8a8d758461 · data UpdateGuardians · accounts UpdateGuardiansInstructionAccounts.

FieldType
guardian_statusVec<AddressBool>

Required accounts: 3; extras go to remaining.

Fields of UpdateGuardiansInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1liquidityPubkey
2auth_listPubkey
3…remainingVec<AccountMeta>

UpdateRateDataV1#

Discriminator 0614227a1696b416 · data UpdateRateDataV1 · accounts UpdateRateDataV1InstructionAccounts.

FieldType
rate_dataRateDataV1Params

Required accounts: 5; extras go to remaining.

Fields of UpdateRateDataV1InstructionAccounts, in account order:

#FieldType
0authorityPubkey
1auth_listPubkey
2rate_modelPubkey
3mintPubkey
4token_reservePubkey
5…remainingVec<AccountMeta>

UpdateRateDataV2#

Discriminator 74493592d82de47c · data UpdateRateDataV2 · accounts UpdateRateDataV2InstructionAccounts.

FieldType
rate_dataRateDataV2Params

Required accounts: 5; extras go to remaining.

Fields of UpdateRateDataV2InstructionAccounts, in account order:

#FieldType
0authorityPubkey
1auth_listPubkey
2rate_modelPubkey
3mintPubkey
4token_reservePubkey
5…remainingVec<AccountMeta>

UpdateRevenueCollector#

Discriminator a78e7cf0dc718d3b · data UpdateRevenueCollector · accounts UpdateRevenueCollectorInstructionAccounts.

FieldType
revenue_collectorPubkey

Required accounts: 2; extras go to remaining.

Fields of UpdateRevenueCollectorInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1liquidityPubkey
2…remainingVec<AccountMeta>

UpdateTokenConfig#

Discriminator e77ab54fff4f90a7 · data UpdateTokenConfig · accounts UpdateTokenConfigInstructionAccounts.

FieldType
token_configTokenConfig

Required accounts: 5; extras go to remaining.

Fields of UpdateTokenConfigInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1auth_listPubkey
2rate_modelPubkey
3mintPubkey
4token_reservePubkey
5…remainingVec<AccountMeta>

UpdateUserBorrowConfig#

Discriminator 64b0c9aef70236a8 · data UpdateUserBorrowConfig · accounts UpdateUserBorrowConfigInstructionAccounts.

FieldType
user_borrow_configUserBorrowConfig

Required accounts: 7; extras go to remaining.

Fields of UpdateUserBorrowConfigInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1protocolPubkey
2auth_listPubkey
3rate_modelPubkey
4mintPubkey
5token_reservePubkey
6user_borrow_positionPubkey
7…remainingVec<AccountMeta>

UpdateUserClass#

Discriminator 0cce44873fd43077 · data UpdateUserClass · accounts UpdateUserClassInstructionAccounts.

FieldType
user_classVec<AddressU8>

Required accounts: 2; extras go to remaining.

Fields of UpdateUserClassInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1auth_listPubkey
2…remainingVec<AccountMeta>

UpdateUserSupplyConfig#

Discriminator d9efe1da2131eab7 · data UpdateUserSupplyConfig · accounts UpdateUserSupplyConfigInstructionAccounts.

FieldType
user_supply_configUserSupplyConfig

Required accounts: 7; extras go to remaining.

Fields of UpdateUserSupplyConfigInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1protocolPubkey
2auth_listPubkey
3rate_modelPubkey
4mintPubkey
5token_reservePubkey
6user_supply_positionPubkey
7…remainingVec<AccountMeta>

UpdateUserWithdrawalLimit#

Discriminator a209ba09d51ead4e · data UpdateUserWithdrawalLimit · accounts UpdateUserWithdrawalLimitInstructionAccounts.

FieldType
new_limitu128
protocolPubkey
mintPubkey

Required accounts: 3; extras go to remaining.

Fields of UpdateUserWithdrawalLimitInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1auth_listPubkey
2user_supply_positionPubkey
3…remainingVec<AccountMeta>

CpiEvent#

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

Discriminator e445a52e51cb9a1d · data CpiEvent · accounts CpiEventInstructionAccounts.

Required accounts: 2; extras go to remaining.

Fields of CpiEventInstructionAccounts, in account order:

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

Accounts#

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

AuthorizationList#

Discriminator 139d752beca7fb45 · accounts::authorization_list::AuthorizationList.

FieldType
auth_usersVec<Pubkey>
guardiansVec<Pubkey>
user_classesVec<UserClass>

Liquidity#

Discriminator 36fcf9e289ac793a · accounts::liquidity::Liquidity.

FieldType
authorityPubkey
revenue_collectorPubkey
statusbool
bumpu8

RateModel#

Discriminator 5e03cbdb6b8904a2 · accounts::rate_model::RateModel.

FieldType
mintPubkey
versionu8
rate_at_zerou16
kink1_utilizationu16
rate_at_kink1u16
rate_at_maxu16
kink2_utilizationu16
rate_at_kink2u16

TokenReserve#

Discriminator 15123b8778141f0c · accounts::token_reserve::TokenReserve.

FieldType
mintPubkey
vaultPubkey
borrow_rateu16
fee_on_interestu16
last_utilizationu16
last_update_timestampu64
supply_exchange_priceu64
borrow_exchange_priceu64
max_utilizationu16
total_supply_with_interestu64
total_supply_interest_freeu64
total_borrow_with_interestu64
total_borrow_interest_freeu64
total_claim_amountu64
interacting_protocolPubkey
interacting_timestampu64
interacting_balanceu64

UserBorrowPosition#

Discriminator 497e417bdc7ec518 · accounts::user_borrow_position::UserBorrowPosition.

FieldType
protocolPubkey
mintPubkey
with_interestu8
amountu64
debt_ceilingu64
last_updateu64
expand_pctu16
expand_durationu32
base_debt_ceilingu64
max_debt_ceilingu64
statusu8

UserClaim#

Discriminator e48ec3b5e49320d1 · accounts::user_claim::UserClaim.

FieldType
userPubkey
amountu64
mintPubkey

UserSupplyPosition#

Discriminator cadb88763db11592 · accounts::user_supply_position::UserSupplyPosition.

FieldType
protocolPubkey
mintPubkey
with_interestu8
amountu64
withdrawal_limitu128
last_updateu64
expand_pctu16
expand_durationu64
base_withdrawal_limitu64
statusu8

Events#

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

LogBorrowRateCap#

Discriminator 9c83e85efe9c0e75 · events::log_borrow_rate_cap::LogBorrowRateCapEvent.

FieldType
tokenPubkey

LogChangeStatus#

Discriminator 594d25ac8d1f4a2a · events::log_change_status::LogChangeStatusEvent.

FieldType
new_statusbool

LogClaim#

Discriminator ee329d55973ae72d · events::log_claim::LogClaimEvent.

FieldType
userPubkey
tokenPubkey
recipientPubkey
amountu64

LogCollectRevenue#

Discriminator 40c616c27b57a652 · events::log_collect_revenue::LogCollectRevenueEvent.

FieldType
tokenPubkey
revenue_amountu128

LogOperate#

Discriminator b40851471384ad08 · events::log_operate::LogOperateEvent.

FieldType
userPubkey
tokenPubkey
supply_amounti128
borrow_amounti128
withdraw_toPubkey
borrow_toPubkey
supply_exchange_priceu64
borrow_exchange_priceu64

LogPauseUser#

Discriminator 641172e0b41e34aa · events::log_pause_user::LogPauseUserEvent.

FieldType
userPubkey
mintPubkey
statusu8

LogUnpauseUser#

Discriminator aa5b8460b34da81a · events::log_unpause_user::LogUnpauseUserEvent.

FieldType
userPubkey
mintPubkey
statusu8

LogUpdateAuthority#

Discriminator 96989d8f0687c165 · events::log_update_authority::LogUpdateAuthorityEvent.

FieldType
new_authorityPubkey

LogUpdateAuths#

Discriminator 58506d306fcb4cfb · events::log_update_auths::LogUpdateAuthsEvent.

FieldType
auth_statusVec<AddressBool>

LogUpdateExchangePrices#

Discriminator bec245cc1e56b5a3 · events::log_update_exchange_prices::LogUpdateExchangePricesEvent.

FieldType
tokenPubkey
supply_exchange_priceu128
borrow_exchange_priceu128
borrow_rateu16
utilizationu16

LogUpdateGuardians#

Discriminator e71cbf33358c4f8e · events::log_update_guardians::LogUpdateGuardiansEvent.

FieldType
guardian_statusVec<AddressBool>

LogUpdateRateDataV1#

Discriminator 1e6683c0001e55df · events::log_update_rate_data_v1::LogUpdateRateDataV1Event.

FieldType
tokenPubkey
rate_dataRateDataV1Params

LogUpdateRateDataV2#

Discriminator ce35c34671d35c81 · events::log_update_rate_data_v2::LogUpdateRateDataV2Event.

FieldType
tokenPubkey
rate_dataRateDataV2Params

LogUpdateRevenueCollector#

Discriminator 2c8f50fad393b49f · events::log_update_revenue_collector::LogUpdateRevenueCollectorEvent.

FieldType
revenue_collectorPubkey

LogUpdateTokenConfigs#

Discriminator 18cdbf822f28e9da · events::log_update_token_configs::LogUpdateTokenConfigsEvent.

FieldType
token_configTokenConfig

LogUpdateUserBorrowConfigs#

Discriminator d2fbf29fcd219a4a · events::log_update_user_borrow_configs::LogUpdateUserBorrowConfigsEvent.

FieldType
userPubkey
tokenPubkey
user_borrow_configUserBorrowConfig

LogUpdateUserClass#

Discriminator b9c16af80b350088 · events::log_update_user_class::LogUpdateUserClassEvent.

FieldType
user_classVec<AddressU8>

LogUpdateUserSupplyConfigs#

Discriminator 8ea0155a57581233 · events::log_update_user_supply_configs::LogUpdateUserSupplyConfigsEvent.

FieldType
userPubkey
tokenPubkey
user_supply_configUserSupplyConfig

LogUpdateUserWithdrawalLimit#

Discriminator 728398bd78fd5869 · events::log_update_user_withdrawal_limit::LogUpdateUserWithdrawalLimitEvent.

FieldType
userPubkey
tokenPubkey
new_limitu128

Types#

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

AddressBool#

Struct types::AddressBool.

FieldType
addrPubkey
valuebool

AddressU8#

Struct types::AddressU8.

FieldType
addrPubkey
valueu8

LogBorrowRateCap#

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

LogChangeStatus#

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

LogClaim#

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

LogCollectRevenue#

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

LogOperate#

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

LogPauseUser#

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

LogUnpauseUser#

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

LogUpdateAuthority#

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

LogUpdateAuths#

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

LogUpdateExchangePrices#

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

LogUpdateGuardians#

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

LogUpdateRateDataV1#

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

LogUpdateRateDataV2#

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

LogUpdateRevenueCollector#

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

LogUpdateTokenConfigs#

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

LogUpdateUserBorrowConfigs#

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

LogUpdateUserClass#

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

LogUpdateUserSupplyConfigs#

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

LogUpdateUserWithdrawalLimit#

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

RateDataV1Params#

From the program's IDL:

@notice struct to set borrow rate data for version 1

Struct types::RateDataV1Params.

FieldTypeDescription
kinku128@param kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100
rate_at_utilization_zerou128@param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100 i.e. constant minimum borrow rate e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then)
rate_at_utilization_kinku128@param rateAtUtilizationKink borrow rate when utilization is at kink. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 7% at kink then rateAtUtilizationKink would be 700
rate_at_utilization_maxu128@param rateAtUtilizationMax borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500

RateDataV2Params#

From the program's IDL:

@notice struct to set borrow rate data for version 2

Struct types::RateDataV2Params.

FieldTypeDescription
kink1u128@param kink1 first kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100 utilization below kink 1 usually means slow increase in rate, once utilization is above kink 1 borrow rate increases faster
kink2u128@param kink2 second kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100 utilization below kink 2 usually means slow / medium increase in rate, once utilization is above kink 2 borrow rate increases fast
rate_at_utilization_zerou128@param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100 i.e. constant minimum borrow rate e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then)
rate_at_utilization_kink1u128@param rateAtUtilizationKink1 desired borrow rate when utilization is at first kink. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 7% at first kink then rateAtUtilizationKink would be 700
rate_at_utilization_kink2u128@param rateAtUtilizationKink2 desired borrow rate when utilization is at second kink. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 7% at second kink then rateAtUtilizationKink would be 1_200
rate_at_utilization_maxu128@param rateAtUtilizationMax desired borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500

TokenConfig#

From the program's IDL:

@notice struct to set token config

Struct types::TokenConfig.

FieldTypeDescription
tokenPubkey@param token address
feeu128@param fee charges on borrower's interest. in 1e2: 100% = 10_000; 1% = 100
max_utilizationu128@param maxUtilization maximum allowed utilization. in 1e2: 100% = 10_000; 1% = 100 set to 100% to disable and have default limit of 100% (avoiding SLOAD).

TransferType#

Enum types::TransferType.

Variant
SKIP
DIRECT
CLAIM

UserBorrowConfig#

From the program's IDL:

@notice struct to set user borrow & payback config

Struct types::UserBorrowConfig.

FieldTypeDescription
modeu8@param mode: 0 = without interest. 1 = with interest
expand_percentu128@param expandPercent debt limit expand percent. in 1e2: 100% = 10_000; 1% = 100 Also used to calculate rate at which debt limit should decrease (instant).
expand_durationu128@param expandDuration debt limit expand duration in seconds. used to calculate rate together with expandPercent
base_debt_ceilingu128@param baseDebtCeiling base borrow limit. until here, borrow limit remains as baseDebtCeiling (user can borrow until this point at once without stepped expansion). Above this, automated limit comes in place. amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: with interest -> raw, without interest -> normal
max_debt_ceilingu128@param maxDebtCeiling max borrow ceiling, maximum amount the user can borrow. amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: with interest -> raw, without interest -> normal

UserClass#

Struct types::UserClass.

FieldType
addrPubkey
classu8

UserSupplyConfig#

From the program's IDL:

@notice struct to set user supply & withdrawal config

Struct types::UserSupplyConfig.

FieldTypeDescription
modeu8@param mode: 0 = without interest. 1 = with interest
expand_percentu128@param expandPercent withdrawal limit expand percent. in 1e2: 100% = 10_000; 1% = 100 Also used to calculate rate at which withdrawal limit should decrease (instant).
expand_durationu128@param expandDuration withdrawal limit expand duration in seconds. used to calculate rate together with expandPercent
base_withdrawal_limitu128@param baseWithdrawalLimit base limit, below this, user can withdraw the entire amount. amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: with interest -> raw, without interest -> normal

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

Your endpoints

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