pub struct L1 {
pub lmp: Option<u64>,
pub bid_head: Option<u64>,
pub ask_head: Option<u64>,
pub limit_buy_slippage_limit: Option<u64>,
pub limit_sell_slippage_limit: Option<u64>,
pub market_buy_slippage_limit: Option<u64>,
pub market_sell_slippage_limit: Option<u64>,
}Fields§
§lmp: Option<u64>Last match price
bid_head: Option<u64>Head of the bid list
ask_head: Option<u64>Head of the ask list
limit_buy_slippage_limit: Option<u64>Slippage limit for limit buy orders in 8 decimals
limit_sell_slippage_limit: Option<u64>Slippage limit for limit sell orders in 8 decimals
market_buy_slippage_limit: Option<u64>Slippage limit for market buy orders in 8 decimals
market_sell_slippage_limit: Option<u64>Slippage limit for market sell orders in 8 decimals
Implementations§
Source§impl L1
impl L1
pub fn new() -> Self
pub fn new_with_slippage( lmp: Option<u64>, bid_head: Option<u64>, ask_head: Option<u64>, limit_buy_slippage_limit: Option<u64>, limit_sell_slippage_limit: Option<u64>, market_buy_slippage_limit: Option<u64>, market_sell_slippage_limit: Option<u64>, ) -> Self
pub fn ask_head(&self) -> Option<u64>
pub fn bid_head(&self) -> Option<u64>
pub fn lmp(&self) -> Option<u64>
pub fn set_lmp(&mut self, price: u64)
pub fn set_ask_head(&mut self, price: u64)
pub fn set_bid_head(&mut self, price: u64)
Sourcepub fn set_limit_buy_slippage_limit(&mut self, slippage_limit: Option<u64>)
pub fn set_limit_buy_slippage_limit(&mut self, slippage_limit: Option<u64>)
Set the slippage limit for limit buy orders
Sourcepub fn set_limit_sell_slippage_limit(&mut self, slippage_limit: Option<u64>)
pub fn set_limit_sell_slippage_limit(&mut self, slippage_limit: Option<u64>)
Set the slippage limit for limit sell orders
Sourcepub fn set_market_buy_slippage_limit(&mut self, slippage_limit: Option<u64>)
pub fn set_market_buy_slippage_limit(&mut self, slippage_limit: Option<u64>)
Set the slippage limit for market buy orders
Sourcepub fn set_market_sell_slippage_limit(&mut self, slippage_limit: Option<u64>)
pub fn set_market_sell_slippage_limit(&mut self, slippage_limit: Option<u64>)
Set the slippage limit for market sell orders
Sourcepub fn det_limit_sell_make_price(
&self,
lp: u64,
bid_head: u64,
ask_head: u64,
spread: u32,
) -> u64
pub fn det_limit_sell_make_price( &self, lp: u64, bid_head: u64, ask_head: u64, spread: u32, ) -> u64
Determine the maker price for a limit sell order This function calculates the price at which a limit sell order should be placed as a maker order based on current market conditions, limit price, and spread.
lp: Limit price specified by the userbid_head: Current best bid price (0 if no bids)ask_head: Current best ask price (0 if no asks)spread: Spread in basis points (10000 = 100%)- Returns the calculated maker price and lmp tuple
Sourcepub fn det_limit_buy_make_price(
&self,
lp: u64,
bid_head: u64,
ask_head: u64,
spread: u32,
) -> u64
pub fn det_limit_buy_make_price( &self, lp: u64, bid_head: u64, ask_head: u64, spread: u32, ) -> u64
Determine the maker price for a limit buy order This function calculates the price at which a limit buy order should be placed as a maker order based on current market conditions, limit price, and spread.
lp: Limit price specified by the userbid_head: Current best bid price (0 if no bids)ask_head: Current best ask price (0 if no asks)spread: Spread in basis points (10000 = 100%)- Returns the calculated maker price and lmp tuple
Sourcepub fn det_market_buy_make_price(
&self,
bid_head: u64,
ask_head: u64,
spread: u32,
) -> u64
pub fn det_market_buy_make_price( &self, bid_head: u64, ask_head: u64, spread: u32, ) -> u64
Determine the maker price for a market buy order This function calculates the price at which a market buy order should be placed as a maker order based on current market conditions (bid_head, ask_head, lmp) and spread.
bid_head: Current best bid price (0 if no bids)ask_head: Current best ask price (0 if no asks)spread: Spread in basis points (10000 = 100%)- Returns the calculated maker price
Sourcepub fn det_market_sell_make_price(
&self,
bid_head: u64,
ask_head: u64,
spread: u32,
) -> u64
pub fn det_market_sell_make_price( &self, bid_head: u64, ask_head: u64, spread: u32, ) -> u64
Determine the maker price for a market sell order This function calculates the price at which a market sell order should be placed as a maker order based on current market conditions (bid_head, ask_head, lmp) and spread.
bid_head: Current best bid price (0 if no bids)ask_head: Current best ask price (0 if no asks)spread: Spread in basis points (10000 = 100%)- Returns the calculated maker price (minimum 1 to prevent zero price)