#[repr(C)]pub struct FIFOOrderId {
pub price_in_ticks: Ticks,
pub order_sequence_number: u64,
}Fields§
§price_in_ticks: TicksThe price of the order, in ticks. Each market has a designated tick size (some number of quote lots per base unit) that is used to convert the price to ticks. For example, if the tick size is 0.01, then a price of 1.23 is converted to 123 ticks. If the quote lot size is 0.001, this means that there is a spacing of 10 quote lots in between each tick.
order_sequence_number: u64This is the unique identifier of the order, which is used to determine the side of the order. It is derived from the sequence number of the market.
If the order is a bid, the sequence number will have its bits inverted, and if it is an ask, the sequence number will be used as is.
The way to identify the side of the order is to check the leading bit of order_id.
A leading bit of 0 indicates an ask, and a leading bit of 1 indicates a bid. See Side::from_order_id.
Implementations§
Trait Implementations§
Source§impl BorshDeserialize for FIFOOrderId
impl BorshDeserialize for FIFOOrderId
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for FIFOOrderId
impl BorshSerialize for FIFOOrderId
Source§impl Clone for FIFOOrderId
impl Clone for FIFOOrderId
Source§fn clone(&self) -> FIFOOrderId
fn clone(&self) -> FIFOOrderId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FIFOOrderId
impl Debug for FIFOOrderId
Source§impl Default for FIFOOrderId
impl Default for FIFOOrderId
Source§fn default() -> FIFOOrderId
fn default() -> FIFOOrderId
Source§impl<MarketTraderId: Debug + PartialOrd + Ord + Default + Copy + Clone + Zeroable + Pod + BorshDeserialize + BorshSerialize, const BIDS_SIZE: usize, const ASKS_SIZE: usize, const NUM_SEATS: usize> Market<MarketTraderId, FIFOOrderId, FIFORestingOrder, OrderPacket> for FIFOMarket<MarketTraderId, BIDS_SIZE, ASKS_SIZE, NUM_SEATS>
impl<MarketTraderId: Debug + PartialOrd + Ord + Default + Copy + Clone + Zeroable + Pod + BorshDeserialize + BorshSerialize, const BIDS_SIZE: usize, const ASKS_SIZE: usize, const NUM_SEATS: usize> Market<MarketTraderId, FIFOOrderId, FIFORestingOrder, OrderPacket> for FIFOMarket<MarketTraderId, BIDS_SIZE, ASKS_SIZE, NUM_SEATS>
fn get_data_size(&self) -> usize
fn get_taker_fee_bps(&self) -> u64
fn get_tick_size(&self) -> QuoteLotsPerBaseUnitPerTick
fn get_base_lots_per_base_unit(&self) -> BaseLotsPerBaseUnit
fn get_sequence_number(&self) -> u64
fn get_collected_fee_amount(&self) -> QuoteLots
fn get_uncollected_fee_amount(&self) -> QuoteLots
fn get_registered_traders( &self, ) -> &dyn OrderedNodeAllocatorMap<MarketTraderId, TraderState>
fn get_trader_state(&self, trader_id: &MarketTraderId) -> Option<&TraderState>
fn get_trader_state_from_index(&self, index: u32) -> &TraderState
fn get_trader_index(&self, trader_id: &MarketTraderId) -> Option<u32>
fn get_trader_id_from_index(&self, trader_index: u32) -> MarketTraderId
fn get_book( &self, side: Side, ) -> &dyn OrderedNodeAllocatorMap<FIFOOrderId, FIFORestingOrder>
fn get_ladder(&self, levels: u64) -> Ladder
fn get_ladder_with_expiration( &self, levels: u64, last_valid_slot: Option<u64>, last_valid_unix_timestamp_in_seconds: Option<u64>, ) -> Ladder
fn get_typed_ladder(&self, levels: u64) -> TypedLadder
fn get_typed_ladder_with_expiration( &self, levels: u64, last_valid_slot: Option<u64>, last_valid_unix_timestamp_in_seconds: Option<u64>, ) -> TypedLadder
Source§impl Ord for FIFOOrderId
impl Ord for FIFOOrderId
Source§impl OrderId for FIFOOrderId
impl OrderId for FIFOOrderId
fn price_in_ticks(&self) -> u64
Source§impl PartialEq for FIFOOrderId
impl PartialEq for FIFOOrderId
Source§impl PartialOrd for FIFOOrderId
impl PartialOrd for FIFOOrderId
impl Copy for FIFOOrderId
impl Eq for FIFOOrderId
impl Pod for FIFOOrderId
impl StructuralPartialEq for FIFOOrderId
Auto Trait Implementations§
impl Freeze for FIFOOrderId
impl RefUnwindSafe for FIFOOrderId
impl Send for FIFOOrderId
impl Sync for FIFOOrderId
impl Unpin for FIFOOrderId
impl UnwindSafe for FIFOOrderId
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more