#[repr(packed(1))]pub struct AssetPool {Show 39 fields
pub token_name: [u8; 32],
pub mint_key: Pubkey,
pub mint_decimal_multiplier: u64,
pub pool_id: u8,
pub deposit_amount: RawAmt,
pub deposit_index: f64,
pub borrow_amount: RawAmt,
pub borrow_index: f64,
pub reserve_factor: f64,
pub fee_amount: RawAmt,
pub fee_withdrawn_amount: u64,
pub current_fee_rate: f64,
pub last_update_time: u64,
pub spl_key: Pubkey,
pub atoken_mint_key: Pubkey,
pub asset_price_key: Pubkey,
pub pyth_price_key: Pubkey,
pub serum_next_cl_id: u64,
pub ltv: f64,
pub safe_factor: f64,
pub flags: u8,
pub base_rate: f64,
pub multiplier: f64,
pub jump_multiplier: f64,
pub kink: f64,
pub current_borrow_rate: f64,
pub current_deposit_rate: f64,
pub reward_multiplier: f64,
pub reward_deposit_intra_share: f64,
pub reward_apr_per_year: u64,
pub deposit_apt_reward_amount_per_year: u64,
pub borrow_apt_reward_amount_per_year: u64,
pub apt_reward_per_year_per_deposit: f64,
pub apt_reward_per_year_per_borrow: f64,
pub reward_deposit_index: f64,
pub reward_borrow_index: f64,
pub deposit_cap: u64,
pub is_disabled: u8,
pub farm_yield: f64,
}Fields§
§token_name: [u8; 32]§mint_key: Pubkey§mint_decimal_multiplier: u64§pool_id: u8§deposit_amount: RawAmt§deposit_index: f64§borrow_amount: RawAmt§borrow_index: f64§reserve_factor: f64§fee_amount: RawAmt§fee_withdrawn_amount: u64§current_fee_rate: f64§last_update_time: u64§spl_key: Pubkey§atoken_mint_key: Pubkey§asset_price_key: Pubkey§pyth_price_key: Pubkey§serum_next_cl_id: u64§ltv: f64§safe_factor: f64§flags: u8§base_rate: f64§multiplier: f64§jump_multiplier: f64§kink: f64§current_borrow_rate: f64§current_deposit_rate: f64§reward_multiplier: f64§reward_apr_per_year: u64§deposit_apt_reward_amount_per_year: u64§borrow_apt_reward_amount_per_year: u64§apt_reward_per_year_per_deposit: f64§apt_reward_per_year_per_borrow: f64§reward_deposit_index: f64§reward_borrow_index: f64§deposit_cap: u64§is_disabled: u8§farm_yield: f64Implementations§
Source§impl AssetPool
impl AssetPool
pub fn from_account_info<'a>( acc_info: &'a AccountInfo<'_>, ) -> Result<Ref<'a, Self>, ProgramError>
pub fn from_bytes(data: &[u8]) -> &Self
pub fn calculate_new_interest_rate( self, deposit_native_amt: u64, borrow_native_amt: u64, ) -> (f64, f64)
pub fn calculate_interest_rate( deposit_amt: f64, borrow_amt: f64, base_rate: f64, multiplier: f64, jump_multiplier: f64, kink: f64, reserve_factor: f64, ) -> (f64, f64)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AssetPool
impl RefUnwindSafe for AssetPool
impl Send for AssetPool
impl Sync for AssetPool
impl Unpin for AssetPool
impl UnwindSafe for AssetPool
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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