#[repr(C)]pub struct Reserve {Show 15 fields
pub version: u64,
pub last_update: LastUpdate,
pub lending_market: Pubkey,
pub farm_collateral: Pubkey,
pub farm_debt: Pubkey,
pub liquidity: ReserveLiquidity,
pub reserve_liquidity_padding: [u64; 150],
pub collateral: ReserveCollateral,
pub reserve_collateral_padding: [u64; 150],
pub config: ReserveConfig,
pub config_padding: [u64; 112],
pub borrowed_amount_outside_elevation_group: u64,
pub borrowed_amounts_against_this_reserve_in_elevation_groups: [u64; 32],
pub withdraw_queue: WithdrawQueue,
pub padding: [u64; 204],
}Expand description
Lending reserve account state.
Fields§
§version: u64§last_update: LastUpdate§lending_market: Pubkey§farm_collateral: Pubkey§farm_debt: Pubkey§liquidity: ReserveLiquidity§reserve_liquidity_padding: [u64; 150]§collateral: ReserveCollateral§reserve_collateral_padding: [u64; 150]§config: ReserveConfig§config_padding: [u64; 112]§borrowed_amount_outside_elevation_group: u64§borrowed_amounts_against_this_reserve_in_elevation_groups: [u64; 32]§withdraw_queue: WithdrawQueue§padding: [u64; 204]Implementations§
Source§impl Reserve
impl Reserve
Sourcepub fn available_liquidity(&self) -> u64
pub fn available_liquidity(&self) -> u64
Total available (unborrowed) liquidity in native token units.
Sourcepub fn borrowed_amount(&self) -> u128
pub fn borrowed_amount(&self) -> u128
Total borrowed amount as a raw u128 scaled fraction.
Sourcepub fn market_price(&self) -> u128
pub fn market_price(&self) -> u128
Market price of the reserve token as a raw u128 scaled fraction.
Sourcepub fn mint_decimals(&self) -> u64
pub fn mint_decimals(&self) -> u64
Decimals of the liquidity mint.
Sourcepub fn collateral_total_supply(&self) -> u64
pub fn collateral_total_supply(&self) -> u64
Total supply of collateral tokens (cTokens).
Sourcepub fn accumulated_protocol_fees(&self) -> u128
pub fn accumulated_protocol_fees(&self) -> u128
Accumulated protocol fees as a raw u128 scaled fraction.
Sourcepub fn accumulated_referrer_fees(&self) -> u128
pub fn accumulated_referrer_fees(&self) -> u128
Accumulated referrer fees as a raw u128 scaled fraction.
Sourcepub fn is_emergency_mode(&self) -> bool
pub fn is_emergency_mode(&self) -> bool
Whether the reserve is in emergency mode.
Sourcepub fn loan_to_value_pct(&self) -> u8
pub fn loan_to_value_pct(&self) -> u8
Loan-to-value percentage.
Sourcepub fn liquidation_threshold_pct(&self) -> u8
pub fn liquidation_threshold_pct(&self) -> u8
Liquidation threshold percentage.
Sourcepub fn borrow_factor_pct(&self) -> u64
pub fn borrow_factor_pct(&self) -> u64
Borrow factor percentage (100 = 1x).
Sourcepub fn deposit_limit(&self) -> u64
pub fn deposit_limit(&self) -> u64
Deposit limit in native token units.
Sourcepub fn borrow_limit(&self) -> u64
pub fn borrow_limit(&self) -> u64
Borrow limit in native token units.
Sourcepub fn next_withdraw_ticket_sequence_number(&self) -> u64
pub fn next_withdraw_ticket_sequence_number(&self) -> u64
Next sequence number for withdraw tickets.
Trait Implementations§
impl Copy for Reserve
impl Pod for Reserve
Source§impl SplDiscriminate for Reserve
impl SplDiscriminate for Reserve
Source§const SPL_DISCRIMINATOR: ArrayDiscriminator
const SPL_DISCRIMINATOR: ArrayDiscriminator
The 8-byte discriminator as a
[u8; 8]Source§const SPL_DISCRIMINATOR_SLICE: &'static [u8] = _
const SPL_DISCRIMINATOR_SLICE: &'static [u8] = _
The 8-byte discriminator as a slice (
&[u8])Auto Trait Implementations§
impl Freeze for Reserve
impl RefUnwindSafe for Reserve
impl Send for Reserve
impl Sync for Reserve
impl Unpin for Reserve
impl UnsafeUnpin for Reserve
impl UnwindSafe for Reserve
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
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
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 Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
impl<T> NoUninit for Twhere
T: Pod,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.