Trait baseline::quote::TopOfBook

source ·
pub trait TopOfBook {
    type Price;
    type Volume;

    fn bid_price(&self) -> Option<Self::Price>;
    fn bid_volume(&self) -> Option<Self::Volume>;
    fn ask_price(&self) -> Option<Self::Price>;
    fn ask_volume(&self) -> Option<Self::Volume>;

    fn mid_price(
        &self
    ) -> Option<<<Self::Price as Add>::Output as Div<Self::Price>>::Output>
    where
        Self::Price: Add + From<u8>,
        <Self::Price as Add>::Output: Div<Self::Price>
, { ... } }
Expand description

Includes methods to get the top of book bid & ask.

Required Associated Types

Required Methods

Provided Methods

Calculate the mid price from the bid and ask.

Implementors