Kamino Vault decoder
Decode Kamino Vault instructions and accounts in Rust with carbon-kamino-vault-decoder 2.0.0. Program ID kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr.
On this page
carbon-kamino-vault-decoder decodes the instructions and accounts of the Kamino Vault program (kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr): 12 instructions, 2 account types. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.
| Crate | carbon-kamino-vault-decoder 2.0.0 |
| Install | cargo add carbon-kamino-vault-decoder@2. |
| Program ID | kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr (carbon_) |
| Category | Lending |
| Decoder | carbon_ |
| Instruction enum | instructions:: |
| Account enum | accounts:: |
| Features | serde, postgres, graphql (none enabled by default) |
| API docs | docs.rs/carbon-kamino-vault-decoder/2.0.0 |
| Source | decoders/kamino-vault-decoder |
Other lending decoders: Jupiter Lend, Kamino Lending, 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 Vault transactions from the public RPC and prints every decoded Deposit instruction. Add the dependencies:
cargo add carbon-core@2.0.0 carbon-kamino-vault-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_vault_decoder::{
instructions::KaminoVaultInstruction, KaminoVaultDecoder, 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(KaminoVaultDecoder, InstructionLogger)
.build()?
.run()
.await
}
struct InstructionLogger;
impl Processor<InstructionProcessorInputType<'_, KaminoVaultInstruction>> for InstructionLogger {
async fn process(
&mut self,
input: &InstructionProcessorInputType<'_, KaminoVaultInstruction>,
) -> CarbonResult<()> {
let signature = input.metadata.transaction_metadata.signature;
if let KaminoVaultInstruction::Deposit { data, accounts, .. } = input.decoded_instruction {
println!("deposit {signature}: {data:?} user={}", accounts.user);
}
Ok(())
}
}RUST_LOG=info cargo runEach Deposit instruction prints one line with the transaction signature and the decoded Deposit 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.
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_vault_decoder::{accounts::KaminoVaultAccount, KaminoVaultDecoder, 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(KaminoVaultDecoder, AccountLogger)
.build()?
.run()
.await
}
struct AccountLogger;
impl Processor<AccountProcessorInputType<'_, KaminoVaultAccount>> for AccountLogger {
async fn process(
&mut self,
input: &AccountProcessorInputType<'_, KaminoVaultAccount>,
) -> CarbonResult<()> {
if let KaminoVaultAccount::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 KaminoVaultInstruction. Each is KaminoVaultInstruction::, 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
kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr. - 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.
Deposit#
Discriminator f223c68952e1f2b6 · data Deposit · accounts DepositInstructionAccounts.
| Field | Type |
|---|---|
max_amount | u64 |
Required accounts: 11; extras go to remaining.
Fields of DepositInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | token_vault | Pubkey |
| 3 | token_mint | Pubkey |
| 4 | base_ | Pubkey |
| 5 | shares_mint | Pubkey |
| 6 | user_ | Pubkey |
| 7 | user_ | Pubkey |
| 8 | klend_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | shares_ | Pubkey |
| 11… | remaining | Vec< |
GiveUpPendingFees#
Discriminator b1c878866ed99351 · data GiveUpPendingFees · accounts GiveUpPendingFeesInstructionAccounts.
| Field | Type |
|---|---|
max_ | u64 |
Required accounts: 3; extras go to remaining.
Fields of GiveUpPendingFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | vault_ | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | klend_ | Pubkey |
| 3… | remaining | Vec< |
InitializeSharesMetadata#
Discriminator 030fac72c8008320 · data InitializeSharesMetadata · accounts InitializeSharesMetadataInstructionAccounts.
| Field | Type |
|---|---|
name | String |
symbol | String |
uri | String |
Required accounts: 8; extras go to remaining.
Fields of InitializeSharesMetadataInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | vault_ | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | shares_mint | Pubkey |
| 3 | base_ | Pubkey |
| 4 | shares_ | Pubkey |
| 5 | system_ | Pubkey |
| 6 | rent | Pubkey |
| 7 | metadata_ | Pubkey |
| 8… | remaining | Vec< |
InitVault#
Discriminator 4d4f559621d9346a · data InitVault · accounts InitVaultInstructionAccounts.
No data fields.
Required accounts: 11; extras go to remaining.
Fields of InitVaultInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | admin_ | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | base_ | Pubkey |
| 3 | token_vault | Pubkey |
| 4 | base_ | Pubkey |
| 5 | shares_mint | Pubkey |
| 6 | admin_ | Pubkey |
| 7 | system_ | Pubkey |
| 8 | rent | Pubkey |
| 9 | token_ | Pubkey |
| 10 | shares_ | Pubkey |
| 11… | remaining | Vec< |
Invest#
Discriminator 0df5b467feb67904 · data Invest · accounts InvestInstructionAccounts.
No data fields.
Required accounts: 16; extras go to remaining.
Fields of InvestInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | payer | Pubkey |
| 1 | payer_ | Pubkey |
| 2 | vault_state | Pubkey |
| 3 | token_vault | Pubkey |
| 4 | token_mint | Pubkey |
| 5 | base_ | Pubkey |
| 6 | ctoken_ | Pubkey |
| 7 | reserve | Pubkey |
| 8 | lending_ | Pubkey |
| 9 | lending_ | Pubkey |
| 10 | reserve_ | Pubkey |
| 11 | reserve_ | Pubkey |
| 12 | klend_ | Pubkey |
| 13 | reserve_ | Pubkey |
| 14 | token_ | Pubkey |
| 15 | instruction_ | Pubkey |
| 16… | remaining | Vec< |
UpdateAdmin#
Discriminator a1b028d53cb8b3e4 · data UpdateAdmin · accounts UpdateAdminInstructionAccounts.
No data fields.
Required accounts: 2; extras go to remaining.
Fields of UpdateAdminInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pending_ | Pubkey |
| 1 | vault_state | Pubkey |
| 2… | remaining | Vec< |
UpdateReserveAllocation#
Discriminator 0536d5704be87525 · data UpdateReserveAllocation · accounts UpdateReserveAllocationInstructionAccounts.
| Field | Type |
|---|---|
weight | u64 |
cap | u64 |
Required accounts: 9; extras go to remaining.
Fields of UpdateReserveAllocationInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | signer | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | base_ | Pubkey |
| 3 | reserve_ | Pubkey |
| 4 | reserve | Pubkey |
| 5 | ctoken_ | Pubkey |
| 6 | reserve_ | Pubkey |
| 7 | system_ | Pubkey |
| 8 | rent | Pubkey |
| 9… | remaining | Vec< |
UpdateSharesMetadata#
Discriminator 9b227aa5f589936b · data UpdateSharesMetadata · accounts UpdateSharesMetadataInstructionAccounts.
| Field | Type |
|---|---|
name | String |
symbol | String |
uri | String |
Required accounts: 5; extras go to remaining.
Fields of UpdateSharesMetadataInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | vault_ | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | base_ | Pubkey |
| 3 | shares_ | Pubkey |
| 4 | metadata_ | Pubkey |
| 5… | remaining | Vec< |
UpdateVaultConfig#
Discriminator 7a0315de9effee9d · data UpdateVaultConfig · accounts UpdateVaultConfigInstructionAccounts.
| Field | Type |
|---|---|
entry | VaultConfigField |
data | Vec<u8> |
Required accounts: 3; extras go to remaining.
Fields of UpdateVaultConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | vault_ | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | klend_ | Pubkey |
| 3… | remaining | Vec< |
Withdraw#
Discriminator b712469c946da122 · data Withdraw · accounts WithdrawInstructionAccounts.
| Field | Type |
|---|---|
shares_ | u64 |
Required accounts: 19; extras go to remaining.
Fields of WithdrawInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | token_vault | Pubkey |
| 3 | base_ | Pubkey |
| 4 | user_ | Pubkey |
| 5 | token_mint | Pubkey |
| 6 | user_ | Pubkey |
| 7 | shares_mint | Pubkey |
| 8 | token_ | Pubkey |
| 9 | shares_ | Pubkey |
| 10 | klend_ | Pubkey |
| 11 | reserve | Pubkey |
| 12 | ctoken_ | Pubkey |
| 13 | lending_ | Pubkey |
| 14 | lending_ | Pubkey |
| 15 | reserve_ | Pubkey |
| 16 | reserve_ | Pubkey |
| 17 | reserve_ | Pubkey |
| 18 | instruction_ | Pubkey |
| 19… | remaining | Vec< |
WithdrawFromAvailable#
Discriminator 1383709baadc2239 · data WithdrawFromAvailable · accounts WithdrawFromAvailableInstructionAccounts.
| Field | Type |
|---|---|
shares_ | u64 |
Required accounts: 11; extras go to remaining.
Fields of WithdrawFromAvailableInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | user | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | token_vault | Pubkey |
| 3 | base_ | Pubkey |
| 4 | user_ | Pubkey |
| 5 | token_mint | Pubkey |
| 6 | user_ | Pubkey |
| 7 | shares_mint | Pubkey |
| 8 | token_ | Pubkey |
| 9 | shares_ | Pubkey |
| 10 | klend_ | Pubkey |
| 11… | remaining | Vec< |
WithdrawPendingFees#
Discriminator 83c2c88caff4d9b7 · data WithdrawPendingFees · accounts WithdrawPendingFeesInstructionAccounts.
No data fields.
Required accounts: 16; extras go to remaining.
Fields of WithdrawPendingFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | vault_ | Pubkey |
| 1 | vault_state | Pubkey |
| 2 | reserve | Pubkey |
| 3 | token_vault | Pubkey |
| 4 | ctoken_ | Pubkey |
| 5 | base_ | Pubkey |
| 6 | token_ata | Pubkey |
| 7 | token_mint | Pubkey |
| 8 | lending_ | Pubkey |
| 9 | lending_ | Pubkey |
| 10 | reserve_ | Pubkey |
| 11 | reserve_ | Pubkey |
| 12 | klend_ | Pubkey |
| 13 | token_ | Pubkey |
| 14 | reserve_ | Pubkey |
| 15 | instruction_ | Pubkey |
| 16… | remaining | Vec< |
Accounts#
Variants of KaminoVaultAccount. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
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; 116] | |
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. |
padding | [u64; 207] |
VaultState#
Discriminator e4c452a562d2eb98 · accounts::.
| Field | Type |
|---|---|
vault_ | Pubkey |
base_ | Pubkey |
base_ | u64 |
token_mint | Pubkey |
token_ | u64 |
token_vault | Pubkey |
token_ | Pubkey |
shares_mint | Pubkey |
shares_ | u64 |
token_ | u64 |
shares_ | u64 |
available_ | u64 |
padding0 | u64 |
performance_ | u64 |
management_ | u64 |
last_ | u64 |
prev_aum_sf | u128 |
pending_ | u128 |
vault_ | [VaultAllocation; 10] |
min_ | u64 |
min_ | u64 |
min_ | u64 |
min_ | u64 |
crank_ | u64 |
pending_ | Pubkey |
cumulative_ | u128 |
cumulative_ | u128 |
cumulative_ | u128 |
name | [u8; 40] |
vault_ | Pubkey |
vault_farm | Pubkey |
creation_ | u64 |
padding1 | u64 |
allocation_ | Pubkey |
padding2 | [u128; 242] |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
BigFractionBytes#
Struct types::.
| Field | Type |
|---|---|
value | [u64; 4] |
padding | [u64; 2] |
BorrowRateCurve#
Struct types::.
| Field | Type |
|---|---|
points | [CurvePoint; 11] |
CurvePoint#
Struct types::.
| Field | Type |
|---|---|
utilization_ | u32 |
borrow_ | u32 |
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] |
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 |
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 |
asset_tier | u8 | Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt |
host_ | u16 | Flat rate that goes to the host |
reserved2 | [u8; 2] | [DEPRECATED] Boost for side (debt or collateral) |
reserved3 | [u8; 8] | [DEPRECATED] Reward points multiplier per obligation type |
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 (enabled by the risk council for individual obligations) is NOT affected by this flag. |
reserved1 | [u8; 1] | |
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. |
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 |
|---|---|---|
borrow_ | 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 borrow 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 |
available_ | u64 | Reserve liquidity available |
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 |
padding2 | [u64; 51] | |
padding3 | [u128; 32] |
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] |
VaultAllocation#
Struct types::.
| Field | Type | Description |
|---|---|---|
reserve | Pubkey | |
ctoken_ | Pubkey | |
target_ | u64 | |
token_ | u64 | Maximum token invested in this reserve |
ctoken_ | u64 | |
config_ | [u64; 127] | |
ctoken_ | u64 | |
last_ | u64 | |
token_ | u128 | |
state_ | [u64; 128] |
VaultConfigField#
Enum types::.
| Variant |
|---|
PerformanceFeeBps |
ManagementFeeBps |
MinDepositAmount |
MinWithdrawAmount |
MinInvestAmount |
MinInvestDelaySlots |
CrankFundFeePerReserve |
PendingVaultAdmin |
Name |
LookupTable |
Farm |
AllocationAdmin |
WithdrawalCaps#
From the program's IDL:
Reserve Withdrawal Caps State
Struct types::.
| Field | Type |
|---|---|
config_ | i64 |
current_ | i64 |
last_ | u64 |
config_ | u64 |