Skip to main content

Reserve

Struct Reserve 

Source
#[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

Source

pub fn available_liquidity(&self) -> u64

Total available (unborrowed) liquidity in native token units.

Source

pub fn borrowed_amount(&self) -> u128

Total borrowed amount as a raw u128 scaled fraction.

Source

pub fn market_price(&self) -> u128

Market price of the reserve token as a raw u128 scaled fraction.

Source

pub fn mint_decimals(&self) -> u64

Decimals of the liquidity mint.

Source

pub fn collateral_total_supply(&self) -> u64

Total supply of collateral tokens (cTokens).

Source

pub fn accumulated_protocol_fees(&self) -> u128

Accumulated protocol fees as a raw u128 scaled fraction.

Source

pub fn accumulated_referrer_fees(&self) -> u128

Accumulated referrer fees as a raw u128 scaled fraction.

Source

pub fn status(&self) -> u8

Reserve status: 0 = Active, 1 = Obsolete, 2 = Hidden.

Source

pub fn is_emergency_mode(&self) -> bool

Whether the reserve is in emergency mode.

Source

pub fn loan_to_value_pct(&self) -> u8

Loan-to-value percentage.

Source

pub fn liquidation_threshold_pct(&self) -> u8

Liquidation threshold percentage.

Source

pub fn borrow_factor_pct(&self) -> u64

Borrow factor percentage (100 = 1x).

Source

pub fn deposit_limit(&self) -> u64

Deposit limit in native token units.

Source

pub fn borrow_limit(&self) -> u64

Borrow limit in native token units.

Source

pub fn next_withdraw_ticket_sequence_number(&self) -> u64

Next sequence number for withdraw tickets.

Trait Implementations§

Source§

impl Clone for Reserve

Source§

fn clone(&self) -> Reserve

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 Reserve

Source§

impl Debug for Reserve

Source§

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

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

impl Pod for Reserve

Source§

impl SplDiscriminate for Reserve

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 Reserve

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.