pub struct PercentageFeeModel {
pub rate: Decimal,
}Expand description
Percentage-of-notional fee model for spot and futures exchanges.
total_fee = rate * price * quantity.abs()
Common for crypto spot/futures exchanges (e.g. Binance 0.1% taker fee).
Fields§
§rate: DecimalFee rate as a decimal fraction. Typical range is [0, 1]:
0.001= 0.1% (common taker fee)0.0005= 0.05% (common maker fee)
No validation is performed; values outside [0, 1] are accepted
but produce unusual fee amounts.
Trait Implementations§
Source§impl Clone for PercentageFeeModel
impl Clone for PercentageFeeModel
Source§fn clone(&self) -> PercentageFeeModel
fn clone(&self) -> PercentageFeeModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PercentageFeeModel
impl Debug for PercentageFeeModel
Source§impl<'de> Deserialize<'de> for PercentageFeeModel
impl<'de> Deserialize<'de> for PercentageFeeModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FeeModel for PercentageFeeModel
impl FeeModel for PercentageFeeModel
Source§impl Hash for PercentageFeeModel
impl Hash for PercentageFeeModel
Source§impl Ord for PercentageFeeModel
impl Ord for PercentageFeeModel
Source§fn cmp(&self, other: &PercentageFeeModel) -> Ordering
fn cmp(&self, other: &PercentageFeeModel) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PercentageFeeModel
impl PartialEq for PercentageFeeModel
Source§fn eq(&self, other: &PercentageFeeModel) -> bool
fn eq(&self, other: &PercentageFeeModel) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PercentageFeeModel
impl PartialOrd for PercentageFeeModel
Source§impl Serialize for PercentageFeeModel
impl Serialize for PercentageFeeModel
impl Copy for PercentageFeeModel
impl Eq for PercentageFeeModel
impl StructuralPartialEq for PercentageFeeModel
Auto Trait Implementations§
impl Freeze for PercentageFeeModel
impl RefUnwindSafe for PercentageFeeModel
impl Send for PercentageFeeModel
impl Sync for PercentageFeeModel
impl Unpin for PercentageFeeModel
impl UnsafeUnpin for PercentageFeeModel
impl UnwindSafe for PercentageFeeModel
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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