Struct stable_swap::fees::Fees
source · [−]#[repr(C)]pub struct Fees {
pub admin_trade_fee_numerator: u64,
pub admin_trade_fee_denominator: u64,
pub admin_withdraw_fee_numerator: u64,
pub admin_withdraw_fee_denominator: u64,
pub trade_fee_numerator: u64,
pub trade_fee_denominator: u64,
pub withdraw_fee_numerator: u64,
pub withdraw_fee_denominator: u64,
}
Expand description
Fees struct
Fields
admin_trade_fee_numerator: u64
Admin trade fee numerator
admin_trade_fee_denominator: u64
Admin trade fee denominator
admin_withdraw_fee_numerator: u64
Admin withdraw fee numerator
admin_withdraw_fee_denominator: u64
Admin withdraw fee denominator
trade_fee_numerator: u64
Trade fee numerator
trade_fee_denominator: u64
Trade fee denominator
withdraw_fee_numerator: u64
Withdraw fee numerator
withdraw_fee_denominator: u64
Withdraw fee denominator
Trait Implementations
sourceimpl FeeCalculator for Fees
impl FeeCalculator for Fees
sourcepub fn admin_trade_fee(&self, fee_amount: u64) -> Option<u64>
pub fn admin_trade_fee(&self, fee_amount: u64) -> Option<u64>
Apply admin trade fee
sourcepub fn admin_withdraw_fee(&self, fee_amount: u64) -> Option<u64>
pub fn admin_withdraw_fee(&self, fee_amount: u64) -> Option<u64>
Apply admin withdraw fee
sourcepub fn withdraw_fee(&self, withdraw_amount: u64) -> Option<u64>
pub fn withdraw_fee(&self, withdraw_amount: u64) -> Option<u64>
Compute withdraw fee from amount
sourceimpl Pack for Fees
impl Pack for Fees
pub fn unpack_from_slice(input: &[u8]) -> Result<Fees, ProgramError>
pub fn pack_into_slice(&self, output: &mut [u8])
sourcefn get_packed_len() -> usize
fn get_packed_len() -> usize
Get the packed length
sourcefn unpack(input: &[u8]) -> Result<Self, ProgramError> where
Self: IsInitialized,
fn unpack(input: &[u8]) -> Result<Self, ProgramError> where
Self: IsInitialized,
Unpack from slice and check if initialized
sourcefn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
Unpack from slice without checking if initialized
impl Copy for Fees
impl Sealed for Fees
impl StructuralPartialEq for Fees
Auto Trait Implementations
impl RefUnwindSafe for Fees
impl Send for Fees
impl Sync for Fees
impl Unpin for Fees
impl UnwindSafe for Fees
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
pub default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more