Struct phoenix_sdk::orderbook::Orderbook
source · pub struct Orderbook<K, V>where
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, Global>,
pub asks: BTreeMap<K, V, Global>,
}Fields§
§raw_base_units_per_base_lot: f64§quote_units_per_raw_base_unit_per_tick: f64§bids: BTreeMap<K, V, Global>§asks: BTreeMap<K, V, Global>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 ) -> Orderbook<FIFOOrderId, PhoenixOrder>
source§impl<K, V> Orderbook<K, V>where
K: Ord + OrderbookKey + Copy,
V: OrderbookValue + Copy,
impl<K, V> Orderbook<K, V>where K: Ord + OrderbookKey + Copy, V: OrderbookValue + Copy,
pub fn get_bids(&self) -> Vec<(K, V), Global>
pub fn get_asks(&self) -> Vec<(K, V), Global>
pub fn print_ladder(&self, levels: usize, precision: usize)
pub fn update_orders(&mut self, side: Side, orders: Vec<(K, V), Global>)
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, V> Clone for Orderbook<K, V>where
K: Clone + Ord + OrderbookKey + Copy,
V: Clone + OrderbookValue + Copy,
impl<K, V> Clone for Orderbook<K, V>where K: Clone + Ord + OrderbookKey + Copy, V: Clone + OrderbookValue + Copy,
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for Orderbook<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,
impl<K, V> Send for Orderbook<K, V>where K: Send, V: Send,
impl<K, V> Sync for Orderbook<K, V>where K: Sync, V: Sync,
impl<K, V> Unpin for Orderbook<K, V>
impl<K, V> UnwindSafe for Orderbook<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request