pub struct ReserveInfo {
pub address: Pubkey,
pub lending_market: Pubkey,
pub liquidity_mint: Pubkey,
pub liquidity_token_program: Pubkey,
pub pyth_oracle: Option<Pubkey>,
pub switchboard_price_oracle: Option<Pubkey>,
pub switchboard_twap_oracle: Option<Pubkey>,
pub scope_prices: Option<Pubkey>,
}Expand description
On-chain reserve data that cannot be derived from PDAs.
The caller reads these fields from the deserialized Reserve account.
Reserve PDAs (supply vault, fee vault, collateral mint/supply) are derived
automatically by the helpers.
Fields§
§address: PubkeyReserve account address.
lending_market: PubkeyThe lending market this reserve belongs to.
liquidity_mint: PubkeySPL token mint for the reserve’s liquidity (e.g. USDC mint).
liquidity_token_program: PubkeyToken program for the liquidity mint (TOKEN_PROGRAM_ID or Token-2022).
pyth_oracle: Option<Pubkey>Pyth oracle, if configured for this reserve.
switchboard_price_oracle: Option<Pubkey>Switchboard price oracle, if configured.
switchboard_twap_oracle: Option<Pubkey>Switchboard TWAP oracle, if configured.
scope_prices: Option<Pubkey>Scope prices account, if configured.
Implementations§
Source§impl ReserveInfo
impl ReserveInfo
Sourcepub fn from_account_data(
address: Pubkey,
data: &[u8],
) -> Result<Self, AccountDataError>
pub fn from_account_data( address: Pubkey, data: &[u8], ) -> Result<Self, AccountDataError>
Build a ReserveInfo directly from raw on-chain account data bytes.
This deserializes the Reserve account and extracts the fields needed
by the helpers. Useful when working with raw RPC responses.
Sourcepub fn from_reserve(address: Pubkey, reserve: &Reserve) -> Self
pub fn from_reserve(address: Pubkey, reserve: &Reserve) -> Self
Build a ReserveInfo from a deserialized crate::state::Reserve account.
Trait Implementations§
Source§impl Clone for ReserveInfo
impl Clone for ReserveInfo
Source§fn clone(&self) -> ReserveInfo
fn clone(&self) -> ReserveInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReserveInfo
impl Debug for ReserveInfo
Source§impl PartialEq for ReserveInfo
impl PartialEq for ReserveInfo
impl Eq for ReserveInfo
impl StructuralPartialEq for ReserveInfo
Auto Trait Implementations§
impl Freeze for ReserveInfo
impl RefUnwindSafe for ReserveInfo
impl Send for ReserveInfo
impl Sync for ReserveInfo
impl Unpin for ReserveInfo
impl UnsafeUnpin for ReserveInfo
impl UnwindSafe for ReserveInfo
Blanket Implementations§
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
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>,
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>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more