Trait stable_swap_math::math::FeeCalculator
source · [−]pub trait FeeCalculator {
fn admin_trade_fee(&self, fee_amount: u64) -> Option<u64>;
fn admin_withdraw_fee(&self, fee_amount: u64) -> Option<u64>;
fn trade_fee(&self, trade_amount: u64) -> Option<u64>;
fn withdraw_fee(&self, withdraw_amount: u64) -> Option<u64>;
fn normalized_trade_fee(&self, n_coins: u8, amount: u64) -> Option<u64>;
}
Expand description
Calculates fees.
Required methods
fn admin_trade_fee(&self, fee_amount: u64) -> Option<u64>
fn admin_trade_fee(&self, fee_amount: u64) -> Option<u64>
Applies the admin trade fee.
fn admin_withdraw_fee(&self, fee_amount: u64) -> Option<u64>
fn admin_withdraw_fee(&self, fee_amount: u64) -> Option<u64>
Applies the admin withdraw fee.
fn withdraw_fee(&self, withdraw_amount: u64) -> Option<u64>
fn withdraw_fee(&self, withdraw_amount: u64) -> Option<u64>
Applies the withdraw fee.
Implementations on Foreign Types
sourceimpl FeeCalculator for Fees
impl FeeCalculator for Fees
sourcefn admin_trade_fee(&self, fee_amount: u64) -> Option<u64>
fn admin_trade_fee(&self, fee_amount: u64) -> Option<u64>
Apply admin trade fee
sourcefn admin_withdraw_fee(&self, fee_amount: u64) -> Option<u64>
fn admin_withdraw_fee(&self, fee_amount: u64) -> Option<u64>
Apply admin withdraw fee
sourcefn withdraw_fee(&self, withdraw_amount: u64) -> Option<u64>
fn withdraw_fee(&self, withdraw_amount: u64) -> Option<u64>
Compute withdraw fee from amount