Skip to main content

LendingMarket

Struct LendingMarket 

Source
#[repr(C)]
pub struct LendingMarket {
Show 51 fields pub version: u64, pub bump_seed: u64, pub lending_market_owner: Pubkey, pub lending_market_owner_cached: Pubkey, pub quote_currency: [u8; 32], pub referral_fee_bps: u16, pub emergency_mode: u8, pub autodeleverage_enabled: u8, pub borrow_disabled: u8, pub price_refresh_trigger_to_max_age_pct: u8, pub liquidation_max_debt_close_factor_pct: u8, pub insolvency_risk_unhealthy_ltv_pct: u8, pub min_full_liquidation_value_threshold: u64, pub max_liquidatable_debt_market_value_at_once: u64, pub reserved0: [u8; 8], pub global_allowed_borrow_value: u64, pub emergency_council: Pubkey, pub reserved1: [u8; 8], pub elevation_groups: [ElevationGroup; 32], pub elevation_group_padding: [u64; 90], pub min_net_value_in_obligation_sf: PodU128, pub min_value_skip_liquidation_ltv_checks: u64, pub name: [u8; 32], pub min_value_skip_liquidation_bf_checks: u64, pub individual_autodeleverage_margin_call_period_secs: u64, pub min_initial_deposit_amount: u64, pub obligation_order_execution_enabled: u8, pub immutable: u8, pub obligation_order_creation_enabled: u8, pub price_triggered_liquidation_disabled: u8, pub mature_reserve_debt_liquidation_enabled: u8, pub obligation_borrow_debt_term_liquidation_enabled: u8, pub borrow_order_creation_enabled: u8, pub borrow_order_execution_enabled: u8, pub proposer_authority: Pubkey, pub min_borrow_order_fill_value: u64, pub withdraw_ticket_issuance_enabled: u8, pub withdraw_ticket_redemption_enabled: u8, pub obligation_borrow_rollover_configuration_enabled: u8, pub obligation_borrow_migration_to_fixed_execution_enabled: u8, pub withdraw_ticket_cancellation_enabled: u8, pub padding2: [u8; 1], pub reserve_rewards_max_apr_bps: u16, pub min_withdraw_queued_liquidity_value: u64, pub fixed_term_rollover_window_duration_seconds: u64, pub open_term_rollover_window_duration_seconds: u64, pub min_partial_rollover_value: u64, pub term_based_full_liquidation_duration_secs: u64, pub permissioning_authority: Pubkey, pub permissioned_ops: u64, pub padding1: [u64; 153],
}
Expand description

Lending market account state.

Fields§

§version: u64§bump_seed: u64§lending_market_owner: Pubkey§lending_market_owner_cached: Pubkey§quote_currency: [u8; 32]§referral_fee_bps: u16§emergency_mode: u8§autodeleverage_enabled: u8§borrow_disabled: u8§price_refresh_trigger_to_max_age_pct: u8§liquidation_max_debt_close_factor_pct: u8§insolvency_risk_unhealthy_ltv_pct: u8§min_full_liquidation_value_threshold: u64§max_liquidatable_debt_market_value_at_once: u64§reserved0: [u8; 8]§global_allowed_borrow_value: u64§emergency_council: Pubkey§reserved1: [u8; 8]§elevation_groups: [ElevationGroup; 32]§elevation_group_padding: [u64; 90]§min_net_value_in_obligation_sf: PodU128§min_value_skip_liquidation_ltv_checks: u64§name: [u8; 32]§min_value_skip_liquidation_bf_checks: u64§individual_autodeleverage_margin_call_period_secs: u64§min_initial_deposit_amount: u64§obligation_order_execution_enabled: u8§immutable: u8§obligation_order_creation_enabled: u8§price_triggered_liquidation_disabled: u8§mature_reserve_debt_liquidation_enabled: u8§obligation_borrow_debt_term_liquidation_enabled: u8§borrow_order_creation_enabled: u8§borrow_order_execution_enabled: u8§proposer_authority: Pubkey§min_borrow_order_fill_value: u64§withdraw_ticket_issuance_enabled: u8§withdraw_ticket_redemption_enabled: u8§obligation_borrow_rollover_configuration_enabled: u8§obligation_borrow_migration_to_fixed_execution_enabled: u8§withdraw_ticket_cancellation_enabled: u8§padding2: [u8; 1]§reserve_rewards_max_apr_bps: u16

Cap (in basis points; FULL_BPS = 10_000 = 100%) on reserve rewards distribution APR

§min_withdraw_queued_liquidity_value: u64§fixed_term_rollover_window_duration_seconds: u64§open_term_rollover_window_duration_seconds: u64§min_partial_rollover_value: u64§term_based_full_liquidation_duration_secs: u64§permissioning_authority: Pubkey§permissioned_ops: u64§padding1: [u64; 153]

Implementations§

Source§

impl LendingMarket

Source

pub fn is_emergency_mode(&self) -> bool

Whether the market is in emergency mode.

Source

pub fn is_borrow_disabled(&self) -> bool

Whether borrowing is globally disabled.

Source

pub fn is_autodeleverage_enabled(&self) -> bool

Whether autodeleverage is enabled.

Source

pub fn liquidation_max_debt_close_factor_pct(&self) -> u8

Max percentage of debt that can be closed in a single liquidation.

Source

pub fn min_full_liquidation_value_threshold(&self) -> u64

Minimum value threshold for full liquidation.

Source

pub fn max_liquidatable_debt_market_value_at_once(&self) -> u64

Maximum liquidatable debt market value at once.

Source

pub fn referral_fee_bps(&self) -> u16

Referral fee in basis points.

Source

pub fn elevation_group(&self, index: usize) -> Option<&ElevationGroup>

Get an elevation group by index (0-31). Returns None if out of bounds.

Source

pub fn is_immutable(&self) -> bool

Whether the market is immutable (no more config changes).

Source

pub fn is_withdraw_ticket_cancellation_enabled(&self) -> bool

Whether withdraw ticket cancellation is enabled.

Source

pub fn is_obligation_borrow_migration_to_fixed_execution_enabled(&self) -> bool

Whether migration-to-fixed rollover execution is enabled.

Trait Implementations§

Source§

impl Clone for LendingMarket

Source§

fn clone(&self) -> LendingMarket

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LendingMarket

Source§

impl Debug for LendingMarket

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Pod for LendingMarket

Source§

impl SplDiscriminate for LendingMarket

Source§

const SPL_DISCRIMINATOR: ArrayDiscriminator

The 8-byte discriminator as a [u8; 8]
Source§

const SPL_DISCRIMINATOR_SLICE: &'static [u8] = _

The 8-byte discriminator as a slice (&[u8])
Source§

impl Zeroable for LendingMarket

Source§

fn zeroed() -> Self

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> NoUninit for T
where T: Pod,

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.