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.