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.
| Crate | carbon-jupiter-lend-decoder 2.0.0 |
| Install | cargo add carbon-jupiter-lend-decoder@2. |
| Program ID | jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC (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-jupiter-lend-decoder/2.0.0 |
| Source | decoders/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:
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/fulluse {
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(())
}
}RUST_LOG=info cargo runEach 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:: (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 AuthorizationList 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_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(())
}
}RUST_LOG=info cargo runEach 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::, 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
jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC. - 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.
ChangeStatus#
Discriminator ec9183e4e311c0ff · data ChangeStatus · accounts ChangeStatusInstructionAccounts.
| Field | Type |
|---|---|
status | bool |
Required accounts: 3; extras go to remaining.
Fields of ChangeStatusInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | auth_list | Pubkey |
| 3… | remaining | Vec< |
Claim#
Discriminator 3ec6d6c1d59f6cd2 · data Claim · accounts ClaimInstructionAccounts.
| Field | Type |
|---|---|
recipient | Pubkey |
Required accounts: 9; extras go to remaining.
Fields of ClaimInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | token_ | Pubkey |
| 3 | mint | Pubkey |
| 4 | recipient_ | Pubkey |
| 5 | vault | Pubkey |
| 6 | claim_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | associated_ | Pubkey |
| 9… | remaining | Vec< |
CloseClaimAccount#
Discriminator f192cbd83ade5b76 · data CloseClaimAccount · accounts CloseClaimAccountInstructionAccounts.
| Field | Type |
|---|---|
mint | Pubkey |
Required accounts: 3; extras go to remaining.
Fields of CloseClaimAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user | Pubkey |
| 1 | claim_ | Pubkey |
| 2 | system_ | Pubkey |
| 3… | remaining | Vec< |
CollectRevenue#
Discriminator 5760d324f02bf657 · data CollectRevenue · accounts CollectRevenueInstructionAccounts.
No data fields.
Required accounts: 11; extras go to remaining.
Fields of CollectRevenueInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | auth_list | Pubkey |
| 3 | mint | Pubkey |
| 4 | revenue_ | Pubkey |
| 5 | revenue_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | vault | Pubkey |
| 8 | token_ | Pubkey |
| 9 | associated_ | Pubkey |
| 10 | system_ | Pubkey |
| 11… | remaining | Vec< |
InitClaimAccount#
Discriminator 708d2faa2a639091 · data InitClaimAccount · accounts InitClaimAccountInstructionAccounts.
| Field | Type |
|---|---|
mint | Pubkey |
user | Pubkey |
Required accounts: 3; extras go to remaining.
Fields of InitClaimAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | claim_ | Pubkey |
| 2 | system_ | Pubkey |
| 3… | remaining | Vec< |
InitLiquidity#
Discriminator 5fbdd8b7bc3ef46c · data InitLiquidity · accounts InitLiquidityInstructionAccounts.
| Field | Type |
|---|---|
authority | Pubkey |
revenue_ | Pubkey |
Required accounts: 4; extras go to remaining.
Fields of InitLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | auth_list | Pubkey |
| 3 | system_ | Pubkey |
| 4… | remaining | Vec< |
InitNewProtocol#
Discriminator c19305208a87d59e · data InitNewProtocol · accounts InitNewProtocolInstructionAccounts.
| Field | Type |
|---|---|
supply_mint | Pubkey |
borrow_mint | Pubkey |
protocol | Pubkey |
Required accounts: 5; extras go to remaining.
Fields of InitNewProtocolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | auth_list | Pubkey |
| 2 | user_ | Pubkey |
| 3 | user_ | Pubkey |
| 4 | system_ | Pubkey |
| 5… | remaining | Vec< |
InitTokenReserve#
Discriminator e4eb41819f0f0654 · data InitTokenReserve · accounts InitTokenReserveInstructionAccounts.
No data fields.
Required accounts: 10; extras go to remaining.
Fields of InitTokenReserveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | auth_list | Pubkey |
| 3 | mint | Pubkey |
| 4 | vault | Pubkey |
| 5 | rate_model | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | associated_ | Pubkey |
| 9 | system_ | Pubkey |
| 10… | remaining | Vec< |
Operate#
Discriminator d96ad06374972a87 · data Operate · accounts OperateInstructionAccounts.
| Field | Type |
|---|---|
supply_ | i128 |
borrow_ | i128 |
withdraw_to | Pubkey |
borrow_to | Pubkey |
transfer_ | TransferType |
Required accounts: 14; extras go to remaining.
Fields of OperateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | protocol | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | token_ | Pubkey |
| 3 | mint | Pubkey |
| 4 | vault | Pubkey |
| 5 | user_ | Option< |
| 6 | user_ | Option< |
| 7 | rate_model | Pubkey |
| 8 | withdraw_ | Option< |
| 9 | borrow_ | Option< |
| 10 | borrow_ | Option< |
| 11 | withdraw_ | Option< |
| 12 | token_ | Pubkey |
| 13 | associated_ | Pubkey |
| 14… | remaining | Vec< |
PauseUser#
Discriminator 123f2b5eef35650e · data PauseUser · accounts PauseUserInstructionAccounts.
| Field | Type |
|---|---|
protocol | Pubkey |
supply_mint | Pubkey |
borrow_mint | Pubkey |
supply_ | Option<u8> |
borrow_ | Option<u8> |
Required accounts: 4; extras go to remaining.
Fields of PauseUserInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | auth_list | Pubkey |
| 2 | user_ | Pubkey |
| 3 | user_ | Pubkey |
| 4… | remaining | Vec< |
PreOperate#
Discriminator 81cd9e9bc69b4885 · data PreOperate · accounts PreOperateInstructionAccounts.
| Field | Type |
|---|---|
mint | Pubkey |
Required accounts: 8; extras go to remaining.
Fields of PreOperateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | protocol | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | user_ | Option< |
| 3 | user_ | Option< |
| 4 | vault | Pubkey |
| 5 | token_ | Pubkey |
| 6 | associated_ | Pubkey |
| 7 | token_ | Pubkey |
| 8… | remaining | Vec< |
UnpauseUser#
Discriminator 477380fcb67eea3e · data UnpauseUser · accounts UnpauseUserInstructionAccounts.
| Field | Type |
|---|---|
protocol | Pubkey |
supply_mint | Pubkey |
borrow_mint | Pubkey |
supply_ | Option<u8> |
borrow_ | Option<u8> |
Required accounts: 4; extras go to remaining.
Fields of UnpauseUserInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | auth_list | Pubkey |
| 2 | user_ | Pubkey |
| 3 | user_ | Pubkey |
| 4… | remaining | Vec< |
UpdateAuthority#
Discriminator 202e401c954bf358 · data UpdateAuthority · accounts UpdateAuthorityInstructionAccounts.
| Field | Type |
|---|---|
new_ | Pubkey |
Required accounts: 3; extras go to remaining.
Fields of UpdateAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | auth_list | Pubkey |
| 3… | remaining | Vec< |
UpdateAuths#
Discriminator 5d60b29c3975fdd1 · data UpdateAuths · accounts UpdateAuthsInstructionAccounts.
| Field | Type |
|---|---|
auth_status | Vec< |
Required accounts: 3; extras go to remaining.
Fields of UpdateAuthsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | auth_list | Pubkey |
| 3… | remaining | Vec< |
UpdateExchangePrice#
Discriminator eff40af874193596 · data UpdateExchangePrice · accounts UpdateExchangePriceInstructionAccounts.
| Field | Type |
|---|---|
mint | Pubkey |
Required accounts: 2; extras go to remaining.
Fields of UpdateExchangePriceInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | rate_model | Pubkey |
| 2… | remaining | Vec< |
UpdateGuardians#
Discriminator 2b3efa8a8d758461 · data UpdateGuardians · accounts UpdateGuardiansInstructionAccounts.
| Field | Type |
|---|---|
guardian_ | Vec< |
Required accounts: 3; extras go to remaining.
Fields of UpdateGuardiansInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | liquidity | Pubkey |
| 2 | auth_list | Pubkey |
| 3… | remaining | Vec< |
UpdateRateDataV1#
Discriminator 0614227a1696b416 · data UpdateRateDataV1 · accounts UpdateRateDataV1InstructionAccounts.
| Field | Type |
|---|---|
rate_data | RateDataV1Params |
Required accounts: 5; extras go to remaining.
Fields of UpdateRateDataV1InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | auth_list | Pubkey |
| 2 | rate_model | Pubkey |
| 3 | mint | Pubkey |
| 4 | token_ | Pubkey |
| 5… | remaining | Vec< |
UpdateRateDataV2#
Discriminator 74493592d82de47c · data UpdateRateDataV2 · accounts UpdateRateDataV2InstructionAccounts.
| Field | Type |
|---|---|
rate_data | RateDataV2Params |
Required accounts: 5; extras go to remaining.
Fields of UpdateRateDataV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | auth_list | Pubkey |
| 2 | rate_model | Pubkey |
| 3 | mint | Pubkey |
| 4 | token_ | Pubkey |
| 5… | remaining | Vec< |
UpdateRevenueCollector#
Discriminator a78e7cf0dc718d3b · data UpdateRevenueCollector · accounts UpdateRevenueCollectorInstructionAccounts.
| Field | Type |
|---|---|
revenue_ | Pubkey |
Required accounts: 2; extras go to remaining.
Fields of UpdateRevenueCollectorInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | liquidity | Pubkey |
| 2… | remaining | Vec< |
UpdateTokenConfig#
Discriminator e77ab54fff4f90a7 · data UpdateTokenConfig · accounts UpdateTokenConfigInstructionAccounts.
| Field | Type |
|---|---|
token_ | TokenConfig |
Required accounts: 5; extras go to remaining.
Fields of UpdateTokenConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | auth_list | Pubkey |
| 2 | rate_model | Pubkey |
| 3 | mint | Pubkey |
| 4 | token_ | Pubkey |
| 5… | remaining | Vec< |
UpdateUserBorrowConfig#
Discriminator 64b0c9aef70236a8 · data UpdateUserBorrowConfig · accounts UpdateUserBorrowConfigInstructionAccounts.
| Field | Type |
|---|---|
user_ | UserBorrowConfig |
Required accounts: 7; extras go to remaining.
Fields of UpdateUserBorrowConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | protocol | Pubkey |
| 2 | auth_list | Pubkey |
| 3 | rate_model | Pubkey |
| 4 | mint | Pubkey |
| 5 | token_ | Pubkey |
| 6 | user_ | Pubkey |
| 7… | remaining | Vec< |
UpdateUserClass#
Discriminator 0cce44873fd43077 · data UpdateUserClass · accounts UpdateUserClassInstructionAccounts.
| Field | Type |
|---|---|
user_class | Vec< |
Required accounts: 2; extras go to remaining.
Fields of UpdateUserClassInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | auth_list | Pubkey |
| 2… | remaining | Vec< |
UpdateUserSupplyConfig#
Discriminator d9efe1da2131eab7 · data UpdateUserSupplyConfig · accounts UpdateUserSupplyConfigInstructionAccounts.
| Field | Type |
|---|---|
user_ | UserSupplyConfig |
Required accounts: 7; extras go to remaining.
Fields of UpdateUserSupplyConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | protocol | Pubkey |
| 2 | auth_list | Pubkey |
| 3 | rate_model | Pubkey |
| 4 | mint | Pubkey |
| 5 | token_ | Pubkey |
| 6 | user_ | Pubkey |
| 7… | remaining | Vec< |
UpdateUserWithdrawalLimit#
Discriminator a209ba09d51ead4e · data UpdateUserWithdrawalLimit · accounts UpdateUserWithdrawalLimitInstructionAccounts.
| Field | Type |
|---|---|
new_limit | u128 |
protocol | Pubkey |
mint | Pubkey |
Required accounts: 3; extras go to remaining.
Fields of UpdateUserWithdrawalLimitInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | authority | Pubkey |
| 1 | auth_list | Pubkey |
| 2 | user_ | Pubkey |
| 3… | 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 JupiterLendAccount. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
AuthorizationList#
Discriminator 139d752beca7fb45 · accounts::.
| Field | Type |
|---|---|
auth_users | Vec<Pubkey> |
guardians | Vec<Pubkey> |
user_ | Vec< |
Liquidity#
Discriminator 36fcf9e289ac793a · accounts::.
| Field | Type |
|---|---|
authority | Pubkey |
revenue_ | Pubkey |
status | bool |
bump | u8 |
RateModel#
Discriminator 5e03cbdb6b8904a2 · accounts::.
| Field | Type |
|---|---|
mint | Pubkey |
version | u8 |
rate_ | u16 |
kink1_ | u16 |
rate_ | u16 |
rate_at_max | u16 |
kink2_ | u16 |
rate_ | u16 |
TokenReserve#
Discriminator 15123b8778141f0c · accounts::.
| Field | Type |
|---|---|
mint | Pubkey |
vault | Pubkey |
borrow_rate | u16 |
fee_ | u16 |
last_ | u16 |
last_ | u64 |
supply_ | u64 |
borrow_ | u64 |
max_ | u16 |
total_ | u64 |
total_ | u64 |
total_ | u64 |
total_ | u64 |
total_ | u64 |
interacting_ | Pubkey |
interacting_ | u64 |
interacting_ | u64 |
UserBorrowPosition#
Discriminator 497e417bdc7ec518 · accounts::.
| Field | Type |
|---|---|
protocol | Pubkey |
mint | Pubkey |
with_ | u8 |
amount | u64 |
debt_ | u64 |
last_update | u64 |
expand_pct | u16 |
expand_ | u32 |
base_ | u64 |
max_ | u64 |
status | u8 |
UserClaim#
Discriminator e48ec3b5e49320d1 · accounts::.
| Field | Type |
|---|---|
user | Pubkey |
amount | u64 |
mint | Pubkey |
UserSupplyPosition#
Discriminator cadb88763db11592 · accounts::.
| Field | Type |
|---|---|
protocol | Pubkey |
mint | Pubkey |
with_ | u8 |
amount | u64 |
withdrawal_ | u128 |
last_update | u64 |
expand_pct | u16 |
expand_ | u64 |
base_ | u64 |
status | u8 |
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.
LogBorrowRateCap#
Discriminator 9c83e85efe9c0e75 · events::.
| Field | Type |
|---|---|
token | Pubkey |
LogChangeStatus#
Discriminator 594d25ac8d1f4a2a · events::.
| Field | Type |
|---|---|
new_status | bool |
LogClaim#
Discriminator ee329d55973ae72d · events::.
| Field | Type |
|---|---|
user | Pubkey |
token | Pubkey |
recipient | Pubkey |
amount | u64 |
LogCollectRevenue#
Discriminator 40c616c27b57a652 · events::.
| Field | Type |
|---|---|
token | Pubkey |
revenue_ | u128 |
LogOperate#
Discriminator b40851471384ad08 · events::.
| Field | Type |
|---|---|
user | Pubkey |
token | Pubkey |
supply_ | i128 |
borrow_ | i128 |
withdraw_to | Pubkey |
borrow_to | Pubkey |
supply_ | u64 |
borrow_ | u64 |
LogPauseUser#
Discriminator 641172e0b41e34aa · events::.
| Field | Type |
|---|---|
user | Pubkey |
mint | Pubkey |
status | u8 |
LogUnpauseUser#
Discriminator aa5b8460b34da81a · events::.
| Field | Type |
|---|---|
user | Pubkey |
mint | Pubkey |
status | u8 |
LogUpdateAuthority#
Discriminator 96989d8f0687c165 · events::.
| Field | Type |
|---|---|
new_ | Pubkey |
LogUpdateAuths#
Discriminator 58506d306fcb4cfb · events::.
| Field | Type |
|---|---|
auth_status | Vec< |
LogUpdateExchangePrices#
Discriminator bec245cc1e56b5a3 · events::.
| Field | Type |
|---|---|
token | Pubkey |
supply_ | u128 |
borrow_ | u128 |
borrow_rate | u16 |
utilization | u16 |
LogUpdateGuardians#
Discriminator e71cbf33358c4f8e · events::.
| Field | Type |
|---|---|
guardian_ | Vec< |
LogUpdateRateDataV1#
Discriminator 1e6683c0001e55df · events::.
| Field | Type |
|---|---|
token | Pubkey |
rate_data | RateDataV1Params |
LogUpdateRateDataV2#
Discriminator ce35c34671d35c81 · events::.
| Field | Type |
|---|---|
token | Pubkey |
rate_data | RateDataV2Params |
LogUpdateRevenueCollector#
Discriminator 2c8f50fad393b49f · events::.
| Field | Type |
|---|---|
revenue_ | Pubkey |
LogUpdateTokenConfigs#
Discriminator 18cdbf822f28e9da · events::.
| Field | Type |
|---|---|
token_ | TokenConfig |
LogUpdateUserBorrowConfigs#
Discriminator d2fbf29fcd219a4a · events::.
| Field | Type |
|---|---|
user | Pubkey |
token | Pubkey |
user_ | UserBorrowConfig |
LogUpdateUserClass#
Discriminator b9c16af80b350088 · events::.
| Field | Type |
|---|---|
user_class | Vec< |
LogUpdateUserSupplyConfigs#
Discriminator 8ea0155a57581233 · events::.
| Field | Type |
|---|---|
user | Pubkey |
token | Pubkey |
user_ | UserSupplyConfig |
LogUpdateUserWithdrawalLimit#
Discriminator 728398bd78fd5869 · events::.
| Field | Type |
|---|---|
user | Pubkey |
token | Pubkey |
new_limit | u128 |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
AddressBool#
Struct types::.
| Field | Type |
|---|---|
addr | Pubkey |
value | bool |
AddressU8#
Struct types::.
| Field | Type |
|---|---|
addr | Pubkey |
value | u8 |
LogBorrowRateCap#
Struct types::. Same fields as the LogBorrowRateCap event.
LogChangeStatus#
Struct types::. Same fields as the LogChangeStatus event.
LogClaim#
Struct types::. Same fields as the LogClaim event.
LogCollectRevenue#
Struct types::. Same fields as the LogCollectRevenue event.
LogOperate#
Struct types::. Same fields as the LogOperate event.
LogPauseUser#
Struct types::. Same fields as the LogPauseUser event.
LogUnpauseUser#
Struct types::. Same fields as the LogUnpauseUser event.
LogUpdateAuthority#
Struct types::. Same fields as the LogUpdateAuthority event.
LogUpdateAuths#
Struct types::. Same fields as the LogUpdateAuths event.
LogUpdateExchangePrices#
Struct types::. Same fields as the LogUpdateExchangePrices event.
LogUpdateGuardians#
Struct types::. Same fields as the LogUpdateGuardians event.
LogUpdateRateDataV1#
Struct types::. Same fields as the LogUpdateRateDataV1 event.
LogUpdateRateDataV2#
Struct types::. Same fields as the LogUpdateRateDataV2 event.
LogUpdateRevenueCollector#
Struct types::. Same fields as the LogUpdateRevenueCollector event.
LogUpdateTokenConfigs#
Struct types::. Same fields as the LogUpdateTokenConfigs event.
LogUpdateUserBorrowConfigs#
Struct types::. Same fields as the LogUpdateUserBorrowConfigs event.
LogUpdateUserClass#
Struct types::. Same fields as the LogUpdateUserClass event.
LogUpdateUserSupplyConfigs#
Struct types::. Same fields as the LogUpdateUserSupplyConfigs event.
LogUpdateUserWithdrawalLimit#
Struct types::. Same fields as the LogUpdateUserWithdrawalLimit event.
RateDataV1Params#
From the program's IDL:
@notice struct to set borrow rate data for version 1
Struct types::.
| Field | Type | Description |
|---|---|---|
kink | u128 | @param kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100 |
rate_ | u128 | @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_ | u128 | @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_ | u128 | @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::.
| Field | Type | Description |
|---|---|---|
kink1 | u128 | @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 |
kink2 | u128 | @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_ | u128 | @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_ | u128 | @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_ | u128 | @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_ | u128 | @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::.
| Field | Type | Description |
|---|---|---|
token | Pubkey | @param token address |
fee | u128 | @param fee charges on borrower's interest. in 1e2: 100% = 10_000; 1% = 100 |
max_ | u128 | @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::.
| Variant |
|---|
SKIP |
DIRECT |
CLAIM |
UserBorrowConfig#
From the program's IDL:
@notice struct to set user borrow & payback config
Struct types::.
| Field | Type | Description |
|---|---|---|
mode | u8 | @param mode: 0 = without interest. 1 = with interest |
expand_ | u128 | @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_ | u128 | @param expandDuration debt limit expand duration in seconds. used to calculate rate together with expandPercent |
base_ | u128 | @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_ | u128 | @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::.
| Field | Type |
|---|---|
addr | Pubkey |
class | u8 |
UserSupplyConfig#
From the program's IDL:
@notice struct to set user supply & withdrawal config
Struct types::.
| Field | Type | Description |
|---|---|---|
mode | u8 | @param mode: 0 = without interest. 1 = with interest |
expand_ | u128 | @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_ | u128 | @param expandDuration withdrawal limit expand duration in seconds. used to calculate rate together with expandPercent |
base_ | u128 | @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 |