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 (const: unstable) · 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
impl Eq for ReserveInfo
Source§impl PartialEq for ReserveInfo
impl PartialEq for ReserveInfo
Source§fn eq(&self, other: &ReserveInfo) -> bool
fn eq(&self, other: &ReserveInfo) -> bool
self and other values to be equal, and is used by ==.