pub struct Orderbook<K: Ord + OrderbookKey + Copy, V: OrderbookValue + Copy> {
pub raw_base_units_per_base_lot: f64,
pub quote_units_per_raw_base_unit_per_tick: f64,
pub bids: BTreeMap<K, V>,
pub asks: BTreeMap<K, V>,
}Fields§
§raw_base_units_per_base_lot: f64§quote_units_per_raw_base_unit_per_tick: f64§bids: BTreeMap<K, V>§asks: BTreeMap<K, V>Implementations§
Source§impl Orderbook<FIFOOrderId, PhoenixOrder>
impl Orderbook<FIFOOrderId, PhoenixOrder>
pub fn from_market( market: &dyn Market<Pubkey, FIFOOrderId, FIFORestingOrder, OrderPacket>, raw_base_units_per_base_lot: f64, quote_units_per_raw_base_unit_per_tick: f64, ) -> Self
Source§impl<K: Ord + OrderbookKey + Copy, V: OrderbookValue + Copy> Orderbook<K, V>
impl<K: Ord + OrderbookKey + Copy, V: OrderbookValue + Copy> Orderbook<K, V>
pub fn get_bids(&self) -> Vec<(K, V)>
pub fn get_asks(&self) -> Vec<(K, V)>
pub fn print_ladder(&self, levels: usize, precision: usize)
pub fn update_orders(&mut self, side: Side, orders: Vec<(K, V)>)
pub fn process_book_update(&mut self, side: Side, price: K, lots_remaining: V)
pub fn process_trade(&mut self, side: Side, price: K, lots_remaining: V)
pub fn vwap(&self, levels: usize) -> f64
Trait Implementations§
Source§impl<K: Clone + Ord + OrderbookKey + Copy, V: Clone + OrderbookValue + Copy> Clone for Orderbook<K, V>
impl<K: Clone + Ord + OrderbookKey + Copy, V: Clone + OrderbookValue + Copy> Clone for Orderbook<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Orderbook<K, V>
impl<K, V> RefUnwindSafe for Orderbook<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Orderbook<K, V>
impl<K, V> Sync for Orderbook<K, V>
impl<K, V> Unpin for Orderbook<K, V>
impl<K, V> UnwindSafe for Orderbook<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
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<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