pub struct Actions { /* private fields */ }Expand description
Actions buffer - orders to send.
Implementations§
Source§impl Actions
impl Actions
pub const fn new() -> Self
pub fn clear(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
Sourcepub fn buy(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
pub fn buy(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
Place a limit buy order (GTC - Good Till Canceled).
Sourcepub fn sell(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
pub fn sell(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
Place a limit sell order (GTC - Good Till Canceled).
Sourcepub fn order(
&mut self,
order_id: u64,
side: i8,
qty_1e8: i64,
px_1e9: u64,
) -> bool
pub fn order( &mut self, order_id: u64, side: i8, qty_1e8: i64, px_1e9: u64, ) -> bool
Place limit order with explicit side (1=buy, -1=sell).
Sourcepub fn market_buy(&mut self, order_id: u64, qty_1e8: i64) -> bool
pub fn market_buy(&mut self, order_id: u64, qty_1e8: i64) -> bool
Place a market buy order (fills immediately).
Sourcepub fn market_sell(&mut self, order_id: u64, qty_1e8: i64) -> bool
pub fn market_sell(&mut self, order_id: u64, qty_1e8: i64) -> bool
Place a market sell order (fills immediately).
Sourcepub fn ioc_buy(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
pub fn ioc_buy(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
Place IOC buy - fills available liquidity, cancels unfilled portion.
Sourcepub fn ioc_sell(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
pub fn ioc_sell(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
Place IOC sell - fills available liquidity, cancels unfilled portion.
Sourcepub fn fok_buy(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
pub fn fok_buy(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
Place FOK buy - must fill entire quantity or rejected.
Sourcepub fn fok_sell(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
pub fn fok_sell(&mut self, order_id: u64, qty_1e8: i64, px_1e9: u64) -> bool
Place FOK sell - must fill entire quantity or rejected.
Sourcepub fn post_only_buy(
&mut self,
order_id: u64,
qty_1e8: i64,
px_1e9: u64,
) -> bool
pub fn post_only_buy( &mut self, order_id: u64, qty_1e8: i64, px_1e9: u64, ) -> bool
Place a post-only buy order (maker only, rejected if would cross).
Sourcepub fn post_only_sell(
&mut self,
order_id: u64,
qty_1e8: i64,
px_1e9: u64,
) -> bool
pub fn post_only_sell( &mut self, order_id: u64, qty_1e8: i64, px_1e9: u64, ) -> bool
Place a post-only sell order (maker only, rejected if would cross).
Sourcepub fn order_typed(
&mut self,
order_id: u64,
side: i8,
qty_1e8: i64,
px_1e9: u64,
order_type: u8,
) -> bool
pub fn order_typed( &mut self, order_id: u64, side: i8, qty_1e8: i64, px_1e9: u64, order_type: u8, ) -> bool
Place order with explicit type.
Sourcepub fn cancel_all(&mut self, state: &AlgoState)
pub fn cancel_all(&mut self, state: &AlgoState)
Cancel all open orders.
Sourcepub fn amend(
&mut self,
order_id: u64,
new_qty_1e8: i64,
new_px_1e9: u64,
) -> bool
pub fn amend( &mut self, order_id: u64, new_qty_1e8: i64, new_px_1e9: u64, ) -> bool
Amend an existing order’s price and/or quantity.
Uses is_cancel = ACTION_AMEND (2). The venue performs an atomic
edit — the order keeps its ID and (when only qty decreases) its
queue position.
Returns false if the actions buffer is full.
Sourcepub fn amend_on(
&mut self,
venue_id: u8,
order_id: u64,
new_qty_1e8: i64,
new_px_1e9: u64,
) -> bool
pub fn amend_on( &mut self, venue_id: u8, order_id: u64, new_qty_1e8: i64, new_px_1e9: u64, ) -> bool
Amend an existing order on a specific venue.
Sourcepub fn buy_on(
&mut self,
venue_id: u8,
order_id: u64,
qty_1e8: i64,
px_1e9: u64,
) -> bool
pub fn buy_on( &mut self, venue_id: u8, order_id: u64, qty_1e8: i64, px_1e9: u64, ) -> bool
Place a limit buy on a specific venue.
venue_id is a VenueId value from NbboSnapshot.venue_ids[].
Sourcepub fn sell_on(
&mut self,
venue_id: u8,
order_id: u64,
qty_1e8: i64,
px_1e9: u64,
) -> bool
pub fn sell_on( &mut self, venue_id: u8, order_id: u64, qty_1e8: i64, px_1e9: u64, ) -> bool
Place a limit sell on a specific venue.
Sourcepub fn ioc_buy_on(
&mut self,
venue_id: u8,
order_id: u64,
qty_1e8: i64,
px_1e9: u64,
) -> bool
pub fn ioc_buy_on( &mut self, venue_id: u8, order_id: u64, qty_1e8: i64, px_1e9: u64, ) -> bool
Place an IOC buy on a specific venue.
Sourcepub fn ioc_sell_on(
&mut self,
venue_id: u8,
order_id: u64,
qty_1e8: i64,
px_1e9: u64,
) -> bool
pub fn ioc_sell_on( &mut self, venue_id: u8, order_id: u64, qty_1e8: i64, px_1e9: u64, ) -> bool
Place an IOC sell on a specific venue.
Sourcepub fn order_on_venue(
&mut self,
venue_id: u8,
order_id: u64,
side: i8,
qty_1e8: i64,
px_1e9: u64,
order_type: u8,
) -> bool
pub fn order_on_venue( &mut self, venue_id: u8, order_id: u64, side: i8, qty_1e8: i64, px_1e9: u64, order_type: u8, ) -> bool
Place a venue-targeted order with explicit side and order type. Used by the runtime to replay actions read from WASM memory.
Sourcepub fn clear_at(&mut self, idx: usize)
pub fn clear_at(&mut self, idx: usize)
Zero out an action at index (marks as no-op). Used by risk engine to neutralize rejected actions in-place.