pub struct FeeSchedule { /* private fields */ }Expand description
Fee schedule: a (taker, maker) fee pair per fee tier, with the key
identifying which schedule it is.
Fees are fractions of the traded amount, converted from the on-chain
hundred-thousandths (Per100K) representation.
Implementations§
Source§impl FeeSchedule
impl FeeSchedule
Sourcepub fn key(&self) -> FeeScheduleKey
pub fn key(&self) -> FeeScheduleKey
Schedule this perpetual/exchange resolves its fees from.
Sourcepub fn is_tiered(&self) -> bool
pub fn is_tiered(&self) -> bool
Whether the rates were reported per tier, rather than filled in from a base rate observed on its own.
False against a pre-v1.1.7.4 deployment, which has no tiers to report: every tier then carries the base rate, and reading a discounted one back tells the caller nothing the base rate did not.
Sourcepub fn taker_fee(&self, tier: FeeTier) -> UD64
pub fn taker_fee(&self, tier: FeeTier) -> UD64
Taker fee of the given tier.
Out-of-range tiers (the contract bounds them to 0..8 on write) resolve
to the base rate.
Sourcepub fn maker_fee(&self, tier: FeeTier) -> UD64
pub fn maker_fee(&self, tier: FeeTier) -> UD64
Maker fee of the given tier.
Out-of-range tiers (the contract bounds them to 0..8 on write) resolve
to the base rate.
Sourcepub fn base_taker_fee(&self) -> UD64
pub fn base_taker_fee(&self) -> UD64
Base (tier 0) taker fee.
Sourcepub fn base_maker_fee(&self) -> UD64
pub fn base_maker_fee(&self) -> UD64
Base (tier 0) maker fee.
Sourcepub fn taker_fees(&self) -> &[UD64; 8]
pub fn taker_fees(&self) -> &[UD64; 8]
Taker fee of every tier, base rate first.
Sourcepub fn maker_fees(&self) -> &[UD64; 8]
pub fn maker_fees(&self) -> &[UD64; 8]
Maker fee of every tier, base rate first.
Trait Implementations§
Source§impl Clone for FeeSchedule
impl Clone for FeeSchedule
Source§fn clone(&self) -> FeeSchedule
fn clone(&self) -> FeeSchedule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FeeSchedule
Source§impl Debug for FeeSchedule
impl Debug for FeeSchedule
Auto Trait Implementations§
impl Freeze for FeeSchedule
impl RefUnwindSafe for FeeSchedule
impl Send for FeeSchedule
impl Sync for FeeSchedule
impl Unpin for FeeSchedule
impl UnsafeUnpin for FeeSchedule
impl UnwindSafe for FeeSchedule
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.